AI Token & API Cost Calculator
A plain arithmetic calculator for estimating AI API costs from input/output token counts and editable per-model pricing. It never calls any AI service.
Runs locally in your browser
Enter per-million-token prices from your provider. Monthly figure assumes 30 days at a steady request rate.
Discuss a result
Write a short summary and review it before posting. Your tool inputs are never copied automatically.
What is the AI Token & API Cost Calculator?
This is a normal arithmetic calculator for estimating API costs. You enter token counts and per-million-token prices you control. It does not connect to, call, or integrate any AI service.
How to use it
- 1Enter or edit the input and output price per million tokens.
- 2Enter your input and output token counts.
- 3Optionally set requests per day.
- 4Read the per-request and projected costs.
How it works
Cost = (input tokens / 1,000,000 × input price) + (output tokens / 1,000,000 × output price). Daily and monthly projections multiply by your request volume.
Limitations & notes
- Prices are whatever you enter — keep them current with your provider.
- Does not account for caching, batching discounts or free tiers.
Frequently asked questions
What is a token and how many words is it?
A token is the unit language models read and write: a whole short word, part of a longer word, a punctuation mark or a space. For English, a common rule of thumb is about 4 characters or 0.75 words per token, so 1,000 tokens is roughly 750 words. Code, numbers and non-English text often use more tokens per word. Each provider has its own tokenizer, so use its token counter or the usage field in API responses for exact figures.
Why are output tokens more expensive than input tokens?
Input tokens are processed in parallel in one pass, while output tokens are generated one at a time, each needing its own pass through the model. Most providers therefore charge several times more per output token, often 3 to 5 times as much. That is why the calculator has separate prices: a request with a long prompt and a short answer can cost less than one with a short prompt and a long answer.
What should I count as input tokens per request?
Everything you send: the system prompt, instructions, any retrieved documents, tool definitions and the full conversation history. In a chat app the history is resent on every turn, so input tokens grow as a conversation gets longer. A 2,000 token system prompt across 10,000 daily requests is 20 million input tokens a day by itself. Reasoning or thinking tokens that some models produce are usually billed as output.
How do I read the default example?
The defaults are 1,500 input and 600 output tokens per request, with prices of 0.15 and 0.60 dollars per million tokens and 5,000 requests a day. That gives 0.000225 plus 0.00036, or 0.000585 dollars per request, about 2.93 dollars per day and 87.75 dollars per month, since the monthly figure is the daily cost times 30. These prices are placeholders, not a quote from any provider; replace them with the current rates for your model.
Why might my real bill differ from the estimate?
Vendor prices change often, and the calculator uses only the numbers you type. It also does not model prompt caching discounts, batch processing discounts, free tiers, long-context surcharges, image or audio inputs, taxes, or retries after errors. Traffic is rarely steady every day either. To approximate a cache discount, lower the input price to a blended rate, and check your provider's usage dashboard after a week to calibrate the token counts.
No directly related discussion yet.
Start a focused thread and share the question this tool helped you explore.
Ask the community about AI Token & API Cost Calculator