Prompt caching saves 66% to 70% of the whole bill on a typical chatbot conversation and 83% to 87% on a coding agent with Claude or OpenAI models. That's a big saving, but it isn't the 90% to 95% on the price list.
The headline discount only applies to input tokens that repeat. Output tokens are never discounted, new input is full price, and Claude and OpenAI charge extra the first time a prompt goes into the cache. I build AI chatbots and agents for a living, and caching is the first thing I turn on, so I worked out what it takes off a real bill on each provider, using prices from their own pricing pages.
How much does prompt caching actually save?
Prompt caching saves about two-thirds of the bill on a chatbot conversation and about 85% on a coding agent or a long document you ask lots of questions about. It costs more on a prompt that's only sent once. Here's the saving on the whole bill, input and output together, for four common jobs:
| Job | Input tokens read from the cache | Saved with Claude or OpenAI | Saved across all nine models |
|---|---|---|---|
| A 10-message chatbot conversation | 88% | 66% to 70% | 60% to 77% |
| A 40-step coding agent | 96% | 83% to 87% | 71% to 92% |
| 20 questions about one long document | 95% | 82% to 86% | 70% to 91% |
| A prompt sent once and never reused | 0% | Costs 19% more | No change |
Each job is priced on nine models from Anthropic, OpenAI, Google, xAI, and DeepSeek, with every request sent before the cache expires:
- The chatbot conversation has 5,000 tokens of instructions and product info, then 10 customer messages of 60 tokens and 10 replies of 200 tokens. The whole chat is sent again with every message.
- The coding agent starts with 30,000 tokens of instructions, tools, and code. Each of its 40 steps adds 2,000 tokens and writes 500.
- The long document is 50,000 tokens, with 20 separate questions of 100 tokens and answers of 300 tokens.
To price your own numbers, my LLM cost calculator has a setting for how much of your prompt is cached.
How much does prompt caching save on each model?
DeepSeek V4.1 Flash saves the most with prompt caching, 77% on a chatbot conversation and 92% on a coding agent, because its cached input costs 98% less and it doesn't charge for cache writes. Grok 4.7 saves the least, at 60% and 71%. Here's the saving on the whole bill for all nine models:
| Model | Input per 1M tokens | Cached input per 1M tokens | Chatbot conversation | Coding agent | Long document |
|---|---|---|---|---|---|
| Claude Haiku 5.5 | $0.10 | $0.01 (90% off) | 66% | 83% | 82% |
| Claude Sonnet 5.5 | $2.00 | $0.10 (95% off) | 70% | 87% | 86% |
| Claude Opus 5.5 | $4.00 | $0.20 (95% off) | 70% | 87% | 86% |
| GPT-6 Luna | $0.10 | $0.01 (90% off) | 66% | 83% | 82% |
| GPT-6.1 Terra | $1.00 | $0.05 (95% off) | 70% | 87% | 86% |
| GPT-6.1 Sol | $2.00 | $0.10 (95% off) | 70% | 87% | 86% |
| Gemini 3.8 Flash | $0.75 | $0.075 (90% off) | 68% | 83% | 83% |
| Grok 4.7 | $2.00 | $0.50 (75% off) | 60% | 71% | 70% |
| DeepSeek V4.1 Flash | $0.30 | $0.006 (98% off) | 77% | 92% | 91% |
In dollars, the 40-step coding agent costs $5.72 on Claude Sonnet 5.5 without prompt caching and $0.74 with it. On Claude Opus 5.5, it drops from $11.44 to $1.47. One chatbot conversation on Claude Sonnet 5.5 drops from 14.5 cents to 4.4 cents, which is $1,446 against $440 over 10,000 conversations.
The models with a 95% discount don't save much more than the ones with 90%. The cache write and the output tokens matter more than the last five points of discount. For the full prices, here are the cheapest LLM APIs compared.
Which AI providers support prompt caching?
Anthropic, OpenAI, Google, xAI, DeepSeek, Fireworks AI, Amazon Bedrock, and OpenRouter all support prompt caching, and so do Mistral, Alibaba, and Groq. The discount on cached input runs from 50% to 98%, and only Anthropic and OpenAI charge extra to write to the cache. Here's how eight providers compare:
| Provider | Cached input discount | Cost to write to the cache | Shortest prompt it caches | How to turn it on |
|---|---|---|---|---|
| Anthropic (Claude) | 90% off, or 95% off on Sonnet 5.5 and Opus 5.5 | 1.25x the input price for 5 minutes, 2x for 1 hour | 512 tokens | Add one cache_control field |
| OpenAI | 90% off, or 95% off on GPT-6.1 Sol and Terra | 1.25x the input price for 30 minutes, 2.5x for 12 hours | 1,024 tokens | On by default |
| Google (Gemini) | 90% off | No extra charge | 4,096 tokens | On by default |
| xAI (Grok) | 75% off on Grok 4.7, 84% off on Grok 4.3 | No extra charge | Not listed | On by default |
| DeepSeek | 98% off on DeepSeek V4.1 Flash | No extra charge | Not listed | On by default |
| Fireworks AI | 50% off by default, varies by model | No extra charge | Not listed | On by default |
| Amazon Bedrock | Set per model | Set per model, for 5 minutes or 1 hour | 512 to 4,096 tokens, by model | Add cache checkpoints |
| OpenRouter | The provider's own discount | The provider's own price | The provider's own minimum | Automatic on most models |
A few details from each provider's own docs are worth knowing:
- Claude: the cache lasts 5 minutes and the timer restarts for free every time it's read. Cache reads cost 97.5% less on Claude Fable 5.1 and 5.2. The 512-token minimum is for the current models, and older Claude models need 1,024 to 4,096 tokens.
- OpenAI: caching is on by default, so GPT-5.6 and later models charge the 1.25x cache write on any prompt of 1,024 tokens or more, even one that's never sent again. Older OpenAI models don't charge for cache writes.
- Gemini: Gemini 4 models only cache automatically. Some Gemini 3 models can also store a cache on purpose, for a storage fee per hour. On Gemini 4, a follow-up request has to add at least 2,050 tokens for the whole previous request to be cached.
- DeepSeek: the cache is "best-effort", so a hit isn't guaranteed, and unused caches are cleared within a few hours to a few days.
- Fireworks AI: cached prompts usually stay for at least several minutes, and up to several hours.
- OpenRouter: it keeps sending a conversation to the same provider so the cache gets hit, and that "sticky" routing lasts 60 minutes after the last request.
Does prompt caching really save 90%?
No. Prompt caching takes 90% off the price of cached input tokens on most models, but a prompt has to be reused about 100 times before the saving on those tokens gets close to 90%, and the rest of the bill isn't discounted at all. Three things eat into the headline number:
- The first send costs more. Claude and OpenAI charge 1.25 times the normal input price to write a prompt to the cache.
- Output is full price. Output tokens usually cost five times as much as input tokens, and no provider discounts them for caching.
- New input is full price. Every new message, tool result, or question is fresh input, and on Claude and OpenAI it's written to the cache at 1.25x so the next request can reuse it.
Here's the saving on the repeated part of a prompt, by how many times it's sent before the cache expires:
| Times the prompt is sent | 90% discount, 1.25x write (Claude Haiku 5.5, GPT-6 Luna) | 95% discount, 1.25x write (Claude Sonnet 5.5, GPT-6.1 Terra) | 90% discount, free write (Gemini) |
|---|---|---|---|
| Once | Costs 25% more | Costs 25% more | No change |
| Twice | 32.5% | 35% | 45% |
| 3 times | 51.7% | 55% | 60% |
| 5 times | 67% | 71% | 72% |
| 10 times | 78.5% | 83% | 81% |
| 25 times | 85.4% | 90.2% | 86.4% |
| 100 times | 88.8% | 93.8% | 89.1% |
OpenAI's own docs give the same sums: one write and nine reads cost 2.15 times the price of sending the prompt once, against 10 times without caching. That's a 78.5% saving.
When does prompt caching cost more?
Prompt caching costs more when a prompt is written to the cache and never read again. On Claude and OpenAI, that's 25% extra on the input, or about 19% extra on a request with 5,000 input tokens and 300 output tokens. It happens in four ways:
- One-off prompts. A prompt that's sent once pays for a cache write and gets nothing back.
- Gaps longer than the cache lasts. If a prompt is used every 10 minutes and Claude's cache lasts 5, every request is a new write at 1.25x.
- Something changes near the top. The cache only matches from the first token. A date, a customer name, or a shuffled tool list at the start of the prompt means nothing after it can be reused.
- A setting changes. On Claude, switching between fast and standard speed throws the cache away.
Prompts under the minimum length aren't cached at all, so they cost the normal price. Gemini, Grok, DeepSeek, and Fireworks AI don't charge for cache writes, so caching never costs extra there.
With Claude, you choose what gets cached, so leave caching off for one-off jobs. OpenAI caches by default. To stop paying for writes on a one-off job, set prompt_cache_options.mode to explicit and don't add any breakpoints.
Is a 1-hour or 12-hour prompt cache worth it?
A longer cache is worth it when your requests are more than a few minutes apart but still come at least three times within the longer window. It costs more to write, so it pays for itself on the third send, not the second:
| Cache | Cost to write | Pays for itself on | Saved after 10 sends |
|---|---|---|---|
| Claude, 5 minutes | 1.25x | The 2nd send | 78.5% |
| Claude, 1 hour | 2x | The 3rd send | 71% |
| OpenAI, 30 minutes | 1.25x | The 2nd send | 78.5% |
| OpenAI, 12 hours | 2.5x | The 3rd send | 66% |
The 10-send savings are for a model with a 90% discount on cached input. A customer who replies every few minutes is fine on the short cache, because every read restarts the timer. A support bot that gets a question every 20 minutes loses Claude's 5-minute cache every time, and that's where the 1-hour cache at 2x earns its price.
How to save more with prompt caching
To save more with prompt caching, put everything that stays the same at the start of the prompt and everything that changes at the end. Here's what makes the biggest difference:
- Order the prompt by how often each part changes. Instructions and tools go first, then reference material like product info, then the conversation, then the new message.
- Keep dates and names out of the top. One changing word at the start means the whole prompt is processed again at full price.
- Don't cut the chat history to save money. Cached history costs a tenth of the price or less, and a bot that remembers the whole chat sells better than one that forgets what the customer said three messages ago.
- Check the numbers in the response. Claude reports
cache_read_input_tokens, OpenAI reportscached_tokens, and DeepSeek reportsprompt_cache_hit_tokens. If they're zero, the cache isn't being hit. - Get the prompt over the minimum. A 400-token prompt can't be cached on any of the big three. Gemini needs 4,096 tokens, so short prompts never get its discount.
- Stack it with the batch discount. Anthropic applies the cache discount on top of its 50% batch discount for jobs that can wait.
Caching is one of several ways to cut the bill. The rest are in my guide to the cheapest LLM APIs, and if you'd rather pay nothing per token, here's how to run an LLM locally.
How does prompt caching reduce inference costs?
Prompt caching reduces inference costs by letting the provider skip work it has already done. When a model reads a prompt, it processes every token in order, and that processing is most of what input tokens cost. With caching, the provider stores the result for the start of your prompt.
When the next request starts with exactly the same text, the model picks up from the stored result and only processes what's new. The provider uses less computing power, so it charges less for those tokens: 50% to 98% less, depending on the provider.
Nothing about the answer is cached. The model still writes every reply from scratch, which is why output tokens stay full price and why the same prompt can still give a different answer each time.
Does prompt caching reduce latency?
Yes. Prompt caching reduces latency because a cached prompt skips most of the input processing, so the reply starts sooner. The longer the cached part, the bigger the difference.
Anthropic says you generally see a faster first token on long documents, and OpenAI lists less time spent processing input as one of the three benefits. OpenAI adds that a cache read gets the lower price even when it doesn't come back faster.
What is prompt caching?
Prompt caching is a feature of LLM APIs that stores the start of a prompt after it's first sent, so later requests that begin with the same text are cheaper and faster. The stored part is usually the instructions, tools, documents, and earlier messages that get sent again with every request.
It matters because LLM APIs don't remember anything between requests. A chatbot sends its full instructions and the whole conversation with every message, and a coding agent sends your code again on every step. Without caching, you pay full price for the same tokens over and over. If you're new to how these models read text, my guide to natural language processing covers the basics.


