LLM Cost Calculator: Work Out What Your Token Traffic Actually Costs
Every LLM cost estimate is one multiplication and three corrections. The multiplication is tokens × price per token, split into input and output. The corrections are caching, retries and reasoning tokens. Most calculators do the first and skip the rest, which is why their numbers are optimistic by 20–80%.
This page gives you the formula, worked examples you can verify by hand, and the three corrections in order of how much they matter. The interactive version with provider rates built in is the enterprise token cost estimator on the SentioGate dashboard.
The formula
cost = (input_tokens × input_price / 1,000,000)
+ (output_tokens × output_price / 1,000,000)
That is the whole base calculation. Everything else is adjusting input_tokens or adding terms.
For a workload of N requests per month with per-request averages, multiply by N. For a mixed workload, split it into traffic classes (chat, summarisation, agent turns) and calculate each separately — averaging token counts across classes hides the expensive tail.
Worked example: 10,000 chat requests a day
Assume 3,000 input tokens (system prompt, history, retrieved context) and 400 output tokens per request, 10,000 requests a day, 30 days.
- Input tokens/month: 3,000 × 10,000 × 30 = 900,000,000 (900M)
- Output tokens/month: 400 × 10,000 × 30 = 120,000,000 (120M)
| Model (list price per MTok) | Input cost | Output cost | Total / month |
|---|---|---|---|
| GPT-5 ($1.25 / $10.00) | $1,125 | $1,200 | $2,325 |
| Claude Sonnet 5.5 ($2.00 / $10.00) | $1,800 | $1,200 | $3,000 |
| Claude Haiku 5.5 ($0.10 / $0.50) | $90 | $60 | $150 |
| Gemini 2.5 Flash ($0.30 / $2.50) | $270 | $300 | $570 |
| DeepSeek V3 ($0.27 / $1.10) | $243 | $132 | $375 |
Two observations that survive every change in pricing:
- On frontier models, input and output costs are comparable at this shape, because output is 8x the input rate but input is 7.5x the token count.
- Moving down a tier changes the answer by 6–15x. The model choice dominates every other lever at the base calculation stage.
Correction 1: prompt caching
If the first P input tokens are a stable prefix, they are billed at the cache rate instead of the input rate:
input_cost = ((input_tokens - P) × input_price + P × cache_price) / 1,000,000
With a 3,000-token input and a 1,500-token stable prefix on GPT-5: (1,500 × 1.25 + 1,500 × 0.125) / 1e6 = $0.00206 per request instead of $0.00375 — a 45% cut on the input side. Cache writes are billed separately on Anthropic (1.25x for 5-minute, 2x for 1-hour on Sonnet 5.5) and free on DeepSeek, so a cache that is written but rarely read costs more than no cache.
Correction 2: retries and failed requests
Failed requests are billed when the provider processed them, and 429s that are retried blindly multiply traffic. A workload with a 5% retry rate and a 2x amplification during a rate-limit event can see 15–30% more spend than the base estimate. Model this as effective_requests = requests × (1 + retry_rate) and treat any retry storm as a separate, larger line item.
Correction 3: reasoning tokens
Thinking models bill their internal reasoning as output. If a model emits 2,000 reasoning tokens before a 200-token answer, the output line is 11x the visible answer. Ask your provider for the reasoning_tokens field in usage reports before estimating any thinking-model workload; do not assume output tokens equal visible answer length.
What a calculator should let you change
A useful estimator exposes the inputs that actually move the number:
- Traffic class split — chat vs agent vs batch, because their token shapes differ by an order of magnitude.
- Cache hit rate — as a percentage of the stable prefix, not a toggle.
- Retry rate — the real one from logs, not zero.
- Model allow-list — the set of models routing may choose from, so the estimate reflects the mix.
Anything that outputs a single number without those four inputs is a rough guide, not a forecast.
Using SentioGate's estimator
The dashboard estimator takes requests, input and output token averages, and a model selection, and prices them in your chosen currency across the providers you have enabled. Because SentioGate is BYOK at 0% token markup, the estimate equals what the provider will bill your key — there is no platform fee to add. For multi-provider budgets and spend attribution, the AI FinOps guide covers the operational side, and the LLM API pricing explainer lists the current list rates this calculator uses.
FAQ
How do I calculate LLM API cost?
Multiply input tokens by the input price per million and output tokens by the output price per million, then add them. For a monthly figure, multiply by request volume. Then adjust input tokens for cache hits and add a retry allowance.
How many tokens is a page of text?
Roughly 500–750 tokens for a typical page of English prose, or about 4 characters per token. Code and JSON tokenise less efficiently, often 3 characters per token.
Why is my bill higher than my estimate?
The usual causes, in order: output tokens are longer than estimated, prompt caching is not hitting (the prefix changes), retries from rate limits, and reasoning tokens billed as output.
Does a router reduce the cost calculated here?
Not the per-token price — the provider bills your key at list. It changes which model serves each request, so the blended rate falls if part of your traffic can run on a cheaper tier. The calculator's model selection is where that shows up.
Which model is cheapest per token?
Among the mainstream APIs in late 2026, small models like Claude Haiku 5.5 and DeepSeek V3 have the lowest list rates; Gemini 2.5 Flash sits between them and the frontier models. Cheap per token does not mean cheap per task: a weak model that needs retries or longer prompts can cost more.
Sources
Accessed 1 Dec 2026.
- OpenAI pricing, Anthropic pricing, Gemini pricing, DeepSeek pricing
- SentioGate docs — usage fields returned per request
- Related: LLM API pricing explained, AI FinOps, Reduce LLM API costs