What is prompt caching?
Prompt caching means that a model provider keeps the processed beginning of a prompt, so that a later request starting with the same text does not have to be processed again from scratch. The documentation of four providers describes it in these words (pages retrieved on 5 December 2026):
| Provider and page | Wording |
|---|---|
| OpenAI, “Prompt caching” (no date on the page) | “Prompt caching preserves that state for a reusable prefix: the unchanged tokens at the beginning of a prompt.” |
| Anthropic, “Prompt caching” (no date on the page) | “Prompt caching optimizes your API usage by letting the API resume from specific prefixes in your prompts.” |
| Amazon Bedrock, “Prompt caching for faster model inference” (no date on the page) | “Prompt caching is an optional feature that you can use with supported models on Amazon Bedrock to reduce inference response latency and input token costs.” |
| Google Gemini API, “Context caching” (no date on the page) | “Implicit context caching reuses matching prompt prefixes with no setup calls or storage fees.” |
OpenAI, Anthropic and Google speak of prefixes, Bedrock of a feature for supported models; Google calls it context caching. What the provider keeps inside the model is described in the entry on the KV cache.
How does prompt caching work?
A cached prefix is reused only if the new request begins with exactly the same content. OpenAI's page states: “Cache reuse requires the entire rendered prefix to match.” Anthropic's page states: “Cache hits require 100 percent identical prompt segments, including all text and images up to and including the block marked with cache control.”
Because only the beginning is matched, the order of a prompt matters. Amazon Bedrock advises: “Keep static content at the beginning of your prompt and dynamic content at the end to increase the likelihood of an exact prefix match.” The cache concerns the input side. Anthropic writes: “Prompt caching has no effect on output token generation.”
The name also appears in research. In Gim et al. (arXiv 2311.04934, version 1, 7 November 2023) the authors write: “We present Prompt Cache, an approach for accelerating inference for large language models (LLM) by reusing attention states across different LLM prompts.”
first request
same beginning, processed and stored
new ending A, processed
stored prefix
later request
same beginning, reused from the cache
new ending B, processed
Implicit and explicit prompt caching
The providers distinguish between caching that happens without a setting and caching that the developer marks. Anthropic describes both: “Automatic caching: Add a single cache_control field at the top level of your request.” and “Explicit cache breakpoints: Place cache_control directly on individual content blocks for fine-grained control over exactly what gets cached.”
OpenAI's page writes for GPT-5.6 and later models: “Both implicit and explicit caching are supported, where explicit caching gives you more control over which context is written to cache.” In the comparison table on the same page, explicit breakpoints are marked “Not supported” for GPT-5.5, GPT-5.5 Pro and other earlier models.
Amazon Bedrock writes: “Implicit Prompt Caching is best effort.” Google's Gemini page names two rules: “Implicit caching is enabled by default on all Gemini 2.5 and newer models.” and “The Interactions API and all Gemini 4 models support implicit caching only.”
Lifetime, minimum length and rates, as the providers state them
The provider pages carry no date. The wording below is as retrieved on 5 December 2026; each row names the provider, and the row label or the quoted sentence names the models where the page ties the sentence to specific ones.
| Provider, models | Wording |
|---|---|
| OpenAI, GPT-5.6 and later | “For GPT-5.6 and later, cache writes cost 1.25× the standard, uncached input-token rate for the default 30-minute lifetime.” and “In the Responses API, you can choose a 12-hour minimum lifetime at a write rate of 2.5× ordinary input.” |
| OpenAI, models named in the sentence | “Subsequent reads cost 0.1× the ordinary input rate on most of these models and 0.05× on GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Sol, and GPT-6.1 Terra, regardless of the selected lifetime.” |
| OpenAI, minimum length | “The minimum cacheable prompt length is 1,024 tokens for GPT-5.6 and later and varies by request settings for earlier models.” |
| OpenAI, earlier models | Cache write charge in the comparison table, for GPT-5.5, GPT-5.5 Pro and other earlier models: “No additional cache-write charge”. The in-memory setting appears in the table only for the other earlier models: “in_memory: Entries typically remain active for around 5 to 10 minutes of inactivity, up to one hour.” |
| Anthropic, base rates | “Cache write tokens with a 5-minute TTL are 1.25 times the base input tokens price. Cache write tokens with a 1-hour TTL are 2 times the base input tokens price. Cache read tokens are 0.1 times the base input tokens price” |
| Anthropic, Fable 5.2, Mythos 5.2, Fable 5.1, Mythos 5.1 | “Cache hits and refreshes on Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, and Claude Mythos 5.1 are priced at 0.025x the base input price.” |
| Anthropic, Opus 5.5 and Sonnet 5.5 | “Cache hits and refreshes on Claude Opus 5.5 and Claude Sonnet 5.5 are priced at 0.05x the base input price.” |
| Anthropic, minimum length | “512 tokens for Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Fable 5, Claude Mythos 5, and Claude Haiku 5.5” and “2,048 tokens for Claude Mythos Preview and Claude Opus 4.7” |
| Amazon Bedrock | “Minimums currently range from 512 to 4,096 tokens per cache checkpoint.” |
| Google Gemini 4, 3 and 2.5 | “Cached input tokens cost 95% less on Gemini 4 models and up to 90% less on Gemini 3 and 2.5 models.” |
Three of the four providers say that a rate or a cache hit is not guaranteed for each request. OpenAI: “The minimum lifetime governs eligibility for cache-read pricing. It does not guarantee that every request reuses stored KV tensors or has lower latency.” Amazon Bedrock: “Support for prompt caching doesn't guarantee a cache hit for any request.” Google: “Implicit caching is opportunistic and offers no guaranteed retention window or cost savings.”
Two meanings: reusing the prefix and reusing the answer
In research papers the words prompt cache and prompt caching also stand for a second idea: storing the answer to a prompt and returning it for a later prompt. In the abstracts:
| Paper and version | Wording |
|---|---|
| Gim et al., version 1 (7 November 2023) | “by reusing attention states across different LLM prompts” |
| Zhu et al., version 1 (2 February 2024) | “if the current prompt can be answered by the same response of a previous prompt, one can directly utilize that previous response without calling the LLM” |
| Schroeder et al., version 1 (6 February 2025) | “Semantic prompt caches reduce the latency and cost of large language model (LLM) inference by reusing cached LLM-generated responses for semantically similar prompts.” |
| Schroeder et al., version 5 (21 February 2026) | “Semantic caches return cached responses for semantically similar prompts to reduce LLM inference latency and cost.” |
Gim et al. reuse states that the model computed; Zhu et al. and Schroeder et al. reuse responses. The paper by Zhu et al. carries the title “Efficient Prompt Caching via Embedding Similarity”. The paper by Schroeder et al. changed its title from “Adaptive Semantic Prompt Caching with VectorQ” in version 1 to “vCache: Verified Semantic Prompt Caching” in version 5, and its abstract moved from “semantic prompt caches” to “semantic caches”. The entry on semantic caching explains how a similarity threshold decides whether a stored answer is returned.
Privacy, isolation and timing
Gu et al. (arXiv 2502.07776, version 1, 11 February 2025) write: “Prompt caching in large language models (LLMs) results in data-dependent timing variations: cached prompts are processed faster than non-cached prompts.” In the same abstract: “We detect global cache sharing across users in seven API providers, including OpenAI, resulting in potential privacy leakage about users' prompts.” Version 2 (13 July 2025) keeps both sentences.
The provider pages of 5 December 2026 describe how they separate caches. Anthropic: “Cache entries are isolated between organizations and, on some platforms, between workspaces within an organization.” Google: “Implicit cache entries remain isolated to your project, with a best-effort time to live (TTL) of up to 24 hours in memory (RAM).” OpenAI describes separate cache keys for the customers or users of an application and names a risk they help prevent: “cache-hit probing across users: submitting candidate prompts and observing cache hits to learn whether matching content was previously cached.” On storage, OpenAI writes: “Prompt caching may store encrypted key/value tensors in GPU-local storage as application state.”
Ryan Fahey (arXiv 2605.30613, version 1, 28 May 2026) examines cache isolation behind API gateways and describes the feature as follows: “Prompt caching helps save precious compute resources and speeds up response times by reusing parts of the KV cache of a specific prompt for another request.”
How to see whether a prompt was cached
Three of the providers describe how cached input is reported:
| Provider | Wording |
|---|---|
| Anthropic | “if both cache_creation_input_tokens and cache_read_input_tokens are 0, the prompt was not cached” |
| OpenAI, GPT-5.6 and later | Cached-token reporting: “Exact eligible boundary, excluding hidden tokens” |
| OpenAI, earlier models | Cached-token reporting: “Excludes hidden tokens and rounds down to a multiple of 128” |
| Google Gemini API | In an example on the page, the second call “reuses the shared prefix and reads usage.total_cached_tokens to report the cache hit rate” |
Zhang et al. (arXiv 2610.34817, version 1, 26 October 2026) studied 120 pull requests on prompt caching in 10 open-source agent systems and write that “most mis-integrations fail silently without causing observable runtime failures”. Version 2 (27 October 2026) has the same abstract.
Names and dates in the sources
The providers name the feature differently. Microsoft's page on Azure OpenAI in Microsoft Foundry Models (page shows “Last updated on 2026-11-06”) uses prompt caching: “Prompt caching reduces overall request latency and cost for longer prompts that have identical content at the beginning of the prompt.” Google Cloud (page shows “Last updated 2026-12-04 UTC”) writes: “Context caching helps reduce the cost and latency of requests to Gemini that contain repeated content.” DeepSeek's page is titled “Context Caching” and states: “The DeepSeek API Context Caching on Disk Technology is enabled by default for all users”. The Gemini API page does not use the phrase prompt caching.
Numbers in the papers can change between versions. Lumer et al. (arXiv 2601.06007) write in version 1 (9 January 2026): “prompt caching reduces API costs by 45-80% and improves time to first token by 13-31% across providers”. Version 2 (31 January 2026) reads: “prompt caching reduces API costs by 41-80% and improves time to first token by 13-31% across providers”. The title of the paper is “Don't Break the Cache: An Evaluation of Prompt Caching for Long-Horizon Agentic Tasks”.
7 Nov 2023
Gim et al.,
“Prompt Cache”, version 1
2 Feb 2024
Zhu et al.,
version 1
6 Feb 2025
Schroeder et al.,
version 1 (“VectorQ”)
11 Feb 2025
Gu et al.,
version 1
9 Jan 2026
Lumer et al.,
version 1
28 May 2026
Fahey,
version 1
26 Oct 2026
Zhang et al.,
version 1
Other meanings of “cache” and “prompt caching”
Outside language models, cache is a general word in computing. The Wikipedia article “Cache (computing)” notes that “web browsers and web servers commonly rely on software caching”, and it gives an example: “a web browser program might check its local cache on disk to see if it has a local copy of the contents of a web page”.
Prompt caching in the provider pages above stores the processed beginning of a prompt, and semantic caching in the papers above stores answers. The three share the word cache.
Prompt caching and related terms
KV cache. Prompt caching keeps processed prompt prefixes across requests; the entry on the KV cache explains the keys and values a model keeps while it generates a response.
AI token. Minimum lengths and cached input are counted in tokens; the entry on AI tokens explains how text is split into tokens.
Context window. A cached prefix is part of the prompt that a model reads; the entry on context windows deals with the limit on what a model reads in one request.
Embeddings. The paper by Zhu et al. compares prompts through embedding similarity; the entry on embeddings covers what an embedding is.
Vector database. Semantic caches look up similar prompts rather than identical ones; the entry on vector databases covers how stores of that kind search by similarity.
Source
- OpenAI, “Prompt caching” (API documentation, no date on the page). Source for the OpenAI wording, rates, lifetimes, comparison table and cache keys (retrieved 2026-12-05): https://developers.openai.com/api/docs/guides/prompt-caching
- Anthropic, “Prompt caching” (Claude documentation, no date on the page). Source for the Anthropic wording, rates, minimum lengths, isolation and usage fields (retrieved 2026-12-05): https://platform.claude.com/docs/en/build-with-claude/prompt-caching
- Amazon Web Services, “Prompt caching for faster model inference” (Amazon Bedrock User Guide, no date on the page). Source for the Bedrock wording and minimums (retrieved 2026-12-05): https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
- Google, “Context caching” (Gemini API documentation, no date on the page). Source for the Gemini wording, rates and isolation (retrieved 2026-12-05): https://aistudio.google.com/docs/caching
- Google Cloud, “Context caching overview” (Gemini Enterprise Agent Platform documentation, page shows “Last updated 2026-12-04 UTC”). Source for the Google Cloud name of the feature (retrieved 2026-12-05): https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/context-cache/context-cache-overview
- DeepSeek, “Context Caching” (API documentation, no date on the page). Source for the DeepSeek name of the feature (retrieved 2026-12-05): https://api-docs.deepseek.com/guides/kv_cache/
- Microsoft, “Prompt caching with Azure OpenAI in Microsoft Foundry Models” (page shows “Last updated on 2026-11-06”). Source for the Azure wording (retrieved 2026-12-05): https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/prompt-caching
- Gim et al., “Prompt Cache: Modular Attention Reuse for Low-Latency Inference”, arXiv 2311.04934, version 1 (7 November 2023) and version 2 (25 April 2024). Source for the reuse of attention states (retrieved 2026-12-05): https://arxiv.org/abs/2311.04934v1
- Zhu, Zhu and Jiao, “Efficient Prompt Caching via Embedding Similarity”, arXiv 2402.01173, version 1 (2 February 2024). Source for the reuse of responses (retrieved 2026-12-05): https://arxiv.org/abs/2402.01173v1
- Schroeder et al., “Adaptive Semantic Prompt Caching with VectorQ”, arXiv 2502.03771, version 1 (6 February 2025), titled “vCache: Verified Semantic Prompt Caching” in version 5 (21 February 2026). Source for semantic caching in both versions (retrieved 2026-12-05): https://arxiv.org/abs/2502.03771
- Gu et al., “Auditing Prompt Caching in Language Model APIs”, arXiv 2502.07776, version 1 (11 February 2025) and version 2 (13 July 2025). Source for timing variations and cache sharing (retrieved 2026-12-05): https://arxiv.org/abs/2502.07776
- Lumer et al., “Don't Break the Cache: An Evaluation of Prompt Caching for Long-Horizon Agentic Tasks”, arXiv 2601.06007, version 1 (9 January 2026) and version 2 (31 January 2026). Source for the figures in both versions (retrieved 2026-12-05): https://arxiv.org/abs/2601.06007
- Fahey, “CacheProbe: Auditing Prompt Cache Isolation in Gateway APIs”, arXiv 2605.30613, version 1 (28 May 2026). Source for the description of the feature (retrieved 2026-12-05): https://arxiv.org/abs/2605.30613v1
- Zhang et al., “Silent and Costly: Characterizing and Detecting Prompt-Caching Mis-Integration in LLM Agents”, arXiv 2610.34817, version 1 (26 October 2026) and version 2 (27 October 2026). Source for mis-integrations (retrieved 2026-12-05): https://arxiv.org/abs/2610.34817
- Wikipedia, “Cache (computing)”. Source for caches in general (retrieved 2026-12-05): https://en.wikipedia.org/wiki/Cache_(computing)
Frequently asked questions
Does prompt caching happen automatically?
It depends on the provider and the model. Google writes that “Implicit caching is enabled by default on all Gemini 2.5 and newer models.” Amazon Bedrock writes that “Implicit Prompt Caching is best effort.” Anthropic describes automatic caching through “a single cache_control field at the top level of your request”.
How do I turn on prompt caching in the Claude API?
Anthropic's documentation (no date on the page, retrieved 5 December 2026) names two ways. “Automatic caching: Add a single cache_control field at the top level of your request.” and “Explicit cache breakpoints: Place cache_control directly on individual content blocks for fine-grained control over exactly what gets cached.” The minimum length depends on the model.
What is the difference between prompt caching and KV caching?
The KV cache holds the keys and values a model computes for the tokens of one request while it generates. Prompt caching, as OpenAI describes it, keeps that processed state for a prompt prefix so that later requests with the same beginning can reuse it. The first is the subject of the entry on the KV cache.
What is the difference between prompt caching and semantic caching?
Prompt caching reuses the processed prefix of a prompt; the model still writes a new answer. Semantic caching returns a stored answer for a similar prompt. Schroeder et al. (version 5, 21 February 2026): “Semantic caches return cached responses for semantically similar prompts to reduce LLM inference latency and cost.”
How long does a prompt cache last?
Each provider states its own lifetime. Anthropic prices cache writes with “a 5-minute TTL” and “a 1-hour TTL”. OpenAI names a default 30-minute lifetime for GPT-5.6 and later and a 12-hour option in the Responses API. Google gives implicit entries “a best-effort time to live (TTL) of up to 24 hours”.