How the cost is calculated
Every LLM API bills separately for the tokens you send (input) and the tokens the model writes back (output), with prices quoted per million tokens. The calculator applies this formula to each model:
Cost per query = (input tokens ÷ 1,000,000 × input price)
+ (output tokens ÷ 1,000,000 × output price)
Queries per month = users × queries per user per day × days per month
Monthly cost = cost per query × queries per month
The yearly figure is simply the monthly cost × 12. Results are sorted from cheapest to most expensive, and the cheapest model is highlighted in green.
Long-context pricing
Some models charge a higher rate when a single query sends a very large input — for example, Claude Haiku 5.5 above 100K input tokens and Gemini 3.1 Pro above 200K. When that happens, the higher rate applies to the whole query, not just the tokens over the limit. The calculator applies it automatically when your input tokens exceed the threshold, and lists every model with this kind of pricing in a note under the results table.
Worked example
Imagine a customer-support assistant with 1,000 active users, each sending 10 questions a day, over 30 days:
- Queries per month: 1,000 × 10 × 30 = 300,000
- Each query sends 1,500 input tokens (system prompt + context + question) and gets 500 output tokens back.
For a model priced at $2.00 per million input tokens and $10.00 per million output tokens:
- Input: 1,500 ÷ 1,000,000 × $2.00 = $0.003
- Output: 500 ÷ 1,000,000 × $10.00 = $0.005
- Cost per query: $0.008
- Monthly cost: $0.008 × 300,000 = $2,400 (≈ $28,800 per year)
Notice that output is only a quarter of the tokens but more than half of the bill. Keeping answers concise is one of the easiest savings.
Typical token profiles
Token counts vary widely by use case. These ranges are a reasonable starting point before you measure your own traffic:
| Use case | Input tokens per query | Output tokens per query | Notes |
|---|---|---|---|
| Simple chatbot | 300–800 | 150–400 | Short system prompt, little history |
| Support assistant with RAG | 1,500–4,000 | 300–600 | Retrieved documents dominate input |
| Long-document summarization | 10,000–50,000 | 500–1,500 | Input-heavy; caching helps a lot |
| Code assistant | 2,000–8,000 | 500–2,000 | Files and history add up quickly |
| Classification / extraction | 200–1,000 | 10–100 | Ideal for small, cheap models |
Tips to reduce your LLM API costs
- Route by difficulty. Send simple requests (classification, short answers) to small models and reserve frontier models for hard tasks. The gap between the cheapest and the most capable models can reach 100×.
- Use prompt caching. If many requests share a long system prompt or document, cached input tokens are billed at a fraction of the normal price.
- Batch what isn’t urgent. Most providers offer around 50% off for asynchronous batch jobs such as nightly reports or bulk tagging.
- Cap output length. Set a sensible maximum output and ask for concise answers or structured formats.
- Trim the context. Retrieve fewer, more relevant chunks and summarize long conversation histories instead of resending them in full.
- Measure real usage. Log token counts per request from day one; estimates made before launch are almost always off.
What this estimate does not include
Discounts (caching, batch, committed-use agreements), image or audio inputs, tool and search fees, fine-tuning, taxes and currency conversion are not included. Long-context rates are included only for the models whose providers publish them. Use the result as a planning estimate, not a quote.
Frequently asked questions
What is a token?
A token is the unit LLM providers bill by. It is a chunk of text, usually a word fragment. In English, 1,000 tokens are roughly 750 words; other languages such as Spanish typically need more tokens for the same text.
Why are output tokens more expensive than input tokens?
Generating text is more compute-intensive than reading it, because the model produces output one token at a time. Most providers charge 4 to 8 times more per output token than per input token, so long answers drive costs up quickly.
Does this calculator include prompt caching or batch discounts?
No. It uses standard on-demand prices. Prompt caching and batch processing can cut costs substantially, so treat the result as an upper bound if you plan to use them.
How do I estimate tokens per query for my app?
Add up everything you send on each call — system prompt, conversation history, retrieved documents and the user message — for input, and the typical answer length for output. Most provider dashboards and SDKs report exact token counts per request, which is the best source once you have a prototype.
How often are the prices updated?
Every day an automated check compares our prices with OpenRouter's public model list and cross-checks them against LiteLLM's open pricing file. Normal changes are published automatically; unusual ones (a change of more than 50%, a retired model or sources that disagree) are reviewed by a person first. The notice at the end of the page shows the date of the last update and links to each provider's official pricing page.