Prompt caching explained: $205 or $15 a day for the same app (Claude, OpenAI, Gemini)

Prompt caching keeps the KV cache of the start of your prompt between requests, so repeated input costs a tenth or a twentieth of the normal price and the first word comes sooner. It only matches an exact prefix: one changing line at the top can make a cached app cost more than an uncached one. How it works, what Claude, OpenAI and Gemini charge as of November 2026, and how to check it's on.

Take a support bot that sends the same 20,000 tokens with every question (system prompt, tool definitions, help docs) plus a 500-token question, 5,000 times a day, on Claude Sonnet 5.5. At list prices, the input side of the bill is $205.00 a day without caching and $15.05 with it. Same app, same answers.

And if someone puts the current time on the first line of the system prompt, the same app with caching switched on costs $255.00, more than no caching at all. Nothing errors, every answer is still correct.

This post explains why, using the providers’ own docs and price pages as of 20 November 2026. No tests were run for it: the receipts are arithmetic on list prices, and every other number is quoted from the linked pages. Prices and rules change often, so check the links before you rely on a number.

The two receipts

No cacheClaude Sonnet 5.5No cache: 205.00 $/day205.00 $/dayCache, static firstClaude Sonnet 5.5Cache, static first: 15.05 $/day15.05 $/dayCache, time on topClaude Sonnet 5.5Cache, time on top: 255.00 $/day255.00 $/dayCache, static firstGPT-5.6 TerraCache, static first: 25.05 $/day25.05 $/day
Arithmetic on list prices as of 20 Nov 2026, not a measurement: 5,000 requests a day, each a 20,000-token static prefix plus a 500-token question; input tokens only. Claude Sonnet 5.5: $2 input, $2.50 cache write (5 min), $0.10 cache read per million; GPT-5.6 Terra: $2, $2.50 (30-min write), $0.20. Steady traffic keeps the cache warm, so one write a day. Bars to scale.
No cache Cache, static first Cache, time on top
20,000-token prefix, 5,000×/day 100M tokens × $2.00/M 1 write × $2.50/M + 99.98M reads × $0.10/M 5,000 writes × $2.50/M
500-token question, 5,000×/day 2.5M × $2.00/M 2.5M × $2.00/M 2.5M × $2.00/M
Total per day $205.00 $15.05 $255.00

Prices from Anthropic’s prompt caching page: Sonnet 5.5 input $2 per million tokens, a 5-minute cache write $2.50 (1.25×), a cache hit $0.10 (0.05×). Steady traffic (one request every ~17 seconds on average) keeps the cache warm all day, so there’s one write. Output tokens cost the same in all three columns and are left out. Over a month, that’s about $6,150 against $451.50.

What the provider actually keeps

Not your text: the KV cache. As we covered in the KV cache post, a model turns every token of your prompt into keys and values in every layer, and keeps them while it writes the answer. Reading the prompt to build them is the prefill, the wait before the first word. (If tokens themselves are new to you, start with what a token is.)

Normally that cache is thrown away when the request ends. Prompt caching keeps it for the next request. So “prompt caching vs KV caching” isn’t either/or: KV caching speeds up one answer; prompt caching shares the prefill work between answers. That’s also why the savings only apply to input tokens. vLLM’s docs say it plainly: prefix caching “only reduces the time of processing the queries (the prefilling phase)” (vLLM docs).

The one rule: an exact prefix, from the first token

The cache matches an exact prefix, from the first tokenrequest 1toolssystem promptdocumentsQ1written to cacherequest 2toolssystem promptdocumentsQ2read: all before Q2time on top15:30:07toolssystem promptdocumentsQ3read: nothingread from cache (cheap, no prefill)computed at full price (or a cache write)
Simplified. Providers match the rendered prompt from its first token (Anthropic: tools, then system, then messages); the first difference ends the match, and everything after it is processed again.

The cache only matches the beginning of the prompt, byte for byte, up to the first difference. Anthropic: “Cache prefixes are created in the following order: tools, system, then messages.” OpenAI: “Cache reuse requires the entire rendered prefix to match” (OpenAI guide).

It’s strict for a reason. In a transformer each token’s keys and values (from the second layer on) depend on every token before it, so changing one early token changes the numbers for everything after it. vLLM even builds this into its cache key: “we hash each kv-cache block by the tokens in the block and the tokens in the prefix before the block” (vLLM design doc).

So the order of your prompt is the whole game:

  1. Tools (definitions, in a fixed order)
  2. System prompt (frozen, no dates or names)
  3. Documents and examples
  4. Conversation history
  5. The thing that changes: the question, the date, the user’s name, last

The one-character mistake

Put Current time: 2026-11-22 15:30:07 on the first line of the system prompt and every request starts differently. On Claude, if the cache marker is still set, each request writes a new cache entry at 1.25× and nothing is ever read: 5,000 × 20,000 tokens × $2.50/M = $250, plus $5 of questions. $255 a day instead of $15.05, and 24% more than not caching at all.

The usual suspects, from the providers’ docs:

  • A timestamp, request ID or user name in the system prompt.
  • Tools added, removed or reordered: “Modifying tool definitions (names, descriptions, parameters) invalidates the entire cache” (Anthropic); OpenAI lists “tool names, descriptions, schemas, ordering”.
  • JSON serialized with keys in a random order (for example, without sorted keys).
  • Switching models: caches belong to one model.
  • On Claude, “Adding/removing images anywhere in the prompt affects message blocks”, and changing the thinking or effort settings invalidates the message cache.

What each provider charges (as of 20 November 2026)

Claude (Anthropic) OpenAI Gemini (Google)
How it’s turned on cache_control breakpoints (up to 4), or one top-level cache_control for automatic caching Automatic, on by default; GPT-5.6+ also has explicit breakpoints Implicit on Gemini 2.5 and newer; explicit caches on 2.5 and 3.x
Minimum prompt 512 tokens (Opus/Sonnet/Haiku 5.5) to 4,096 (Opus 4.6, Haiku 4.5) 1,024 tokens (GPT-5.6 and later) 2,048 (2.5) or 4,096 (3.x, Gemini 4)
Cache write 1.25× (5 min) or 2× (1 hour) Older models: no write charge. GPT-5.6+: 1.25× (30 min) or 2.5× (12 hours) Explicit caches: storage per hour
Cache read 0.1×; 0.05× on Sonnet/Opus 5.5; 0.025× on Fable 5.1 0.1× on most models; 0.05× on some GPT-6.x 0.1× on most models; 0.05× on Gemini 4
Lifetime 5 minutes, refreshed free on every hit; or 1 hour Older: ~5–10 min idle, up to 1 h (or 24 h); GPT-5.6+: 30 min or 12 h Explicit: 1 hour default
Check it with cache_read_input_tokens, cache_creation_input_tokens input_tokens_details.cached_tokens usage_metadata (cached tokens)

Sources: Anthropic prompt caching, OpenAI prompt caching and pricing, Gemini caching and pricing.

A few details that matter in practice:

  • Claude shorter-than-minimum prompts are “processed without caching” and “no error is returned”. A 3,000-token system prompt caches on Opus 5.5 but not on Opus 4.6. The 1-hour cache pays off from three requests, the 5-minute one from two (1.25 + 0.1 < 2; 2 + 0.2 < 3).
  • Claude caches become readable only “after the first response starts”. Ten identical requests fired at once all pay full price; send one, wait for its first token, then the rest.
  • OpenAI on models before GPT-5.6, “Cached states live on individual machines, where traffic above 15 requests per minute can lead to overflow routing”, so a busy prefix can land on machines without your cache. A stable prompt_cache_key keeps related requests together. On GPT-5.6 and later, “OpenAI handles cache routing automatically”. The same support bot on GPT-5.6 Terra ($2.00 input, $0.20 cached, $2.50 write) costs about $25.05 a day.
  • Gemini implicit caching has no cost-saving guarantee; explicit caches do, but pay rent. On Gemini 2.5 Pro, storage is $4.50 per million tokens per hour: a one-million-token cache left for a day is $108 before a single question. Gemini 4 models don’t support explicit caches, and in multi-turn chats the previous request is only cached if the new one adds at least 2,050 tokens.

Running your own model

Open-source servers do the same thing, without a bill:

  • vLLM has automatic prefix caching, on by default in current versions (enable_prefix_caching: bool = True in vllm/config/cache.py). It caches full KV blocks keyed by a hash of the block and everything before it, and evicts the least recently used. The docs call it “almost a free lunch and won’t change model outputs”.
  • SGLang’s RadixAttention “retains the KV cache for both prompts and generation results in a radix tree”, a tree of shared beginnings, with LRU eviction and cache-aware scheduling (LMSYS blog). The SGLang paper reports “up to 6.4x higher throughput compared to state-of-the-art inference systems” across its workloads (Zheng et al., arXiv:2312.07104, as reported).

And it’s faster

Skipping prefill also shortens the wait for the first word. In Anthropic’s launch post, a 100,000-token “chat with a book” went from 11.5 s to 2.4 s time to first token (−79%), and a 10,000-token many-shot prompt from 1.6 s to 1.1 s (Anthropic, models of the time, as reported). The longer the shared prefix, the bigger the win.

How to check it’s working

Don’t assume. Read the usage numbers in every response:

  • Claude: usage.cache_read_input_tokens (read at the cheap rate), usage.cache_creation_input_tokens (written), usage.input_tokens (the rest). Total input = all three added up.
  • OpenAI: usage.input_tokens_details.cached_tokens (and cache_write_tokens on GPT-5.6+).
  • Gemini: the cached token count in the response’s usage_metadata.

If the read count is zero on the second identical request, something near the top is changing. Log two consecutive request bodies and diff them; the first difference is your culprit.

Checklist

  1. Tools, system prompt and documents first, in a fixed order, byte for byte.
  2. Dates, user names, IDs and the question last.
  3. Put the cache breakpoint at the end of the shared part, not after the question (Claude).
  4. Keep the model and the tool list fixed during a conversation.
  5. Check that cache reads are above zero, after every change to how prompts are built.

Is prompt caching on in your app, and did you ever find a timestamp at the top? Tell me in the comments under the video.