Is the current model pricing available via the API?

Hi,

I found this list for the current prices per token for the various models:

It would be very convenient if those prices were available via the API, too.

For instance, it would be great if the below list would also contain the current prices per token, which, afaik, it doesn’t.

import openai
openai.Model.list()

Does someone know whether it is currently possible to obtain the pricing information programmatically?

Thank you for your help!

2 Likes