On September 14, 2026, prompt caching made the input on our first Claude Sonnet 5 call cost 24.7% more than the same prompt sent without it.
Every later call read that cache at a tenth of the input price, and input spend across 87 calls fell 87.8%.
Prompt caching keeps the processed opening of a prompt on the provider's servers and bills each reuse at 2% to 25% of the normal input rate on the eleven models priced below.
Some providers also charge extra to write the cache, and our first call paid that charge. So a cache write is a bet that the same opening comes back before the cache expires.
Most of what goes wrong with prompt caching is a bet placed on a call that never comes.
The cache keeps the work, not the answer
Reading a prompt is work. For every token, the model computes key and value states that later tokens use to look back at earlier ones, and on a request with a long system prompt most of that work repeats on every call. Prompt caching saves those states for the prefix, the unchanged tokens at the start of a request. OpenAI's guide is explicit that its cache holds these tensors, not the text. When a later request opens with exactly the same tokens, the provider loads the saved states, bills them at the cached rate, and processes everything after the first difference at the normal rate.
"Exactly the same tokens" has two consequences. Position beats content: a timestamp in the first line of a system prompt changes the prefix at the first token, so every request misses, however many thousand tokens follow unchanged. And the match is literal, so a reworded instruction, a reordered tool list or a different image makes a new prefix. OpenAI caches automatically and still requires the whole rendered prefix to match, settings included.
Nothing about the answer is stored. A cached request generates a new response from the saved starting state, so temperature and sampling behave exactly as they would without the cache, and OpenAI's guide warns that identical requests are not guaranteed identical outputs. Two features with similar names work differently. Response caching stores a finished answer in your application and serves it again. Semantic caching serves a stored answer to a question that merely resembles an earlier one. Both are code you write and maintain, while prompt caching is a line on the provider's bill that changes the price of reading the prompt and nothing downstream of it.
What 174 API calls cost with the cache on
On September 14 we sent 30 support tickets, three times each, to Claude Sonnet 5 and GPT-5.6 Terra through OpenRouter, using the evidence kit behind our structured-output test. Every request carried the same long system prompt: an eight-sentence instruction plus a handbook that restates the rules at length. The Sonnet 5 requests marked that system prompt with a cache breakpoint. Terra got no marker, because OpenAI caches by default. One ticket tripped the gateway's prompt-injection filter on all six of its attempts, which left 174 completed calls with usage attached.
| Prompt caching | anthropic/claude-sonnet-5 (A) | openai/gpt-5.6-terra (B) |
|---|---|---|
| Rates per 1M: input / write / read | $2.00 / $2.50 / $0.20 | $2.00 / $2.50 / $0.20 |
| Call 1 tokens: written / read / uncached | 4,214 / 0 / 43 | 2,691 / 0 / 3 |
| Call 1 input billed (no cache) | $0.0106 ($0.00851), +24.7% | $0.00673 ($0.00539), +25.0% |
| Call 2 tokens: written / read / uncached | 0 / 4,214 / 43 | 0 / 2,691 / 3 |
| Call 2 input billed (no cache) | $0.00093 ($0.00851), −89.1% | $0.00054 ($0.00539), −89.9% |
| Calls that wrote to the cache | 1 of 87 (4,214 tokens) | 29 of 87 (3,481 tokens) |
| Calls that read from the cache | 86 of 87 | 86 of 87 |
| Token hit rate (cached ÷ input) | 97.9% (362,404 of 370,206) | 98.4% (230,822 of 234,564) |
| All calls: input billed (no cache) | $0.0902 ($0.7404), −87.8% | $0.0554 ($0.4691), −88.2% |
| Bill = tokens × list rates | 87 of 87 | 87 of 87 |
Tokens are counted by each provider's tokenizer. Billed is the gateway's reported prompt cost; no cache is the same prompt tokens at the uncached input rate. Output tokens are left out because caching does not change their price.
Read the first four rows as the bet in miniature. Sonnet 5's first call paid the $2.50 write rate on 4,214 tokens where an uncached call pays the $2 input rate, 24.7% more. Its second call read the same tokens at $0.20 per million and paid 89.1% less than an uncached call. After that, every call looked like the second. Across the run, input cost $0.0902 against $0.7404 without a cache.
The last row is the one to copy into your own monitoring. On all 87 completed calls per model, the charge the gateway reported equals written tokens at the write rate, plus read tokens at the read rate, plus the remainder at the input rate. If your bill does not reconcile that way, find out why before you trust any savings figure, including a provider's.
Terra's column shows the other design. From GPT-5.6 on, OpenAI's implicit mode puts a breakpoint at the end of the latest message, so Terra wrote each new ticket to the cache the first time it appeared: 28 small writes of 17 to 39 tokens after the first. Our run repeated every ticket three times, so those writes were read back, and their premium came to $0.0004 in all. Going by OpenAI's rule, a one-shot workload whose messages never repeat would pay the 25% premium on every new message and never collect it. Explicit mode exists for that case. Put one breakpoint after the shared prefix, and OpenAI bills whatever follows it at the plain input rate, with no write charge.
Providers also count tokens their own way. Our shared prefix came to 4,214 tokens on Sonnet 5 and 2,665 on Terra, so compare bills, not per-token prices.
And a longer prompt can be the cheaper one. The same day, we ran the short version of the prompt, the eight sentences alone, with no cache marker. On Sonnet 5 it averaged 782 input tokens and $0.00156 of input per call. The long cached version averaged 4,255 tokens and $0.00104. A prompt 5.4 times longer cost a third less to send. Terra's short prompt sat under OpenAI's 1,024-token caching minimum, and its cached long version cost 5% more per call than the short one.
Two limits apply. The usage fields are OpenRouter's normalized ones, not each provider's native response. And the run logged latency without being built to test it, so this post makes no claim about speed. Time to first token is its own measurement. The raw attempts and readout are downloadable:
- runs/2026-09-14-long-cached/attempts.jsonl · JSON Lines · 148.3 KB · sha256 c0d19dfe321a
- runs/2026-09-14-long-cached/readout.json · JSON · 3.3 KB · sha256 62b72c28d99e
- runs/2026-09-14-short/attempts.jsonl · JSON Lines · 147.3 KB · sha256 1763972b2ceb
Files are served as static downloads; if a download is unavailable, copy the visible checklist or try again. Nothing is collected or subscribed when you download.
Only OpenAI and Anthropic make you pay to write
| Provider | Minimum | Lifetime | Write | Read |
|---|---|---|---|---|
| OpenAI, GPT-5.6+ | 1,024 tokens | 30+ min after last use | 1.25× | 0.1× |
| OpenAI, GPT-5.5 | Varies | About 30 min to 24 h | None | Cached rate |
| Anthropic | 512–4,096 tokens | 5 min or 1 h | 1.25× or 2× | 0.1× or lower |
| Google Gemini | 4,096 tokens (3.x) | Explicit: 1 h default | Storage per hour | Cached rate |
| DeepSeek | Not stated | Hours to days | None | Cache-hit rate |
| xAI | Not stated | Evictable anytime | None | Cached rate |
OpenAI added a write charge with GPT-5.6
GPT-5.6 and later bill a cache write at 1.25 times the input rate and a read at 0.1 times. The write rate replaces the input rate for the tokens written rather than stacking on top of it, and OpenAI does the arithmetic itself: one write and one full reuse cost 1.35 times the plain price of the prefix, against 2 times without caching. GPT-5.5 and earlier models charge nothing to write, so on those models a miss costs nothing extra.
Lifetime is set with prompt_cache_options.ttl, whose only value is 30 minutes, counted from the latest write or reuse. The minimum is 1,024 visible tokens, and OpenAI's guide even works out when padding a shorter prompt up to the minimum pays: across ten requests, any prefix of 221 tokens or more. Cached state lives on individual machines, and traffic above about 15 requests a minute can overflow onto machines that lack it. From GPT-5.6, OpenAI routes cache traffic itself and prompt_cache_key only separates cache accounting between your customers. On earlier models, a stable key is how you keep related requests on the same machines.
Anthropic lets you pick the breakpoints and the lifetime
cache_control turns caching on in one of two ways. A single top-level field caches up to the last cacheable block and moves the breakpoint forward as a conversation grows. Or you place up to four breakpoints on specific blocks, which matters when parts of the prompt change at different rates. Five minutes is the default lifetime, refreshed at no cost on every hit, and a one-hour lifetime costs a 2× write instead of 1.25×. Reads cost 0.1 times input on most models, 0.05 times on Opus 5.5 and 0.025 times on Fable 5.1 and Mythos 5.1. Anthropic states the break-even itself: one read pays for a five-minute write, two for a one-hour write.
Minimums run from 512 tokens on Opus 5, Opus 5.5 and the Fable and Mythos 5.x models, through 1,024 on Sonnet 5 and Opus 4.8 and 2,048 on Opus 4.7, to 4,096 on Opus 4.5, Opus 4.6 and Haiku 4.5. Shorter prompts run uncached with no error, so the only evidence is in the usage: if cache_creation_input_tokens and cache_read_input_tokens are both zero, nothing was cached.
Google, DeepSeek and xAI cache on their own, without promises
Gemini 2.5 and newer cache implicitly by default, and Google describes that mode as carrying "no cost saving guarantee". Explicit caching guarantees the discount, but you create the cache, choose its lifetime (one hour unless you set another), and pay storage for every hour it exists: $4.50 per million tokens per hour on Gemini 3.1 Pro Preview and $0.50 on Gemini 3.8 Flash, a rate Google doubles on January 1, 2027. DeepSeek caches every request automatically on a best-effort basis, matches only whole stored prefixes, and clears idle entries within hours to days. xAI caches automatically too, keeps a conversation on the same server when you send x-grok-conv-id (or prompt_cache_key on its Responses API), and warns that eviction can cost you a hit. None of the three charges extra to write.
What caching costs on current models
| Model | Creator | Input, $/M | Cached input, $/M | Cached input costs |
|---|---|---|---|---|
| GPT-6 Astra | OpenAI | $10 | $1 | 10% of input |
| GPT-6 Sol | OpenAI | $2 | $0.2 | 10% of input |
| GPT-5.6 Terra | OpenAI | $2 | $0.2 | 10% of input |
| GPT-5.5 | OpenAI | $5 | $0.5 | 10% of input |
| Claude Fable 5.1 | Anthropic | $10 | $0.25 | 2.5% of input |
| Claude Opus 5.5 | Anthropic | $4 | $0.2 | 5% of input |
| Claude Sonnet 5 | Anthropic | $2 | $0.2 | 10% of input |
| Gemini 3.1 Pro | $2 | $0.2 | 10% of input | |
| Gemini 3.8 Flash | $0.75 | $0.075 | 10% of input | |
| DeepSeek V4.1 Flash | DeepSeek | $0.3 | $0.006 | 2% of input |
| Grok 4.7 | xAI | $2 | $0.5 | 25% of input |
Most rows read at a tenth of input. Fable 5.1, Opus 5.5 and DeepSeek V4.1 Flash go lower, and Grok 4.7 keeps the smallest discount in the table. Two numbers are missing from the table. The registry stores no write price, so the write multiplier comes from the rules above: 1.25 times the input column on GPT-5.6 and later and on Anthropic's five-minute cache, 2 times for Anthropic's hour. And Gemini's cached rate leaves out storage, which the next section prices.
Our pricing calculator prices a cached share of input at these rates. It adds no write premium, so for a workload that writes often on Anthropic or GPT-5.6, treat its figure as a floor. Per-provider detail, including batch and long-context rates, is on the OpenAI, Anthropic, Google, DeepSeek and xAI pricing pages, and how token pricing works covers the rest of the bill.
A write is a bet that pays after one read
Every cache bet has a fixed stake and a fixed payout, both in units of the prefix's normal input price. The stake is the write premium: 0.25 for a 1.25× write, a full 1.0 for a 2× write. Each reuse pays back the gap between the input and read rates, 0.9 at a 0.1× read. One reuse covers the smaller stake, and two cover the larger.
Take a 10,000-token prefix sent to Claude Sonnet 5 twice within five minutes, at its September 25 list price of $2 per million input tokens. Without a cache, the prefix costs $0.02 per call, $0.04 for both. With a five-minute cache, the first call pays $0.025 to write it and the second $0.002 to read it, $0.027 in all, 32.5% less. Buy the one-hour cache instead and the write costs $0.04, so two calls come to $0.042 and the cache loses money until a third call reads it.
The same arithmetic covers every provider. No write charge means GPT-5.5 and earlier, DeepSeek, xAI and Gemini's implicit cache. The 1.25× row is GPT-5.6 and later plus Claude's five-minute cache, and the 2× rows are Claude's one-hour cache.
| Cache rule | Stake | Payback per reuse | Reuses to come out ahead |
|---|---|---|---|
| No write charge | None | Input minus cached rate | Any |
| 1.25× write, 0.1× read | 0.25× input | 0.9× input | 1 |
| 2× write, 0.1× read | 1× input | 0.9× input | 2 |
| 2× write, 0.025× read (Fable 5.1) | 1× input | 0.975× input | 2 |
| Gemini 3.1 Pro Preview storage | $4.50/M per hour | $1.80/M | 3 per hour |
| Gemini 3.8 Flash storage | $0.50/M per hour | $0.675/M | 1 per hour |
Storage changes the question. A write premium is paid once, but storage is paid every hour, so an explicit cache on Gemini 3.1 Pro Preview needs three reads in each hour it lives, and a cache kept overnight for a morning batch pays for the night. Google lists two cache charges, the reduced rate on cached tokens and hourly storage, and the table counts both.
Six ways to pay for a cache you never read
Our run avoided every trap below by construction: a prompt far above both minimums, a prefix that never changed, one call at a time, and each ticket sent three times. Production traffic rarely gets all four.
- A prompt under the minimum. Nothing is cached, and Anthropic returns no error. Check the usage fields on the first call.
- A changing token near the top. A timestamp, user ID or reordered tool list makes every request a miss. Keep volatile content after the breakpoint and tools in a fixed order.
- Writes nobody reads. Implicit breakpoints on messages that never repeat, or a one-hour write read once, pay the premium for nothing. Use explicit breakpoints on GPT-5.6 and later, and the five-minute lifetime on Claude.
- Parallel fan-out. On Anthropic, a cache entry exists only once the first response begins, so requests sent before then miss. Send one request, wait for its first token, then fan out.
- Slow responses. Anthropic counts the lifetime from the start of the request, so a four-minute response leaves one minute of a five-minute cache. Use the one-hour lifetime for long generations.
- Eviction and routing. DeepSeek and xAI evict without notice, and OpenAI's per-machine caches can overflow at about 15 requests a minute. Treat the discount as likely, not certain, and measure it.
Two of the six cost real money rather than a rounding error. Parallel fan-out is the common one in agent systems on Claude, where an orchestrator sends several requests with the same context at once and every one of them pays full input. Writes nobody reads are the quiet one, because the bill looks normal and only the write-token count shows the waste. Both show up in the usage fields long before they show up in a monthly total.
Your hit rate is one division away
Every provider reports cached tokens in the response, each under its own name. Divide cached input tokens by total input tokens across a window of requests, and you have the token hit rate OpenAI tells customers to track. Moving between OpenAI endpoints does not reset it: when we ran the same prompts through Chat Completions and Responses, both read 99.7% of input tokens from the cache, and about one call in three read a prefix the other endpoint had just written.
| Provider | Read from cache | Written to cache |
|---|---|---|
| OpenAI | input_tokens_details.cached_tokens |
input_tokens_details.cache_write_tokens |
| Anthropic | cache_read_input_tokens |
cache_creation_input_tokens |
| Google Gemini | total_cached_tokens |
Separate create call |
| DeepSeek | prompt_cache_hit_tokens |
No write charge |
| xAI | prompt_tokens_details.cached_tokens |
No write charge |
| OpenRouter | prompt_tokens_details.cached_tokens |
prompt_tokens_details.cache_write_tokens |
Anthropic needs one adjustment. Its input_tokens counts only the tokens after the last breakpoint, so the denominator there is reads plus writes plus input_tokens. OpenAI's GPT-6 launch added a prompt caching dashboard and a prompt_cache_diagnostics field that names the reason for a miss, such as changed tools. Elsewhere, log a hash of the rendered prefix next to the hit rate, so a drop can be traced to the request where the prefix changed.
The number to watch is the hit rate on the prefix that carries your cost. Our run held 97.9% and 98.4% because nothing in it moved. If yours sits far below that, the prefix is changing, the traffic is too sparse for the lifetime, or requests are arriving in parallel, and the write premium is buying nothing.
Cache prices change at model launches, not on a calendar. GPT-5.6 introduced OpenAI's write charge, and Fable 5.1 cut its cache read to $0.25 per million from Fable 5's $1. Radar records published price and API changes for the models you declare, each with its source and date, so you can follow model changes instead of finding them in an invoice.
Frequently asked questions
01Is prompt caching the same as KV caching?
They share a mechanism. A KV cache holds the key and value states a model computes for each token, so it does not reprocess the whole prompt for every new token it generates. Prompt caching keeps those states for a repeated prefix after the request ends, so a later request can reuse them at a discounted price.
02How long does a prompt cache last?
It depends on the provider. OpenAI keeps caches for GPT-5.6 and later at least 30 minutes after the last write or reuse. Anthropic's default is five minutes, refreshed free on every hit, with a one-hour option at a higher write price. Gemini's explicit caches last one hour unless you set another lifetime. DeepSeek and xAI make no fixed promise.
03Is prompt caching worth it?
It is when a prefix longer than the provider's minimum repeats before the cache expires. A write priced at 1.25 times input pays for itself on the first reuse, and a 2× write on the second. It is not worth it for one-off prompts, prompts under the minimum, or, on Claude, parallel requests sent before the first response starts.
04Does prompt caching change the model's answer?
No. The provider reuses the computed state of the prompt's opening and then generates a fresh response, exactly as it would without the cache. OpenAI states that caching does not change how output tokens are generated. Identical requests can still return different answers, because temperature and sampling apply to a cached request as they do to any other.
05How do I turn on prompt caching?
On OpenAI, DeepSeek and xAI it is already on. Anthropic needs a cache_control field, set once at the top level of the request or on up to four content blocks. Gemini 2.5 and newer cache implicitly, and explicit caching means creating a cache object and referencing it. On GPT-5.6 and later, explicit mode lets you place the breakpoints yourself.
06Do cached tokens count toward rate limits?
OpenAI and Anthropic answer differently. OpenAI counts cached input tokens toward tokens-per-minute limits like any other input. Anthropic leaves cache reads out of the input-tokens-per-minute limit on most models, while writes and uncached input still count. On Claude, a high hit rate therefore leaves more of the limit for new input as well as cutting the bill.
