API & File = What is the Cost?

Hi All,

I have a question for the new “Upload File” function for Developers. I am in search of a way to calculate the price.

Here is the fictive scenario:
1 File of 100 MB, containing 10,000 rows (.jsonl file)

-How much would it cost for to make ONE (1) inquiry into this file?

Scanning/reading the document will also cost tokens?

Thanks

Hi and welcome to the Developer Forum!

You would pay $0.20 per 1Gigabyte per day or part thereof, so for a 100MB file that would be $0.02 per day per assistant plus whatever token charges for your model of choice going to the API and back from the API.

Hi. If is per day, it means every day you pay it even if you don’t use it?

Yes, storage is charged per Mb or Gb as the storage is still being taken up with your data irrespective of if you are using it or not.

What is the token cost? I know the per token cost but I’m finding single questions asked of the “GPTs” range from costing fractions of a penny to multiple dollars when using the same file. How do I know the cost in advance?

The first question asked on data the results in little context being found will produce a small amount of tokens used, but a question many questions down the line with complex context retrievals from the dataset you provide may take many tokens to full evaluate as all of the historical data needs to be sent each time to keep the conversational format.

What does it means, all historical data needs to be sent each time? Means if i send 512 MB of data first time with prompt and send subsequent prompts in same context then it will consider 512MB data again and calculate token and cost?

Yes.

It is not possible to send megabytes of data directly to an OpenAI AI model. Input is placed into a limited context length. This is under 100k words on the largest models before you get an API error.

1 Like

As of today, your first GB to store something on vector store should be free. Check this link out.
https://platform.openai.com/docs/assistants/tools/file-search/managing-costs-with-expiration-policies