Prompt caching with Claude and OpenAI: cost and latency

1 November 2026 • 5 min read

In short

  • Cached input reads cost 0.1× the normal input price on both Claude and OpenAI GPT-5.6 and later; cache writes cost 1.25× (vendor docs and price pages, read 1 November 2026).

Prompt caching lets the model provider reuse the work it already did on the start of your prompt. If your app sends the same system prompt, tool definitions or reference document on every call, you pay a lower price for that repeated part and wait less before the first word of the answer arrives. This page sets out what the two vendors' own documentation says, with the arithmetic, so a product team can decide whether to turn it on. Figures are as of 1 November 2026; vendors change them, so check the linked pages before you budget.

1. What is actually cached

Both vendors cache the prefix of a request, not the answer. On Claude, the cache covers the request in a fixed order: tools, then system, then messages, up to the block you mark with cache_control. OpenAI describes the stored item as the model's internal key-value state for that prefix, not the tokens themselves.

Two consequences follow. First, anything that changes early in the prompt breaks the match for everything after it. Second, caching does not change the answer. Anthropic states that caching has no effect on how the output is generated, so you can switch it on without re-testing quality.

2. What it costs

The multipliers below apply to the normal input price of the model you use. Output tokens are not discounted.

ClaudeOpenAI (GPT-5.6 and later)
How to turn it onOpt in with cache_controlOn by default for supported models
Default lifetime5 minutes, refreshed on each use30 minutes
Write cost1.25× (5 min); 2× for a 1-hour cache1.25× (30 min); 2.5× for a 12-hour cache in the Responses API
Read cost0.1× on most models; 0.05× on Opus 5.5 and Sonnet 5.50.1× on most models; 0.05× on GPT-6.1 Sol and Terra
Smallest cacheable prompt512 to 4,096 tokens, by model1,024 tokens

Older OpenAI models work differently: they have no extra write charge and use a model-specific cached-input rate, which you read off OpenAI's pricing page. Check the model you actually call.

3. The arithmetic

Take a long system prompt that costs 1× to process normally. OpenAI's documentation works the example for its models. Writing a prefix once and reusing it once costs 1.35× its ordinary input cost, against 2× without caching. Across ten requests, one write and nine reads cost 2.15×, against 10×.

The same sum holds for Claude's default cache: 1.25 for the write plus nine reads at 0.1 is 2.15×. Anthropic's price page says a 5-minute cache pays off after one read, and the 1-hour cache after two reads.

So the saving depends on how often the same prefix comes back inside the cache lifetime. A support bot that sends the same long policy document with every question gains a lot. A weekly report job that runs once and never repeats a prefix gains nothing and pays the write premium.

4. What it does to latency

Both vendors say caching shortens the wait before the response starts, because the model skips reprocessing the cached prefix. Anthropic says you generally see better time-to-first-token for long documents. OpenAI lists "faster" as one of three benefits.

Neither page gives a latency figure, and OpenAI adds a warning: the cache lifetime decides when you get cache-read pricing, but it does not guarantee that a request reuses the stored state or runs faster. Measure the time to first token on your own traffic before you promise a number to anyone. Caching also has no effect on how long the answer takes to generate.

5. Prompt layout that gets cache hits

A hit needs the prefix to match exactly. Anthropic says hits require identical prompt segments, including all text and images up to the marked block. Practical rules from the two vendors:

  • Put the stable parts first: tool definitions, system instructions, reference documents. Put anything that changes per call, such as a timestamp, a user name or the user's question, at the end. OpenAI says to move such content to the end or into later messages.
  • Do not edit tool definitions between calls. On Claude, changing a tool's name, description or parameters invalidates the whole cache.
  • Append to a conversation instead of rewriting it. OpenAI notes that summarising, compaction or truncating history can change the prefix and reset reuse.
  • On Claude, parallel requests do not share a fresh cache. An entry becomes available only after the first response starts, so send the first call, then the rest.
  • On Claude, the system looks back at most 20 blocks for an earlier entry. In a long conversation, add a second breakpoint; Claude allows up to 4.

6. How to check it is working

Do not assume. Read the usage fields in each response.

  • Claude returns cache_creation_input_tokens (written) and cache_read_input_tokens (read). If both are 0, nothing was cached, often because the prompt was under the minimum length. No error is raised in that case.
  • OpenAI returns cached_tokens in the input token details. OpenAI suggests tracking the hit rate as cached tokens divided by total input tokens.

Log both against the cost of each request for a few days. If the hit rate is low, the cause is nearly always a prefix that changes: a timestamp at the top, or a tool list that is rebuilt each time.

7. When not to bother

  • The repeated prefix is shorter than the model's minimum.
  • Calls for the same prefix come more than a few minutes apart and you have not chosen a longer lifetime.
  • Each call carries different reference material. Nothing repeats, so there is nothing to reuse.

For wider cost planning, see our pages on LLM costs at scale and the LLM API comparison for India.

Questions people ask

Is prompt caching on by default?

On OpenAI, yes, for supported models. On Claude, no. You opt in by adding cache_control to the request, either at the top level or on individual content blocks.

Does caching change the model's answer?

Anthropic says it has no effect on output generation: the response is identical to one without caching. Only the processing of the repeated input is reused.

Is the longer Claude cache worth it?

Anthropic's price page says the 1-hour cache pays off after two reads, against one read for the 5-minute cache. It helps when the same prefix returns after more than 5 minutes but inside the hour.

Is cached data shared between customers?

OpenAI says caches are not shared across organisations and cannot be reused across regional processing boundaries. Read each vendor's data-retention terms if you handle personal data.

Sources

  1. Anthropic, Prompt caching (Claude docs), read 1 November 2026
  2. Anthropic, Claude pricing page, read 1 November 2026
  3. OpenAI, Prompt caching guide, read 1 November 2026
  4. OpenAI, API pricing page, read 1 November 2026

Nine stories, every morning at 09:15 IST.

Get the brief free →