AI BUDGET PLANNING
AI token and API cost calculator
Turn tokens into a budget. Estimate input and output costs using your own rates, without connecting an API.
Your scenario
Enter rates in USD per million tokens. These are not verified provider prices.
Results
Your estimate will appear here
Complete your scenario and both rates, or load an illustrative example.
Total for the period
Daily average:
- Input
- tokens ·
- Output
- tokens ·
Amounts are rounded; displayed subtotals may not add up to the displayed total.
Limits: up to 1,000,000 daily requests and tokens per request; 1–31 days. USD only.
How the calculation works
For each token type: daily requests × days × tokens per request × rate per million ÷ 1,000,000. Add input and output costs. The daily average divides the total by the specified days.
An example you can check
100 daily requests over 30 days, with 1,000 input and 500 output tokens per request. At illustrative rates of USD 2 and USD 8 per million: input USD 6, output USD 12, total USD 18.
What this estimate includes
Constant average usage and rates you enter. Excludes taxes, caching, batch discounts, tools, media, retries, chat subscriptions and currency conversion. Depending on the provider, reasoning tokens, long contexts, minimum charges and pricing tiers may need separate calculations.
This calculator code does not send or store your inputs. See site policies for other services.
How to get your real token counts
The estimate is only as good as the tokens per request you enter. Before you set a budget, measure your usage instead of guessing it:
- Read the counter on every response. The APIs of the main providers return a usage block with the billed input and output tokens on every response (for example
usage.input_tokensandusage.output_tokens, orprompt_tokensandcompletion_tokens, depending on the provider). Store it with each request. - Check it against the billing console. The provider's usage dashboard usually breaks tokens down by model and by day. Divide the day's tokens by the day's requests to get the real average.
- Measure a representative week. A single day can mislead. Work out the average and a high value (for example the 90th percentile) and try both in the calculator to see the range.
What counts as input and what counts as output
Input is not just the user's question: it includes the system instructions, the conversation history, any documents you add as context and the tool definitions. In a chat, the history grows with every turn, so the average input of a long conversation is much larger than that of the first message. Output is the text the model generates; with reasoning models, reasoning tokens are usually billed as output even though you do not see them. Because the output rate is often several times the input rate, capping response length frequently saves more than shortening the prompt.
When the result stops being useful
- If you use prompt caching or the batch API, part of the tokens is billed at a different rate: calculate that part separately with its own rate.
- Above a long-context threshold, some models apply different rates from that size onwards.
- Images, audio and tools (web search, code execution) are counted or charged under their own rules.
- Retries and errors also consume tokens; if your application retries, add them to the daily requests.
- Chat subscription plans, free credits, spend commitments, taxes and currency conversion are not part of this calculation.
If your usage varies a lot from month to month, the guide to budgeting AI tokens explains how to turn several volume and response-length scenarios into a monthly budget.
Content reviewed on October 7, 2026. You always enter the rates yourself; check your provider's official pricing page.
More software decisions
Compare automation costs or productivity licences too.
Browse all tools