XEVMS

How to estimate monthly AI API costs

Build a token budget from a small sample and compare normal usage with a busier month.

Start with a sample of real requests

Take a small sample of representative requests and record the provider’s reported input and output tokens. Include instructions, conversation history and retrieved text in the input total where the provider counts them. A one-line question in a long conversation can still have a large input count.

Use separate estimates for short answers and long answers if your application has both. Output may have a different price, so a single combined token count is a poor basis for comparing two models.

Work through a monthly estimate

Suppose you expect 10,000 requests in a month, averaging 1,200 input and 350 output tokens. That is 12 million input tokens and 3.5 million output tokens. At illustrative rates of $0.80 and $3.20 per million respectively, the estimate is $9.60 for input plus $11.20 for output, or $20.80 in total.

Enter the two monthly totals into the calculator. For a busier month, double the request count and keep the mix of requests constant. The estimate doubles to $41.60. If answers also get longer, change the output total independently.

Compare the result with your invoice

Copy the pricing units from the provider’s price sheet and check whether cached input, batch processing, image inputs or tool calls use separate rates. A useful budget records which pricing date and assumptions you used, so you can update the estimate without resampling every request.

Tools