Search code examples
openai-apichatgpt-apigpt-3

Text-davinci-003 api pricing?


I am using the text-davinci-003 model in Python.

response = openai.Completion.create(
     engine="text-davinci-003",
     prompt=question,
     max_tokens=100
)

I am finding the amount of tokens via: print(response.usage.total_tokens). I cannot find for the life of me the pricing for text-davinci-003 model, only some forum I read that it is 0.0120 / 1000k tokens. so based on this calculation, for my most recent request at 403 tokens, I should be being charged 0.004884 for the request. however, when I go into my billing dashboard, I see it went up by 1 cent. just trying to figure out the total cost. Thanks for the help in advance.


Solution

  • Based on the OpenAI website, the text-davinci-003 model is $0.02 per 1000 tokens, which is quite in line with what you've been billed. Note that the model will become deprecated on January 04, 2024.

    I found the pricing with the Google search for openai models pricing, which lead me to https://openai.com/pricing, and from there I went to "Other Models" -> "Older models".