Most LLM cost calculators show you list price — the sticker rate multiplied by your token counts. But real production workloads almost never pay list price: they pay the effective cost after prompt caching and batch discounts kick in. This tool computes both. Use this LLM API pricing calculator to compare providers side by side: enter your tokens and monthly volume below and it ranks every major model cheapest-first for the pricing mode you actually run.
LeanLM (not affiliated with Google's LearnLM educational AI) is an LLM cost optimization platform. This pricing comparison tool is a free companion to our LLM effective cost table, where every price below is documented and dated.
| Model | Provider | Effective $/1M in | Effective $/1M out | Monthly cost |
|---|
That's list price. LeanLM measures your real cache-hit + batch rate and computes your actual effective cost — join the waitlist.
How Effective LLM Cost Is Calculated
Every row above starts from the same base formula, then applies a per-mode multiplier to the input and output prices:
Monthly cost = (input tokens × effective input price + output tokens × effective output price) × requests ÷ 1,000,000.
Definition
Effective LLM cost is what you actually pay per token after cache and batch discounts — not the list/sticker price.
List price
The provider's published rate, no discounts. Input and output both bill at sticker price. This is what naïve calculators show — and what almost no production workload actually pays.
Cache hit — input ≈ 0.1× list
A cache read bills input tokens at roughly one-tenth of list for OpenAI, Anthropic, and Gemini; DeepSeek's automatic cache discount is deeper, closer to one-fiftieth ($0.0028 vs its $0.14 list). The exact cache-hit price is hard-coded per model above. Output is never discounted by caching, so the output column stays at list price in this mode.
Batch (async) — input & output × 0.5
Async batch APIs trade latency for a 50% discount on both input and output. DeepSeek has no batch tier, so it shows n/a and drops out of the ranking in batch modes rather than showing a false $0.
Batch + cache — input × 0.05
Stacking a cache hit inside a batch request compounds the discounts: input lands near one-twentieth of list, output at half. Best-case for high-volume, high-repeat workloads.
Worked example. Take gpt-5.4-nano (list $0.20 in / $1.25 out) at 2,000 input and 500 output tokens over 100,000 requests/month. List cost = (2,000 × 0.20 + 500 × 1.25) × 100,000 ÷ 1,000,000 = (400 + 625) × 0.1 = $102.50/month. Switch to cache-hit pricing (input $0.02) and the input term collapses: (2,000 × 0.02 + 500 × 1.25) × 0.1 = (40 + 625) × 0.1 = $66.50/month — a 35% cut from the input side alone, because output caching gives you nothing.
Two real-world caveats
These cache-hit figures are best-case reads. Anthropic charges a cache-write premium that amortizes to roughly 0.155× blended input at one write per twenty reads, and Google's Gemini explicit caching bills a separate per-hour storage fee for the cached context. So treat the cache-hit column as a floor you approach at high reuse, not a number you hit on request one. Prices verified July 15, 2026 — the full per-model methodology and dated changelog live in the LLM effective cost table.
Which LLM API Is Cheapest?
Run the numbers above with your own token mix and the ranking will usually settle the question for your workload — but if you just want the ranked answer with the reasoning behind it (including free tiers from Gemini, Groq, and OpenRouter), see our breakdown of the cheapest LLM API. One nuance the calculator can't model: reasoning tokens bill at plain list output price with no batch or cache discount, so reasoning-heavy models can cost far more than their sticker output rate implies.
Early Access
The Calculator Uses List Assumptions. Your Traffic Doesn't.
This tool assumes a single flat cache-hit or batch rate. LeanLM profiles your real production traffic — your actual cache-hit rate, task mix, and async share — then validates a cheaper model or routing config against your quality bar before anything ships. Join the waitlist below.
Three Workloads, Three Different Cheapest Models
The ranking this calculator produces is workload-dependent — there is no model that wins every row. Three common shapes, each with the token profile that drives its answer:
| Workload | Token profile per request | What drives the cost | Where to look first |
|---|---|---|---|
| Support-ticket classification | Large stable input (1,000+ token system prompt), tiny output (~50 tokens) | Input tokens, almost entirely — and the prompt prefix repeats on every call | Cache-hit column. A budget-tier model with a high hit rate beats a mid-tier model at list. |
| RAG question answering | Very large input (retrieved chunks, 4,000–16,000 tokens), moderate output (300–800) | Input dominates, but the retrieved context changes per query so it caches poorly | List input price, and prompt compression before the model — caching helps only the system-prompt portion. |
| Agentic multi-step pipeline | Moderate input, large and repeated output across 5–30 model calls per task | Output tokens × call count. Caching gives nothing on output. | Output price and reasoning-token behaviour. Per-task cost, not per-call cost, is the number that matters. |
The pattern: caching only ever discounts input, so the more output-heavy your workload, the less caching saves you and the more the raw output rate decides the ranking. Agentic pipelines are the extreme case — they are the workload where the cheapest-per-token model and the cheapest-per-task model diverge most sharply.
Cost per Token vs Cost per Resolved Task
A per-token calculator answers "what does this model cost." It does not answer the question a budget owner actually asks, which is what does one unit of delivered value cost — one resolved ticket, one reviewed document, one completed agent run.
Those two numbers can move in opposite directions. A cheaper model that needs two retries, produces output a verifier rejects, or requires an extra reasoning pass can cost more per resolved task than a pricier model that succeeds first time. This is why a model swap that looks like an obvious win in a per-token comparison sometimes shows up flat or negative on the monthly bill.
To convert the figure above into a defensible unit cost, divide by your success rate: cost per resolved task = (cost per call × calls per task) ÷ success rate. A model at $0.002/call needing 1.4 calls per task at a 92% success rate costs $0.00304 per resolved task; a model at $0.0035/call needing 1.0 calls at 99% costs $0.00354 — much closer than the 75% per-call price gap suggests. Track that ratio per task type, because it is the number that survives contact with a CFO and the one that makes a model swap defensible.
What This Calculator Deliberately Does Not Model
Every cost model is wrong at the edges. These are the specific places this one under-reads, so you can adjust rather than be surprised:
- Reasoning tokens. Thinking-mode models bill hidden reasoning as output at plain list rate — no batch discount, no cache discount. On reasoning-heavy tasks this is frequently the majority of the bill and it is invisible in a per-request token estimate. See reasoning token costs.
- Retries and failed runs. A timed-out, rejected, or malformed response is billed exactly like a successful one. Teams routinely under-count real spend by 10–30% by modelling only successful calls.
- Tokenizer differences. $/MTok is not comparable across providers, because the same text tokenizes differently. A model priced 10% lower that tokenizes your corpus 30% heavier is more expensive for you. Multiply by your measured tokens-per-document ratio.
- Cache writes and storage. The cache-hit column is a floor you approach at high reuse, not a rate you get on request one. Anthropic charges a write premium; Gemini's explicit caching bills hourly storage for the cached context.
- Growing conversation context. In multi-turn chat the whole history is re-sent every turn, so input tokens grow with turn count. A flat per-request input figure understates a long session substantially.
- Rate limits and overprovisioning. Hitting a tier ceiling can force a more expensive model or a higher committed tier for reasons that have nothing to do with per-token price.
None of these make the calculator useless — they make it a floor. The gap between this floor and your actual invoice is precisely the thing worth measuring on real traffic before you commit to a model change.
Frequently Asked Questions
How do I use this LLM cost calculator?
Enter your input tokens per request, your output tokens per request, and your monthly request volume, then choose a pricing mode: list, cache hit, batch, or batch + cache. The calculator instantly ranks every model by effective monthly cost, cheapest first, and highlights the cheapest option for your workload. Change any field and it recomputes live, and the Copy link button lets you share your exact calculation.
What does 'effective price' mean in this calculator?
List price is the sticker rate a provider publishes per million tokens. Effective price is what you actually pay after discounts: a cache hit bills input tokens at roughly one-tenth of list for OpenAI, Anthropic, and Gemini, while DeepSeek's automatic cache discount is deeper, closer to one-fiftieth. A batch (async) request bills both input and output at about half, and stacking batch and cache can drop the effective input price further. Output tokens are never discounted by caching.
Why does DeepSeek show 'n/a' in batch mode?
DeepSeek v4-flash has no asynchronous batch API tier, so there is no 50% batch price to compute. Rather than show a misleading $0, the calculator marks it n/a and excludes it from the ranking in Batch (async) and Batch + cache modes. In List and Cache hit modes DeepSeek is priced and ranked normally.
Why is my actual LLM bill higher than this calculator predicts?
Six things this calculator deliberately does not model, roughly in order of how much they typically cost you: reasoning tokens (billed as output at plain list rate, with no batch or cache discount, and often the majority of the bill on thinking-mode models); retries and failed runs (billed identically to successful ones, and commonly 10–30% of real spend); growing conversation context in multi-turn chat (the full history is re-sent every turn); tokenizer differences between providers (the same text tokenizes differently, so $/MTok is not directly comparable); cache write premiums and storage fees; and rate-limit-driven overprovisioning. Treat the calculator output as a floor and measure the gap on real traffic.
What is cost per resolved task, and why does it matter more than cost per token?
Cost per resolved task is what one unit of delivered value costs — one resolved ticket, one reviewed document, one completed agent run — rather than what one million tokens costs. Compute it as (cost per call × calls per task) ÷ success rate. It matters more because the two can move in opposite directions: a cheaper model that needs retries or an extra reasoning pass can cost more per resolved task than a pricier model that succeeds first time. A model at $0.002/call needing 1.4 calls at 92% success costs $0.00304 per resolved task, while one at $0.0035/call needing 1.0 call at 99% costs $0.00354 — far closer than the 75% per-call price gap implies.
Are these prices current?
Prices in this calculator were verified July 15, 2026 against each provider's published pricing page. LLM pricing changes often, so treat the figures as a verified snapshot rather than a live feed. The full methodology and a dated changelog live in our LLM effective cost table.
Looking for the ranked answer rather than a calculator? See the effective cost leaderboard for the full breakdown, including free tiers.