Prompt caching explained: how much it saves on each provider
Prompt caching bills the repeated start of your prompt at a fraction of the normal input price. This guide compares how Anthropic, OpenAI, Google and DeepSeek do it, with a worked cost example you can reproduce in the LLM API cost calculator. It is part of our AI costs and pricing section.
Prices last verified against official provider pages on . How we verify prices. Written by the Chelure Enterprises Editorial Team.
How prompt caching works
A model reads your whole prompt on every request. If the first part of the prompt is identical each time (a long system prompt, tool definitions, a reference document), the provider can keep the processed form of that prefix and skip the work on later requests. Cached tokens are then billed at a reduced rate. Every provider here matches on the prefix, so anything that changes early in the prompt breaks the cache for everything after it.
Provider comparison
| Anthropic (Claude) | OpenAI (GPT) | Google (Gemini) | DeepSeek | |
|---|---|---|---|---|
| How you turn it on | Add cache_control (top-level automatic mode, or up to 4 explicit breakpoints) | On by default for supported models | Implicit caching on by default for Gemini 2.5 and newer; explicit caching only on supported Gemini 3 and 2.5 models via generateContent | On by default for all users |
| Minimum prompt length | 512 to 4,096 tokens depending on model (512 for Sonnet 5.5 and Opus 5.5; 4,096 for Haiku 4.5) | 1,024 tokens for GPT-5.6 and later | 4,096 for Gemini 4 and 3.x listed models; 2,048 for Gemini 2.5 Flash and Pro | Not stated on the page |
| Lifetime | 5 minutes by default, refreshed on each use; 1 hour optional | 30 minutes minimum by default on GPT-5.6 and later; 12 hours optional (Responses API). Earlier models: in-memory or 24h | Not stated on the page we read | Cleared when unused, “usually within a few hours to a few days” |
| Cache write cost | 1.25× base input (5 min); 2× (1 hour) | 1.25× (30 min); 2.5× (12 hours) on GPT-5.6 and later; none on earlier models | No separate write fee stated on the caching page | No separate fee stated |
| Cached read cost | 0.1× base input on most models; 0.05× on Sonnet 5.5 and Opus 5.5; 0.025× on Fable 5.2 and 5.1 | 0.1× base input; 0.05× on GPT-6.1 Sol and Terra | Gemini 3.8 Flash: 0.1× ($0.075 vs $0.75 per million) | DeepSeek V4.1 Flash: 0.02× ($0.006 vs $0.3 per million) |
| Field to check | cache_read_input_tokens | usage.input_tokens_details.cached_tokens | usage.total_cached_tokens | prompt_cache_hit_tokens |
Cached-read prices per model are in our price comparison. Gemini's caching page states no discount percentage, so the figure shown is taken from Google's pricing page as recorded in our table; DeepSeek's caching page does not discuss pricing, so its rate comes from DeepSeek's pricing page.
What it saves: a worked example
Take an assistant with a 10,000-token system prompt and tool definitions that never change, a 500-token user message, and a 200-token reply, at 1,000 requests a day for 30 days. Costs below use our verified prices and count cache writes at the providers' published write rates.
| Setup (10,000 cached + 500 new + 200 output tokens, 1,000 requests/day) | No caching | With caching | Saving |
|---|---|---|---|
| Claude Sonnet 5.5 or GPT-6.1 Sol ($2 in / $10 out, cached read $0.10), one write a day | $690.00 | $120.72 | 83% |
| Same two models, 48 writes a day | $690.00 | $154.56 | 78% |
The rows labelled “one write a day” assume steady traffic keeps the cache warm, so the prefix is written once and read the rest of the time. The “48 writes a day” rows assume the entry expires and is rewritten every 30 minutes, a more cautious case for low or bursty traffic. Output tokens are not discounted, which is why the saving is smaller than the cached-read discount alone.
When caching pays off
A cache write costs more than a normal read, so the first reuse is where you recover it. With a write at 1.25 times the base price and reads at 0.1 times, one reuse is enough: writing and reading once costs 1.35 times the base price, against 2 times without caching. A 1-hour entry written at 2 times needs two reuses to come out ahead (2.2 times against 3 times). These break-even figures are our arithmetic from the published multipliers, not figures the providers state.
How to structure prompts so they cache
- Put stable content first. Order the prompt so tool definitions and the system prompt come before the conversation, and the part that changes comes last.
- Keep the prefix byte-identical. A timestamp, a request ID or a reordered tool list at the top of the prompt means no hits.
- Stay above the minimum. Prompts shorter than the provider's minimum are processed without caching and no error is returned.
- Check the usage fields. A cached count of zero on a repeated prompt means it did not cache.
- Wait for the first response before firing many parallel requests with the same prefix; on Anthropic an entry is available only after the first response begins.
Using the numbers in your own estimate
Enter your prompt size in the token counter, then set the “input served from cache” percentage in the cost calculator to the share of your input that is the repeated prefix. In the example above that is 10,000 of 10,500 input tokens, or about 95 percent.
Frequently asked questions
What is prompt caching?
Prompt caching lets a provider reuse the processed beginning of a prompt (the prefix) across requests. Cached input tokens are billed at a fraction of the normal input price, and on most providers requests that hit the cache are also faster.
How much does prompt caching save?
On the providers' published rates, a cached read costs 0.1 times the normal input price on most Claude models and on OpenAI's GPT-5.6 and later (0.05 times on some models such as Claude Sonnet 5.5, Claude Opus 5.5 and GPT-6.1 Sol). The overall bill falls by less than that, because only the repeated prefix is discounted and output tokens are not.
Does caching change the answer I get?
No. Caching affects how the input is processed and billed, not the model's output.
Is there a cache write fee?
It depends on the provider. Anthropic charges 1.25 times the base input price to write a 5-minute cache entry and 2 times for a 1-hour entry. OpenAI charges 1.25 times (30-minute) or 2.5 times (12-hour) on GPT-5.6 and later, and no extra write charge on earlier models. Google and DeepSeek apply caching automatically and, on the pages we read, state no separate write fee.
Why did my request not hit the cache?
The usual causes are a prompt shorter than the provider's minimum, something in the prefix that changes between requests (a timestamp, a user name, reordered tool definitions), a gap longer than the cache lifetime, or sending parallel requests before the first one has finished writing the entry.
How do I check that caching is working?
Read the usage fields in the response: cache_read_input_tokens and cache_creation_input_tokens on Anthropic, usage.input_tokens_details.cached_tokens on OpenAI, usage.total_cached_tokens on Google, and prompt_cache_hit_tokens on DeepSeek. If the cached count is zero on a repeated prompt, caching did not apply.
Sources
- Anthropic: Prompt caching (Claude docs)
- OpenAI: Prompt caching guide
- Google: Context caching (Gemini API docs)
- DeepSeek: Context caching (API docs)
- Anthropic pricing
- OpenAI pricing
- Google Gemini pricing
- DeepSeek pricing
Primary sources opened on November 13, 2026. Prices come from our verified price table (see the methodology).