aliteq.

Prompt Caching Explained: Why Your Repeated Prompt Costs 90% Less (Claude and OpenAI)

Neon read both vendors' docs on 3 October 2026. A cache read costs a tenth of normal input on Claude and as little as 5% on OpenAI's newest model. A cache that misses costs more than none at all.

Aliteq TeamUpdated Oct 39 min read
Flat illustration of a woman holding a book with a bookmark ribbon beside a huge coral piggy bank shaped like a stack of books, on a saturated violet background
Share

I spend my days with AI tools, and the bill line people ignore is the one that repeats. You send the same long instructions with every request. The model reads them again. You pay again. Prompt caching is the fix, and it's less magic than the marketing makes it sound.

So I read the caching docs and price pages from Anthropic and OpenAI on 3 October 2026 and did the arithmetic. We haven't run these caches ourselves, and neither vendor pays us. If tokens are still a fuzzy idea, start with what a token is.

What prompt caching is

Prompt caching stores the model's work on the beginning of a prompt so a later request can skip it. The saved part is the prefix: everything from the first token up to a marked point. You pay a reduced price for the reused tokens and the model starts answering sooner.

OpenAI's guide puts it plainly. Prompt caching reuses work "when requests share the same prompt prefix". It stores key-value states, the model's internal notes on earlier tokens, not the text itself.

Think of a long instruction sheet you hand an assistant before every question. Without caching, they read all of it again each time. With caching, they remember the sheet and only read your new question.

Two rules fall out of that. The match is exact from the first token, so one changed character early in the prompt breaks it. And only repeated beginnings help, so the stable material must come first.

What a cache read, write and miss cost

A read is cheap, a write costs a bit extra, and a miss is just a normal request plus a wasted write. Claude's reads are 0.1x the normal input price. Its 5-minute writes are 1.25x and 1-hour writes 2x. OpenAI's newest line uses 1.25x writes and 0.1x reads.

Bar charts of price per million input tokens. Claude Sonnet 5.5: normal input $2.00, cache read $0.20, 5-minute cache write $2.50, 1-hour cache write $4.00. OpenAI gpt-6.1-sol: normal input $2.00, cache read $0.10, cache write $2.50.
Standard short-context list prices per 1M input tokens, read 3 October 2026. · aliteq research

Anthropic's own pricing docs say a cache hit costs 10% of the standard input price, "which means caching pays off after one cache read for the 5-minute duration (1.25x write), or after two cache reads for the 1-hour duration (2x write)". We checked that: one write plus one read is 1.25 + 0.1 = 1.35 times the prefix price, against 2 for sending it twice uncached.

A few models differ. Anthropic prices reads at 0.05x on Claude Opus 5.5 and 0.025x on Claude Fable 5.1 and Mythos 5.1. OpenAI prices reads at 0.05x on GPT-6.1 Sol.

How Claude's caching works

On Claude you switch caching on by adding cache_control to your request. You can set one at the top level so the API caches the last block and moves forward as a conversation grows, or mark individual blocks yourself. You get up to four breakpoints.

Anthropic builds the prefix in a fixed order: tools, then system prompt, then messages. A change at any level breaks that level and everything after it. Changing a tool definition invalidates the whole cache, according to the docs.

The default lifetime is 5 minutes, and "the cache is refreshed for no additional cost each time the cached content is used". The clock runs from the start of the request, not the end of the response. A slow 4-minute reply leaves you about a minute to send the follow-up.

For gaps longer than five minutes, add "ttl": "1h" for a 1-hour cache at the 2x write price. Anthropic says to keep the 5-minute cache for prompts used more often than every 5 minutes, because it refreshes free.

Minimum size and the 20-block lookback

Prompts below the model's minimum aren't cached, and you get no error. The minimum is 512 tokens for Sonnet 5.5, Opus 5.5 and Opus 5. It's 1,024 for Sonnet 5 and 4,096 for Haiku 4.5. If cache_creation_input_tokens and cache_read_input_tokens both read 0 in the response, nothing was cached.

The API also only looks back 20 blocks from a breakpoint for an earlier write. A long conversation can outrun that, so Anthropic suggests adding a second breakpoint nearer the end.

How OpenAI's caching works

On OpenAI's current models you don't switch caching on. The guide says it is "enabled by default for supported OpenAI models". What changed with GPT-5.6 is that it now has a write price and optional controls.

For GPT-5.6 and later, the minimum cacheable prefix is 1,024 visible input tokens. Writes cost 1.25x the normal input rate and reads 0.1x. A cached prefix stays eligible for at least 30 minutes after its last write or reuse, and 30 minutes is the only supported setting.

You choose where the breakpoints go with prompt_cache_options.mode:

  • Implicit mode. OpenAI puts a breakpoint at the end of the latest eligible message. Easy for chat threads that only append.
  • Explicit mode. You mark the end of the stable content with prompt_cache_breakpoint. Anything after your last mark bills at the plain input rate with no write charge. You can have up to four cache writes per request.

Older models, GPT-5.5 and before, work differently. They cache implicitly, charge no extra for writes, and use prompt_cache_retention with an in-memory option (about 5 to 10 minutes idle, up to an hour) or 24h. Their cached-input rates vary by model, so check the pricing page before you plan around them.

OpenAI also says traffic above about 15 requests per minute for one cache can spill onto other machines, which lowers hit rates. On models before GPT-5.6 it recommends a stable prompt_cache_key to steer related requests together.

Comparison of Anthropic and OpenAI GPT-5.6-and-later prompt caching. Turn on: Anthropic adds cache_control, OpenAI is on by default. Minimum prefix: Anthropic 512 to 4,096 tokens depending on model, OpenAI 1,024. Lifetime: Anthropic 5 minutes or 1 hour at 2x, OpenAI 30 minutes minimum. Write price 1.25x on both (Anthropic 2x for the 1-hour cache).
Vendor docs, read 3 October 2026. · aliteq research

Claude vs OpenAI prompt caching, side by side

Switch on

Anthropic (Claude)
Add cache_control
OpenAI (GPT-5.6 and later)
On by default

Minimum prefix

Anthropic (Claude)
512 to 4,096 tokens by model
OpenAI (GPT-5.6 and later)
1,024 tokens

Lifetime

Anthropic (Claude)
5 minutes (free refresh) or 1 hour
OpenAI (GPT-5.6 and later)
30 minutes minimum

Write price

Anthropic (Claude)
1.25x (5 min), 2x (1 hour)
OpenAI (GPT-5.6 and later)
1.25x

Read price

Anthropic (Claude)
0.1x (0.05x Opus 5.5)
OpenAI (GPT-5.6 and later)
0.1x (0.05x GPT-6.1 Sol)

Control

Anthropic (Claude)
Up to 4 breakpoints
OpenAI (GPT-5.6 and later)
Implicit or explicit, up to 4 writes

A worked example: 100 requests on one long prompt

With a 20,000-token prefix reused across 100 requests, caching cuts input cost from $4.10 to between $0.348 and $0.576. That's an 86% to 92% saving. The formula is 20,000 × write + 99 × 20,000 × read + 100 × 500 × input, all per million tokens.

The assumptions are ours. Each request has a 20,000-token stable prefix, 500 new input tokens and 300 output tokens. All 100 requests land inside the cache lifetime. We used Claude Sonnet 5.5 and OpenAI's gpt-6.1-sol, which both list $2 per million input tokens and $10 per million output tokens. OpenAI runs in explicit mode with one breakpoint after the prefix.

Bar chart of input cost for 100 requests sharing a 20,000-token prefix. OpenAI gpt-6.1-sol cached $0.348. Claude Sonnet 5.5 5-minute cache $0.546. Claude Sonnet 5.5 1-hour cache $0.576. No cache $4.10. A 5-minute cache that never hits $5.10. A 1-hour cache that never hits $8.10.
Our arithmetic from list prices, not a measurement. · aliteq research

Input cost for 100 requests (USD)

Claude Sonnet 5.5, 5-minute cache

No cache
$4.10
Cached
$0.546
Saving
86.7%

Claude Sonnet 5.5, 1-hour cache

No cache
$4.10
Cached
$0.576
Saving
86.0%

OpenAI gpt-6.1-sol, explicit mode

No cache
$4.10
Cached
$0.348
Saving
91.5%

Output isn't cached, so it costs the same in every row: 100 × 300 × $10 ÷ 1,000,000 = $0.30. Add it and the total bill drops from $4.40 to $0.846 on Claude's 5-minute cache and $0.648 on OpenAI, which is 80.8% and 85.3% lower.

Here is the version people skip. Say your requests arrive more than five minutes apart on Claude's 5-minute cache. Every request writes and none reads: 100 × 20,000 × $2.50 ÷ 1,000,000 + $0.10 = $5.10. That's $1.00 more than sending the prompt with no cache. With the 1-hour setting and no reads, it's $8.10.

So the question isn't whether caching is cheaper. It's whether your traffic comes back in time.

What breaks a cache

The usual cause of a miss is something small that changes inside the prefix. Both vendors say the same thing: the prefix must match exactly, from the first token.

  • A timestamp or user name near the top. Put changing data at the end. OpenAI's guide says to place timestamps and user-specific content "at the end rather than the beginning".
  • Edited tool definitions. Anthropic says changing them invalidates the whole cache. OpenAI lists tool changes as a prefix breaker too.
  • Changed settings. Anthropic lists the thinking configuration and the effort setting as invalidating message blocks. OpenAI lists settings like reasoning effort and structured-output format.
  • Rewriting history. Summarizing or truncating an old conversation changes the prefix. OpenAI warns that compaction can reset reuse.
  • Gaps in traffic. One request every ten minutes will miss a 5-minute cache every time.
  • Too short a prompt. Under the minimum, nothing is cached and nothing warns you.

How to know it's working

Read the usage fields in each response. Anthropic returns cache_creation_input_tokens and cache_read_input_tokens. OpenAI returns cached_tokens and cache_write_tokens under usage.input_tokens_details, and has a Prompt Caching Dashboard.

If reads stay at zero, check the order of your prompt first. Anthropic also offers cache diagnostics that compare two requests and report where they diverged.

One more thing to know: privacy. Anthropic says cache entries are isolated between organizations and that prompt caching is eligible for zero data retention. OpenAI says caches aren't shared across organizations. Neither is a reason to skip a data review for sensitive content.

Put everything that never changes at the top: tools, system prompt, reference text and examples.

Put anything that changes per request (dates, names, the user's question) after the last breakpoint.

Match the lifetime to your traffic. Claude's 5-minute cache suits steady use; use the 1-hour setting for gaps.

Confirm your prompt clears the minimum, then check the cache fields in the response.

Price it before you ship: write once, read the rest, and compare against the no-cache total.

For what else shapes an API bill, see our self-hosted LLM vs API break-even guide and the AI customer service cost-per-resolution breakdown, where long repeated instructions are the norm. The wider cost series lives on the AI automation hub. aliteq sells none of these products. Every price and rule here comes from the vendors' own pages, read on 3 October 2026.

Quick answers

What is prompt caching?
Prompt caching lets an LLM API reuse its work on the repeated beginning of a prompt. Tokens read from the cache bill at a reduced rate and are processed faster. It only works when the start of the new request matches an earlier one exactly.
How much does prompt caching save on Claude?
A cache read costs 0.1x the normal input price. Writing costs 1.25x for the 5-minute cache and 2x for the 1-hour cache. Anthropic says the 5-minute cache pays off after one read and the 1-hour cache after two.
Is OpenAI prompt caching automatic?
Yes. OpenAI says caching is on by default for supported models. On GPT-5.6 and later you can also choose explicit breakpoints. The minimum prefix there is 1,024 tokens, writes cost 1.25x and reads 0.1x, or 0.05x on GPT-6.1 Sol.
How long does a prompt cache last?
Claude's default is 5 minutes, refreshed free on each use, with a 1-hour option at 2x write cost. OpenAI's GPT-5.6 line keeps a prefix for at least 30 minutes after its last use. Older OpenAI models use in-memory or 24-hour retention.
Can prompt caching cost more than not caching?
Yes. A write costs 1.25x or more, so a cache that is never read adds cost. In our example, 100 Claude requests spaced past the 5-minute lifetime cost $5.10 in input against $4.10 with no cache.
Why is my prompt not being cached?
Usual causes: the prompt is under the model's minimum length, something in the prefix changes each request (a timestamp or user name), tool definitions changed, or requests arrive after the cache expired. Check the cache fields in the response usage.

Found this useful? Share it

Share

Aliteq

Aliteq Team

Aliteq started in 2019 as a PC hardware shop and is now a US-based publication. We build the VRAM and cost calculators on this site, track live cloud-GPU prices, and write guides with AI-assisted drafting that we check against primary sources before publishing.

Work out the hardware

The Aliteq brief

The tech worth knowing — hardware, AI, gaming, deals. No spam, unsubscribe anytime.

Keep reading