AI API cost calculator
How it adds up
| Item | Input | Output | Total |
|---|---|---|---|
| Per request | 0.00450 | 0.00750 | 0.0120 |
| Per 1,000 requests | 4.50 | 7.50 | 12.00 |
| Per day | 4.50 | 7.50 | 12.00 |
| Per month | 135.00 | 225.00 | 360.00 |
| Per year | 1,620.00 | 2,700.00 | 4,320.00 |
Prices are per million tokens and change often, so use your provider’s current pricing page. Not included: discounts for cached input or batch requests where a provider offers them, and reasoning tokens some models bill as output.
Worked out from the numbers you enter. Calculated in this browser; nothing you enter is sent anywhere or stored.
How to use it · free, no signup
How to use the AI API Cost Calculator
Enter your requests a day, the input and output tokens per request and your provider’s prices to see the cost per request, day, month and year. Calculated in your browser.
01
Enter the volume
Requests a day, and the days a month they happen.
02
Enter the tokens
Average input and output tokens for one request.
03
Enter the prices
Input and output prices per million tokens, from your provider.
How API pricing works
Language model APIs charge for the tokens they read and the tokens they write, priced per million tokens, with output usually priced higher. The cost of a request is input tokens times the input price plus output tokens times the output price. The example uses 1,000 requests a day of 1,500 input and 500 output tokens, at prices of 3 and 15 per million.
| Period | Input | Output | Total |
|---|---|---|---|
| Per request | 0.0045 | 0.0075 | 0.012 |
| Per day | 4.50 | 7.50 | 12.00 |
| Per month, 30 days | 135.00 | 225.00 | 360.00 |
| Per year | 1,620.00 | 2,700.00 | 4,320.00 |
Why output is most of the bill
In the example, output is a quarter of the tokens but about 63% of the cost, because each output token costs five times as much as an input token. That changes where savings come from. Asking for shorter answers, or a set format with no preamble, often cuts the bill more than trimming the prompt does.
Ways to lower the cost
- Cap the answer length in the prompt and with the API’s maximum output setting.
- Use a smaller model for simple tasks such as classification or extraction, and keep the larger one for work that needs it.
- Shorten repeated instructions, which are paid for on every request.
- Use cached input or batch pricing where your provider offers it, for long shared context or work that can wait.
Estimating tokens before you have traffic
Once a service is running, the API reports the tokens of every response and the averages are easy to measure. Before that, paste a typical prompt and a typical answer into the token counter for an estimate. To check that a long prompt fits the model at all, use the context window calculator, and to see whether the time the tool saves covers what it costs, the AI ROI calculator.
Published by Koit Academy. Who runs it, how it is paid and how its tools are checked.
Questions
What people ask about the AI API Cost Calculator
How is the cost of an API request calculated?
Why are output tokens more expensive?
Where do I find the prices?
How do I know how many tokens a request uses?
Does this include discounts?
Related tools
Context Window Calculator
How many words and pages fit in a context window
Open itToken Counter
An estimate of the tokens in any text
Open itAI Prompt Generator
One clear prompt from its parts
Open itAI ROI Calculator
Whether an AI tool pays for the time it saves
Open itChunk Size Calculator
Chunks, overlap and cost for retrieval
Open itLLM Rate Limit Calculator
How long a batch takes under RPM and TPM limits
Open it