Prompt Caching Explained: Claude, OpenAI, Gemini, Grok
Prompt caching lets an LLM API reuse the start of a prompt it saw recently, so you pay up to 90% less for that part and get answers faster. Here is how it works at Claude, OpenAI, Gemini, Grok and DeepSeek, with today's cached prices.
What prompt caching is
Many requests start the same way: the same system prompt, the same document, the same codebase, then a new question at the end. With prompt caching, the provider keeps that shared beginning (the prefix) for a few minutes. When the next request starts with exactly the same text, the cached part is read back at a fraction of the normal input price, and the answer starts sooner.
Caching only works on an exact match from the very first token. Put things that never change first and things that change (the user's question, today's date) last.
Cached prices today
| Model | Input / 1M | Cached input / 1M | Saving |
|---|---|---|---|
| Anthropic: Claude Fable 5.2 | $8 | $0.2 | 98% |
| OpenAI: GPT-6.2 Astra Pro | $8 | $0.4 | 95% |
| Google: Gemini 4 Neon | $3 | $0.15 | 95% |
| DeepSeek: DeepSeek V4.1 Flash 1017 | $0.3 | $0.006 | 98% |
| SpaceXSI: Grok 4.7 | $2 | $0.5 | 75% |
From OpenRouter's live price list, Mon, 23 Nov 2026 10:01 UTC.
How each provider does it
- Claude (Anthropic)You mark what to cache with
cache_control, or turn on automatic caching. The cache lasts 5 minutes by default and refreshes free each time it's used; a 1-hour cache is available. Writes cost 1.25× the input price (2× for 1 hour) and reads cost 0.1× on most models, with a few exceptions priced lower. The prefix must be at least 1,024 to 4,096 tokens, depending on the model. - OpenAIAutomatic. On GPT-5.6 and later the minimum is 1,024 tokens, writes cost 1.25× for the default 30-minute cache or 2.5× for 12 hours, and reads cost 0.1× (0.05× on GPT-6.2 Astra and Sol, GPT-6.1 Sol and Terra).
- Gemini (Google)Implicit caching is on by default for Gemini 2.5 and newer, and the saving is passed on automatically. Explicit caching is also available.
- Grok (SpaceXSI)Automatic. Sending the same
x-grok-conv-idheader with each request in a conversation raises the hit rate. - DeepSeekAutomatic, with a separate cache-hit price: $0.003 per million input tokens off-peak on deepseek-flash, against $0.15 for a miss.
Checked against each provider's caching docs on 22 November 2026.
What it saves: a worked example
A coding assistant sends the same 50,000-token codebase with 100 questions in a row (500 tokens each, 500-token answers) on Claude Fable 5.2. Without caching that costs $42.40. With caching (one 1.25× write, then 99 cached reads) it costs about $3.89, 91% less.
Next: compare prices
Ready to pick a model? See the LLM API pricing table for all 360 models, the cheapest LLM APIs, and the cost calculator. By lab: Claude, OpenAI, Gemini, DeepSeek, Grok, Mistral, Qwen, Kimi, Meta Llama.
Questions
What is prompt caching?
A discount for repeated prompt beginnings: the provider stores the start of your prompt for a few minutes and charges much less when the next request reuses it exactly.
How much does prompt caching save?
Cache reads cost 10% of the normal input price or less at Anthropic and OpenAI. On Claude Fable 5.2, cached input is $0.2 against $8 per million tokens.
How long does a prompt cache last?
Claude: 5 minutes by default, refreshed each use, or 1 hour at a higher write price. OpenAI: 30 minutes by default, or 12 hours. Check the provider's docs for others.
Do I have to turn prompt caching on?
OpenAI, Gemini, Grok and DeepSeek cache automatically. Claude needs cache_control on the request, or automatic caching turned on.
What is the difference between prompt caching and KV caching?
KV caching is the internal memory a model keeps while writing one answer. Prompt caching keeps that work between separate requests, so a repeated prefix doesn't have to be processed again.
Get this in your inbox at 7am
One free email each morning with the AI repos, models and stories that are picking up speed, including new free models. Your own time zone, no spam.