New · France 2027 presidential election: what the candidates propose on AI, quoted and sourced. Explore the tracker →

Last reviewed:

What is prompt caching? Definition, pricing and cache lifetime

Prompt caching lets a language model API reuse the identical start of an already processed prompt (instructions, tools, documents) instead of recomputing it on every request. At Anthropic, a cache read costs 0.1 times the input price on most models (0.025 times on Claude Fable 5.2) and a 5-minute write costs 1.25 times.

A request sent to a model often carries the same base: system instructions, tool definitions, reference documents, conversation history. Without a cache, the provider reprocesses those thousands of tokens on every call and bills them at full price. With prompt caching, the start of the prompt is stored after a first request, and later requests that begin with exactly the same text read it back at a reduced rate. The cache does not change the answer: Anthropic states it has no effect on output token generation. At Anthropic, a write costs 1.25 times the base input price for a 5-minute lifetime and 2 times for 1 hour. A read costs 0.1 times on most models, 0.05 times on Claude Opus 5.5 and Claude Sonnet 5.5, and 0.025 times on Claude Fable 5.2. The default lifetime is 5 minutes, refreshed at no cost on each read. The text must be 100% identical, in the order tools, system, messages. The minimum is 512 tokens on Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5. At OpenAI, caching is on by default. On GPT-5.6 and later, a read costs 0.1 times the input price (0.05 times for GPT-6.1 Sol and Terra) and a write 1.25 times for a 30-minute minimum or 2.5 times for 12 hours, with a 1,024-token minimum. Older models have no write fee.

Concrete example

Illustrative case, using real Claude Sonnet 5.5 prices ($2 per million input tokens, $2.50 for a 5-minute write, $0.10 for a read). A 35-person consulting firm queries an assistant backed by a 50,000-token internal reference (methods, deliverable templates) placed at the start of every request. In a busy hour, 200 requests arrive, each less than 5 minutes after the previous one. Without a cache: 200 x 50,000 = 10 million tokens, or $20.00. With a cache: one write (50,000 x $2.50 / 1,000,000 = $0.125) and 199 reads (9.95 million x $0.10 / 1,000,000 = $0.995), or $1.12, about 94% less on that part. Questions and answers are billed at the normal rate in both cases.

Comparison

Prompt caching, semantic caching, KV cache and RAG: four notions not to confuse
Prompt cachingSemantic cachingKV cacheRAG
Where it actsAt the provider, on the model APIIn your application, before the model callInside the model, during generationIn your application, before the prompt is written
What is reusedThe processing of an identical prompt startAn answer already produced for a similar questionThe attention computations of tokens already readExcerpts from your documents, added to the prompt
MatchingExact, character for characterApproximate, by similarity of meaningAutomatic, internal to the modelBy relevance search
Is the model calledYes, an answer is generated each timeNo, on a cache hitYes, it is a step of the computationYes
Main riskA prompt start that changes and makes the cache uselessServing a stale or off-target answerMemory consumed on long contextsIrrelevant excerpts, inaccurate answer
Who tunes itYou, through prompt structure and an API parameterYou, through the similarity threshold and validity periodThe provider or the infrastructure teamYou, through indexing and retrieval

FAQ

What is prompt caching?

It is an API feature that stores the start of an already processed prompt (instructions, tools, documents) so it is not recomputed on every request. Later requests that begin with the same text read that start back at a reduced rate. The model's answer stays the same.

What is the difference between prompt caching and semantic caching?

Prompt caching sits at the model provider and requires an identical prompt start; the model still generates an answer. Semantic caching sits in your application: it compares the meaning of questions by similarity (a common threshold is 0.85 to 0.95 according to Redis) and returns an answer already produced without calling the model. It saves more on each hit, but can serve a stale or off-target answer.

What is the difference between prompt caching and KV cache?

The KV cache is an internal mechanism of the model: during generation it keeps the attention computations (keys and values) of tokens already read so they are not redone. Prompt caching belongs to the same family of ideas, but it is a billed, configurable API feature that keeps a prompt start between two requests.

What is the difference between prompt caching and RAG?

RAG retrieves relevant excerpts from your documents and adds them to the prompt. Prompt caching retrieves nothing: it lowers the cost of what is sent again unchanged. They combine, with one precaution: RAG excerpts that change with each question, placed at the start, stop the cache from serving. Put the stable parts first.

How much do cache writes and reads cost at Anthropic?

Prices per million tokens (Anthropic pricing page, November 2026), base input / 5-minute write / 1-hour write / read: Claude Fable 5.2, $8 / $10 / $16 / $0.20; Claude Opus 5.5, $4 / $5 / $8 / $0.20; Claude Sonnet 5.5, $2 / $2.50 / $4 / $0.10; Claude Haiku 5.5 (prompts up to 100,000 tokens), $0.10 / $0.125 / $0.20 / $0.01.

How much does prompt caching cost at OpenAI?

It is on by default. On GPT-5.6 and later, a read costs 0.1 times the input rate (0.05 times for GPT-6.1 Sol and Terra) and a write 1.25 times (30-minute minimum) or 2.5 times (12 hours), with a 1,024-token minimum. On older models there is no write fee and the discount on cached input goes up to 95%.

How long is the cache kept?

At Anthropic, 5 minutes by default or 1 hour as an option, refreshed at no cost on each read and counted from the start of the request. At OpenAI, on older models, 5 to 10 minutes of inactivity (up to one hour) in memory, or up to 24 hours with extended retention; on GPT-5.6 and later, 30 minutes at minimum, or 12 hours.

See also

Further reading

Prompt caching, Claude documentation, Anthropic (external resource)

Sources

  1. Pricing (models, cache multipliers, read and write prices), Anthropic, page viewed 14 November 2026. https://platform.claude.com/docs/en/about-claude/pricing (accessed 2026-11-14)
  2. Prompt caching (lifetime, minimum tokens, exact matching), Claude documentation, Anthropic. https://platform.claude.com/docs/en/build-with-claude/prompt-caching (accessed 2026-11-14)
  3. Prompt caching (retention, minimum, discounts, write fees), OpenAI Developers. https://developers.openai.com/api/docs/guides/prompt-caching (accessed 2026-11-14)
  4. Cache strategies (KV cache), Transformers documentation, Hugging Face. https://huggingface.co/docs/transformers/kv_cache (accessed 2026-11-14)
  5. What is semantic caching? (embeddings, similarity threshold), Redis, updated 13 November 2026. https://redis.io/blog/what-is-semantic-caching/ (accessed 2026-11-14)

Editorial methodCorrections log

← Back to glossary

Address copied