LLM API Cost Calculator โ What You Actually Pay
Most cost calculators multiply tokens by the sticker price. Production workloads rarely pay sticker price โ they pay the effective rate after cache hits, batch discounts and long-context tiering. This calculator applies all of them and ranks every model by real monthly cost.
Your workload
Presets
| Model | Provider | Input $/M | Cached $/M | Write $/M | Output $/M | Cost / month | Context |
|---|
How the cost is actually calculated
Total cost is the sum of four independently billed line items, multiplied by your request volume:
| Uncached input | tokens รท 1e6 ร inputRate |
| Cached input | tokens รท 1e6 ร cachedRate |
| Cache write | tokens รท 1e6 ร writeRate |
| Output | tokens รท 1e6 ร outputRate |
The part most calculators skip is the cache write premium. Anthropic bills a 5-minute cache write at 1.25ร the input rate and a 1-hour write at 2ร. A caching strategy only pays off if you write once and read many times โ roughly 20 reads to 1 write breaks even on a 5-minute TTL, more on a 1-hour TTL. Google bills cached context storage separately per MTok-hour rather than per token, so it does not appear as a per-token write rate here.
Long-context tiers
Quoting a single price per model is misleading if your prompts are large. This calculator switches rates automatically when your input size crosses a provider's threshold:
| Provider | Threshold | Effect above threshold |
|---|---|---|
| OpenAI (GPT-5.6 / GPT-6 / GPT-5.5 / GPT-5.4) | 272K input tokens | Input 2ร ยท Cached 2ร ยท Output 1.5ร |
| Google (Gemini Pro) | 200K input tokens | Input 2ร ยท Output 1.5ร |
| xAI (Grok) | 200K input tokens | Input 2ร ยท Output 2ร |
| Anthropic (Claude 5 / Opus / Sonnet) | โ | Flat rate across the full 1M window, no surcharge |
Claude's flat 1M window is a real advantage for whole-document workloads: a 900K-token request bills at the same per-token rate as a 9K one. On the same workload, OpenAI's tiering roughly doubles the effective rate.
How to cut your bill
1. Route by task, not by brand
Matching the model tier to the job is a bigger lever than switching vendors. Classification, extraction, routing and first-pass support belong on a budget tier. Tier 2 of the table above will beat your flagship on most of those jobs without a meaningful quality drop.
2. Cache a stable prefix
Any workload where requests share a system prompt, a policy document or a product catalogue should cache it. Cache reads bill at roughly 10% of list on OpenAI, Anthropic and Google, and about 2% on DeepSeek.
3. Push offline work to batch
Batch halves both input and output. Combined with a cache hit, cached input inside a batch request can land near 5% of list. This is the single largest available reduction for evaluation runs, nightly summaries and bulk enrichment.
4. Remember reasoning tokens bill as output
Thinking and reasoning tokens are billed at the output rate, and output runs 3โ6ร input across every vendor. Heavy deliberation, not prompt size, is what usually dominates an agent bill. If output price is your problem, the fix is prompting and model choice โ not caching.
Deciding when to switch
Run the numbers before you migrate. The pattern most teams land on is a two-model setup rather than a single choice, and the split is almost always the same:
- A budget tier for the boring 80% โ routing, classification, extraction, summarisation, first-pass support. This is where request volume lives, and it is where a tier downgrade pays for the expensive model that handles the last 20%.
- A frontier model for the part that is the product โ the reasoning a user actually pays for. Volume is low enough here that a 2.5ร rate difference does not matter.
Two things that look like cost savings and usually are not:
- Switching vendor for a flat rate when your current model is already one tier down. The tier is a bigger lever than the vendor โ the gap between a workhorse and a budget model is 10ร; the gap between similarly positioned models at different vendors is usually under 20%.
- Buying a cheaper model to save tokens โ cheaper models are not shorter. Output volume is a product decision, not a pricing lever.
And one that usually is: if your input is large and repetitive, the long-context tier is a bigger line item than the model choice. Compare the same workload at 150K and 400K tokens in the calculator above and read the difference before you optimise anything else.
Frequently asked
How do I calculate LLM API costs?
Multiply each token category by its own rate per million, then by monthly request volume. Input, cached input, cache writes and output are four separate line items. See the formula table above.
Does prompt caching actually reduce costs?
Yes โ a cache read bills at roughly 10% of the standard input rate on OpenAI, Anthropic and Google, and around 2% on DeepSeek. Output is never discounted by caching. Because writes carry a premium, caching only wins when the same prefix is reused many times.
What is the difference between batch and real-time calls?
Batch requests are accepted asynchronously and return within up to 24 hours in exchange for roughly 50% off both input and output. Batch stacks with caching. DeepSeek publishes no batch tier, so it is excluded from batch rankings rather than being shown at $0.
Why does my bill jump with long context?
OpenAI applies long-context rates above 272K input tokens, roughly doubling input and raising output 1.5ร. Google tiers above 200K on Pro models. Anthropic charges flat across 1M. The calculator applies these thresholds based on your actual input size.
Are these the same prices as a ChatGPT subscription?
No. ChatGPT and Claude subscriptions are separate flat-rate products and do not include API access. API access is billed per token with no platform fee or minimum.
How accurate are these prices?
Every figure is transcribed from the provider's own published pricing page and carries a verification date shown in the table. LLM pricing changes frequently โ several rates here are promotional and time-limited โ so treat this as a dated snapshot and confirm against the official page before you sign a contract. The table marks promotional rates and expired promotions explicitly.
Sources & verification
Prices verified: September 2026 ยทSources: OpenAI Anthropic Google xAI
TokenMeter is not affiliated with OpenAI, Anthropic, Google, xAI or DeepSeek. Model names and prices are the property of their respective owners. This tool runs entirely in your browser โ no request, token count or calculation leaves your device.