LLM Prompt Caching, Batch & Reasoning Token Cost Calculator
Prices the shared prompt prefix at each model's cache read rate for the share of requests that hit the cache and at its cache write rate for the rest, or at the input rate on Google's implicit cache. New input bills at the input rate and visible plus thinking tokens at the output rate, times monthly requests. The batch column applies each provider's published batch rates, about half the standard ones, which stack with caching.
Prices last verified November 2, 2026. Figures are estimates in US dollars; confirm with each provider before committing.
Enter how many tokens of each request repeat, how many are new, how much the model writes and thinks, and how often requests hit the cache. The table prices a month of that traffic on ten models with prompt caching, without it, and on the Batch API with caching. The flat input and output pricing most estimates use misses these effects, which on a long shared prompt move the bill by half or more. The last column gives the hit rate below which caching costs more than it saves.
Where caching, batches and thinking tokens came from
A transformer keeps a key-value cache of the prompt it has read. The vLLM paper by Kwon and colleagues, posted in September 2023, showed that cache could be shared within and across requests. Two months later Gim and colleagues' Prompt Cache reused attention states across different prompts, with time-to-first-token gains from 8x on GPUs to 60x on CPUs.
Providers turned the idea into a price in 2024. Google added context caching to the Gemini API on 18 June. DeepSeek followed on 2 August with automatic caching on disk, billing hits at $0.014 per million tokens against $0.14 for misses. Anthropic launched prompt caching in beta on 14 August, promising costs down by up to 90%, and OpenAI added it at DevDay on 1 October. Batch discounts arrived alongside: OpenAI released its Batch API on 15 April 2024, Anthropic its Message Batches beta at 50% less on 8 October 2024, and Google its Batch Mode on 7 July 2025.
Thinking tokens trace back to January 2022, when Wei and colleagues showed that prompting a model to generate "a series of intermediate reasoning steps" improves its reasoning. OpenAI's o1-preview, released on 12 September 2024, moved that reasoning inside the model. Google previewed Gemini 2.0 Flash Thinking Mode on 19 December 2024, and Anthropic shipped Claude Sonnet 3.7 with extended thinking on 24 February 2025.
How the calculator prices a month
Each request carries a shared prefix of P tokens, D new tokens, O visible output tokens and T thinking tokens. A share h of the N monthly requests reads the prefix from the cache and the rest write it:
monthly = N × [P × (h × rread + (1 − h) × rwrite) + D × rin + (O + T) × rout] ÷ 1,000,000
Anthropic and OpenAI charge 1.25 times the input rate for a standard write, Claude twice for its 1-hour cache and GPT 2.5 times for 12 hours. Google's price table shows no write charge, so a Gemini miss is billed as ordinary input. Reads cost a tenth of the input rate on most models, a twentieth on Claude Opus 5.5, Sonnet 5.5, GPT-6.1 Sol and Gemini 4 Argon, and a fortieth on Claude Fable 5.1.
Setting the two bills equal gives the break-even hit rate in the last column, where w and r are the write and read rates as multiples of the input rate:
hbreak-even = (w − 1) ÷ (w − r)
On the standard lifetimes it runs from 20.4% on Fable 5.1 to 21.7% on Haiku 5.5, GPT-6 Astra and GPT-6 Luna. Claude's hour needs 50.6% to 52.6%, and GPT's 12 hours 61.2% to 62.5%.
All three providers bill thinking as output. OpenAI's reasoning tokens "are not visible via the API" yet are "billed as output tokens", Anthropic bills "the full thinking process", and Google prices "the full thought tokens". Copy the count from your usage fields.
The batch column uses each provider's published batch rates, about half the standard ones. Anthropic says its caching and batch discounts "can stack", and OpenAI's and Google's batch tables list cached prices of their own. Long prompts cost more: GPT-6 models bill 2x input and 1.5x output above 272,000 input tokens, and Claude Haiku 5.5 bills 5x above 100,000, counting cache reads and writes in the prompt length.
A worked example
The defaults: a 10,000-token system prompt, 500 tokens of question, 400 of answer and 1,000 of thinking, sent 100,000 times a month with 90% hits. Count the tokens in your own system prompt to replace the first figure. On Claude Opus 5.5 the prefix sends a billion tokens a month. The 900 million read at $0.20 cost $180.00, and the 100 million written at $5 cost $500.00. New input adds 50 million at $4, or $200.00, and output adds 140 million at $20, or $2,800.00, of which thinking is $2,000.00. The total is $3,680.00 against $7,000.00 without caching, 47.4% less.
Writes cost more than reads even at 90% hits, because one Opus write costs as much as 25 reads. Thinking outweighs all input and visible output together, $1,680.00. Batch halves the bill to $1,840.00. Gemini 4 Argon, at $1,790.00, undercuts Sonnet 5.5 on the same base rates because its 10,000 misses, 100 million tokens, carry no write fee: 100 million × $0.50 = $50. At a 100% hit rate Opus costs $3,200.00; at 0% it costs $8,000.00, 14.3% more than not caching.
Hit rate, lifetime and traffic
Claude's cache lasts 5 minutes by default and is "refreshed for no additional cost each time the cached content is used"; on OpenAI a 30-minute read "refreshes coverage to at least 30 minutes after that read". If requests sharing a prefix arrive at random, λ a minute, the chance the next finds a cache of lifetime T still warm is at most:
h ≈ 1 − e−λT
At one request every 10 minutes, Claude's 5-minute cache hits 39.3% of the time and saves only 22.2% on Opus 5.5's prefix tokens. The 1-hour cache hits 99.8% and saves 94.5%. GPT's 30-minute cache reaches 95.0%, so one hit rate for every provider understates GPT on sparse traffic. A Claude entry "only becomes available after the first response starts", and caches are isolated by workspace, so real rates fall below the formula.
What the rows assume
GPT rows assume explicit-only mode, prompt_cache_options.mode set to explicit, with one breakpoint on the last block of a developer message holding the shared prefix. OpenAI's implicit mode puts a breakpoint at the end of the latest eligible message, so a static developer message followed by a changing user message "writes through the dynamic content". At the defaults that writes 10,500 tokens on every request, and GPT-6 Astra costs $20,125.00, 15% more than the $17,500.00 of not caching. Claude rows likewise assume cache_control on the prefix block rather than automatic caching, which places the breakpoint on the last cacheable block.
The minimum prefix is 512 tokens on Claude, 1,024 on GPT and 4,096 on Gemini 4 Argon and 3.8 Flash. Google publishes none for Gemini 3.5 Flash-Lite, so the calculator assumes the 4,096 every Gemini 3 and 4 model in its table shares. Anthropic processes shorter prefixes "without caching, and no error is returned", and the calculator treats every provider that way. Batch hits are best effort.
What the estimate leaves out
Gemini rows model implicit caching, the only mode on Gemini 4 Argon. Explicit Gemini caches bill storage, shown separately: holding the default prefix for 730 hours costs $3.65 on 3.8 Flash and $7.30 on Flash-Lite. Google names no creation charge, so none is modelled. Also left out: Claude's 1.1x US-only inference, OpenAI's 10% regional uplift and fast tiers. Changing Claude's effort level "invalidates cache breakpoints", Gemini 4 turns adding fewer than 2,050 tokens re-process the last 2,050 at the input rate, and OpenAI traffic "above 15 requests per minute can lead to overflow routing". Claude 4.7 and later produce "approximately 30% more tokens for the same text" than Claude's earlier tokenizer, so counts taken from an older tokenizer undercount Claude rows. A prefix of retrieved chunks caches only when the same chunks return in the same order. Gemini 4 Argon's prices double on 1 December 2026 and 3.8 Flash's on 1 January 2027.
DeepSeek and Qwen have no rows. DeepSeek's price list no longer names R1; its deepseek-flash and deepseek-v4-pro think by default, bill hits at a fiftieth and a thirtieth of misses, and charge double at peak hours, since "off-peak rates are half of the peak rates". Alibaba's international qwen3.8-max costs $2 input and $6 output in thinking and non-thinking modes alike and lists no batch discount. Its explicit cache writes bill at 125% of input, but Alibaba says its hit price "is not 10%" of input, the usual rate, and leaves the figure to its console. Batch and cache discounts "cannot apply simultaneously". OpenAI's o3 reasoning model has no row either; its pricing row still lists $2.00 input, $8.00 output and $0.50 cached input, a quarter of the input rate.
Current cache prices
Rates in USD per million tokens, from the calculator's own data file. Short writes are Claude's 5 minutes or GPT's 30; long writes Claude's hour or GPT's 12 hours.
| Model | Cache read | Short write | Long write | Minimum prefix | Batch cache read |
|---|---|---|---|---|---|
| GPT-6 Astra | $1 | $12.50 | $25 | 1,024 tokens | $0.50 |
| GPT-6.1 Sol | $0.10 | $2.50 | $5 | 1,024 tokens | $0.05 |
| GPT-6 Luna | $0.01 | $0.125 | $0.25 | 1,024 tokens | $0.005 |
| Claude Fable 5.1 | $0.25 | $12.50 | $20 | 512 tokens | $0.125 |
| Claude Opus 5.5 | $0.20 | $5 | $8 | 512 tokens | $0.10 |
| Claude Sonnet 5.5 | $0.10 | $2.50 | $4 | 512 tokens | $0.05 |
| Claude Haiku 5.5 | $0.01 | $0.125 | $0.20 | 512 tokens | $0.005 |
| Gemini 4 Argon | $0.10 | No write fee | No write fee | 4,096 tokens | $0.05 |
| Gemini 3.8 Flash | $0.075 | No write fee | No write fee | 4,096 tokens | $0.0375 |
| Gemini 3.5 Flash-Lite | $0.03 | No write fee | No write fee | Not published; 4,096 assumed | $0.015 |
Prices change without notice and figures here are estimates, not quotes; this site is not affiliated with any provider named above. See the site disclaimer.
Frequently asked questions
How much does prompt caching save?
It depends on how much of each prompt repeats and how often the cache hits. At the defaults, a 10,000-token shared prefix, 500 new tokens and a 90% hit rate over 100,000 requests, caching cuts Claude Opus 5.5's input cost from $4,200.00 to $880.00 a month, 79.0%. Output is never discounted, so the whole bill falls from $7,000.00 to $3,680.00, or 47.4%.
Does writing to the cache cost extra?
On Anthropic and OpenAI, yes. A write costs 1.25 times the input rate for Claude's 5-minute or GPT's 30-minute lifetime, twice the input rate for Claude's 1-hour cache and 2.5 times for GPT's 12-hour cache. Below a break-even hit rate caching costs more than it saves: 20.4% to 21.7% on the standard lifetimes, 50.6% to 52.6% on Claude's hour and 61.2% to 62.5% on GPT's 12 hours. Google lists no write charge for its implicit cache.
Are thinking tokens billed as output tokens?
Yes, on all three providers. OpenAI bills reasoning tokens as output although the API never returns them, Anthropic bills the full thinking Claude generates rather than the summary it shows, and Google bases pricing on the full thought tokens. At the defaults, 1,000 thinking tokens per request cost $2,000.00 of Claude Opus 5.5's $3,680.00 monthly bill with caching, more than the visible answers and all the input combined.
Do the Batch API and prompt caching discounts stack?
Yes on all three providers in this calculator. Anthropic says the two discounts can stack, and OpenAI's and Google's batch price tables list their own cached input prices. Hits inside a batch are best effort, though: Anthropic reports typical batch hit rates of 30% to 98% and suggests the 1-hour cache for batches that share context. Alibaba's Qwen models are different: there, batch and cache discounts cannot apply together.
Which cache lifetime should I choose?
The one that outlasts the usual gap between requests that share a prefix. Claude's default cache lives 5 minutes and every hit restarts the clock, so a prefix requested at random about once every 10 minutes hits at most 39.3% of the time and caching saves 22.2% on Opus 5.5's prefix tokens. The 1-hour cache lifts the hit rate to 99.8% and the saving to 94.5%, even though each write costs twice the input rate.
What is the shortest prompt prefix that can be cached?
512 tokens on Claude Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5, 1,024 tokens on OpenAI's GPT-5.6 and later models, and 4,096 tokens on Gemini 4 Argon and Gemini 3.8 Flash. Google publishes no minimum for Gemini 3.5 Flash-Lite, so the calculator assumes the same 4,096. Anthropic processes shorter prefixes without caching and without an error, and the calculator bills short prefixes that way on every model, at the normal input rate.
Sources
- Pricing (Claude API docs), Anthropic
- Prompt caching (Claude API docs), Anthropic
- Batch processing (Claude API docs), Anthropic
- Steering thinking (Claude API docs), Anthropic
- API release notes (Claude API docs), Anthropic
- Pricing (OpenAI API docs), OpenAI
- Prompt caching (OpenAI API docs), OpenAI
- Reasoning models (OpenAI API docs), OpenAI
- Changelog (OpenAI API docs), OpenAI
- Gemini Developer API pricing, Google AI for Developers
- Context caching (Gemini API docs), Google AI for Developers
- Gemini thinking, Google AI for Developers
- Gemini API changelog, Google AI for Developers
- Efficient Memory Management for Large Language Model Serving with PagedAttention, arXiv, 2023
- Prompt Cache: Modular Attention Reuse for Low-Latency Inference, arXiv, 2023
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models, arXiv, 2022
- DeepSeek API introduces Context Caching on Disk, DeepSeek, 2024
- Models & Pricing (DeepSeek API docs), DeepSeek
- Model pricing (Alibaba Cloud Model Studio), Alibaba Cloud
- Context cache (Alibaba Cloud Model Studio), Alibaba Cloud