AI Token Cost Calculator
Estimate what your AI API calls cost — pick a model, enter tokens, get instant pricing.
Prices per 1M tokens (input / output). Approximate — check provider pricing for current rates.
How it works
- Pick a model — Each model has different per-token rates for input and output.
- Enter tokens — Roughly 1,000 tokens ≈ 750 words of English text.
- Get cost — Input tokens × input rate + output tokens × output rate.
- Rates change — These are approximate 2026 rates. Check the provider's pricing page for current figures.
Related tools
What a token really is, and what it does to your bill
AI APIs do not bill by the word or the character — they bill by the token, a chunk of text averaging roughly three-quarters of a word in English. A common word may be a single token; a rare word, a long number, or a block of code can be several. Every model also charges separately for input — your prompt plus any documents, instructions, and conversation history you send — and for output, which typically costs four to five times more per token. The silent budget killer is anything re-sent on every call: a 4,000-token system prompt or a long chat history is paid for again and again, on every single request.
Say your app sends a 2,000-token prompt and receives a 500-token reply, 1,000 times a day. That is 2 million input tokens and 500,000 output tokens daily — about 75 million tokens a month. At that scale, trimming just 200 tokens from the prompt saves roughly 6 million tokens a month, which is why this estimator asks for both sides of the exchange instead of a single “text size” number.
Treat the estimate as a planning figure, not an invoice: token counts vary slightly between models, and providers change prices and offer discounts. Use it to compare models and to size a budget, then confirm the final number on your provider’s current pricing page before you commit.
How to estimate your token counts before you build
You do not need to call an API just to size a budget. For plain English text, the standard rule of thumb is that 1 token ≈ 0.75 words, so a 1,000-word document is roughly 1,333 tokens, a 5,000-word document roughly 6,667 tokens, and a short 150-word prompt roughly 200 tokens. If you have the text in front of you, paste it into a word counter, multiply the word count by about 1.33, and you have a workable input estimate.
Three things push the real count above that simple estimate. First, code, JSON, and tables tokenize less efficiently than prose — brackets, indentation, and keys all consume tokens. Second, text in many non-English languages often needs more tokens per word than English does. Third, and most often forgotten: your input is not just the user's message. It includes your system prompt, any documents you attach, tool definitions, and the conversation history your app re-sends with every request. A chatbot that carries a long history can easily send ten times more input tokens on turn twenty than it did on turn one.
For the output side, estimate from the longest realistic reply, not the average one. A summary feature might average 200 output tokens but regularly produce 600. Budgeting from the average is how teams get surprised at the end of the month.
Worked example: the same workload on every model in this calculator
Imagine a small app that makes 1,000 calls a day. Each call sends 2,000 input tokens (a system prompt, some context, and the user's request) and receives 500 output tokens. Over a 30-day month that is 60 million input tokens and 15 million output tokens. The table below prices that exact workload with the per-million-token rates listed in the model picker above — the rates are approximate and providers change them, so treat the comparison as a guide to the gap between models, not a quote.
| Model | Rate per 1M tokens (input / output) | Cost of 1M input + 250K output | Example workload, per month |
|---|---|---|---|
| GPT-4o | $2.50 / $10.00 | $5.00 | $300.00 |
| GPT-4o Mini | $0.15 / $0.60 | $0.30 | $18.00 |
| Claude Sonnet | $3.00 / $15.00 | $6.75 | $405.00 |
| Claude Haiku | $0.25 / $1.25 | $0.56 | $33.75 |
| Gemini Flash | $0.075 / $0.30 | $0.15 | $9.00 |
The same app costs $9 a month on the cheapest model here and $405 on the most expensive — a 45-fold gap for identical token counts. That does not automatically make the cheapest model the right choice: capability, quality, and context size differ, and a weaker model that needs retries or longer prompts can erase its price advantage. The practical takeaway is to route work deliberately — use a flagship model where quality matters and a small, fast model for classification, extraction, tagging, and other routine jobs — instead of sending every call to one model by default.
Why output tokens usually dominate the bill
On every model in the picker, output tokens cost several times more per token than input tokens — commonly around four to five times as much. In the table above, output is only a fifth of the tokens (250K of 1.25M) but about half of the total cost on every model in this table. This is why two features with identical prompts can have very different bills: the one that writes long essays, full code files, or detailed reports pays for every generated token, while the one that answers with a label, a score, or a short paragraph stays cheap.
It also means the cheapest optimization is often on the output side: ask for the format you actually need, set a sensible maximum output length, and avoid asking a model to repeat the input back to you. A request that says "return only the JSON, no explanation" can cut output tokens dramatically without changing the quality of the result you actually use.
Practical ways to lower your AI bill
- Trim the system prompt. Instructions sent on every call are paid for on every call. Cutting 200 tokens from a prompt used 30,000 times a month saves 6 million tokens.
- Summarize long histories. Instead of re-sending an entire conversation, periodically replace older turns with a short summary.
- Cap output length. Set a maximum response size that matches the feature, and ask for concise formats — a list or JSON instead of prose, when prose is not needed.
- Route by difficulty. Send simple, high-volume tasks to a small model and reserve the flagship model for the calls where its quality changes the outcome.
- Send less context. Retrieve only the document sections relevant to the question instead of attaching whole files; irrelevant context costs money on every call and can also distract the model.
- Avoid paying for failures. Retries and malformed requests still consume tokens. Validate inputs before calling, and log the token usage returned with each response so waste is visible.
Common mistakes when estimating AI costs
- Counting only the user's message and forgetting the system prompt, history, and attached context that are billed as input on every call.
- Budgeting from average reply length while the longest replies — the ones users actually trigger — cost several times more.
- Comparing models on the input rate alone, when the output rate is several times higher and often decides the real bill.
- Estimating per call, then never multiplying by volume. A call that costs a tenth of a cent is $30,000 a month at a million calls a day — scale is the whole story.
- Treating today's prices as permanent. Providers revise rates and release cheaper model versions; re-check the estimate before each budget cycle.
Frequently asked questions
What is an AI token?
A token is a chunk of text the AI processes — roughly 4 characters or 0.75 words in English. 1,000 tokens is about 750 words.
Are input and output tokens priced differently?
Yes. Output tokens (the AI's response) typically cost more than input tokens (your prompt).
How accurate are these prices?
These are approximate rates. Providers change pricing — check OpenAI, Anthropic, or Google's pricing pages for current figures.
How do I estimate tokens from a word count?
Multiply the word count by about 1.33. Roughly 750 words of English is 1,000 tokens, so a 3,000-word document is about 4,000 tokens. Code, JSON, numbers, and many non-English languages usually need more tokens per word, so treat the result as a starting estimate rather than an exact count.
Why is my real bill higher than the estimate?
The usual reasons are input you forgot to count — the system prompt, conversation history, and attached context are billed on every call — plus longer outputs than expected, retries, and small differences between models' tokenizers. Compare the estimate with the usage figures in your provider's dashboard to find which side is drifting.
Should I shorten my prompt or the model's reply to save money?
Per token, shortening the reply saves more, because output tokens cost several times more than input tokens. But a long prompt is paid for again on every call, so at high volume a bloated system prompt or history can cost more overall. Trim both: keep prompts lean and ask for only the output format you need.