⚡ Prompt Cache Break-Even
Prompt caching is the only feature in the LLM stack that can make a bill go up. Vendors advertise a 90% discount on cached input, and that number is real — but it is the price of a read. A write is billed above the normal input rate, and if no request arrives before the cache expires, every single request pays the write premium and collects nothing. This calculator takes your request spacing and tells you which side of that line you are on, and which lifetime tier you should actually be buying.
📐 Your Request Shape
The two fields that decide the answer are the average gap between requests that share the same prefix, and the cache lifetime you selected. Length matters far less than people expect, because every term scales with it.
The gap is the interval between requests that reuse the same prefix — not your overall request rate. A service handling 20 endpoints at 10 requests per second each has a 0.5 second gap on every one of them, which is a very different problem from 10 requests per second spread across 20 prefixes.
The Feature That Bills You for Trying
Every other cost lever in this stack is monotonic: fewer tokens cost less, a cheaper model costs less, a shorter answer costs less. Caching is not monotonic. Turning it on moves two prices at once, and in the wrong direction for one of them. A write is billed at a multiple of the base input rate, a read is billed at a fraction of it, and the multiple only gets repaid if something reads the cache back before it expires.
The expiry is the part that gets lost in the marketing. A five-minute lifetime means the cache is discarded five minutes of inactivity after the last read, so a steady stream of requests keeps it alive indefinitely — that is the case the vendor benchmarks. But a workload that calls the same prefix every seven minutes never keeps it alive, because seven is greater than five. Every request writes, none reads, and the bill goes up by the write premium. Nothing warns you. The request succeeds, the answer is correct, the usage object even shows cache tokens being created, which looks like the feature is working.
This is why the calculator asks for your gap before anything else. The gap is a property of your application, not of the model, and it is the only input that can flip the sign of the result.
The Arithmetic, Without the Marketing
Model a cache lifetime as a window that holds n requests reusing the same prefix. The first one writes, the following n − 1 read, and the window then expires and the cycle repeats. Effective cost per request, expressed as a multiple of the uncached input price:
Those two break-even counts are worth internalising because they are small and absolute. Two reuses justify a five-minute cache. Three justify a one-hour cache. Below that the feature is not neutral, it is negative, and the penalty is exactly the write premium: 25% with the short tier, 100% with the long one.
Note what is not in the formula: the length of the prefix. Every term scales linearly with it, so a long prefix does not improve the ratio, it only multiplies the absolute dollars on both sides of the comparison. Short prompts are worse for a different reason — they may fall under the provider minimum and never be cached at all — but length is not what determines whether caching pays.
Choosing the Tier Is a Spacing Question
The tiers differ by a factor of two in write cost and a factor of twelve in lifetime, so the right answer depends almost entirely on how far apart your requests are. The table below holds the multipliers fixed at the published 1.25× / 0.10× and 2.00× / 0.10× and assumes enough daily volume that the window is never volume-limited.
| Average gap | 5-minute tier | 1-hour tier | Verdict |
|---|---|---|---|
| 30 seconds | 0.22× · −78.5% | 0.12× · −88.4% | Either pays; the long tier wins |
| 1 minute | 0.33× · −67.0% | 0.13× · −86.8% | Either pays; the long tier wins |
| 2 minutes | 0.68× · −32.5% | 0.16× · −83.7% | Either pays; the long tier wins clearly |
| 4 minutes | 1.25× · +25.0% | 0.23× · −77.3% | Short tier is a pure loss |
| 10 minutes | 1.25× · +25.0% | 0.31× · −68.9% | Short tier is a pure loss |
| 30 minutes | 1.25× · +25.0% | 1.05× · +5.0% | Both tiers lose; leave caching off |
| 1 hour or more | 1.25× · +25.0% | 2.00× · +100% | Both tiers lose badly |
The single most expensive configuration in that table is the one most teams ship by default: the five-minute tier on a workload whose requests arrive four to thirty minutes apart. It is not a small error. It is a 25% surcharge on every cached token, applied silently, for as long as the configuration stays in place.
The 30-minute row is the other useful one. At that spacing the one-hour cache is also a loss, because two requests per window cannot repay a 2× write. When both tiers show a penalty, the correct move is to disable caching entirely — not to pick the less bad tier.
Where the 90% Actually Lands
Even a correctly configured cache does not cut your bill by 90%, and the reason is structural rather than a hidden fee. Caching applies to the stable prefix only. Everything after the last cache breakpoint — the user's question, retrieved documents, the conversation tail, the image payloads — is billed at the full input rate on every request and cannot be cached, because it is different each time.
So the discount on the bill is the discount on the prefix multiplied by the prefix's share of input tokens. A 70% prefix discount on a request that is 89% prefix becomes a 63% saving on the input line. On the total bill it is smaller still, because output tokens are untouched and output is the expensive side. If your workload is output-heavy, caching has less room to work with than the headline suggests, and the calculator reports that weighted number as whole input bill rather than quoting the headline.
This is the same pattern that shows up across this site: the number a vendor advertises is correct for the quantity the vendor named, and wrong for the quantity you are trying to budget. The fix is not scepticism, it is arithmetic — apply the discount to the base it actually covers.
The Silent Failure Below the Minimum
Each model has a minimum cacheable length, ranging from a few hundred tokens to several thousand depending on generation. Below it, the request runs uncached at full price and returns no error, no warning and no status code. The response is indistinguishable from a successful cache write except in one place: the usage object reports zero for both cache creation and cache read.
This is the failure mode that wastes the most engineering time, because the observable behaviour is "caching is enabled and nothing changed". Teams spend days tuning breakpoints and restructuring prompts when the actual problem is that the prompt is 800 tokens against a 1,024-token floor. The calculator carries the floor as an input so the result collapses to a 1.00× multiplier and a 0% saving when it is violated, which is the honest answer, instead of showing a large theoretical discount that will never appear on an invoice.
Two related details are worth knowing. First, prefix matching is exact and runs backwards from the breakpoint, so a timestamp, a request ID, or a shuffled tool list at the top of the prompt invalidates everything after it. Second, the match is prefix-based, not block-based: inserting one token near the front discards the entire cache even if the rest of the content is identical. Cache-friendly prompts are therefore built with the most volatile content last, which is often the opposite of how they were originally written.
What To Do With the Answer
If the calculator shows a penalty, there are only three real options, and they are ordered by effort rather than by payoff. Turning caching off is free and stops the bleed immediately. Moving to a longer tier fixes every case where the gap sits between the two lifetimes, which is the most common shape in production because agent loops and human-in-the-loop approvals naturally pause for a few minutes. Restructuring the prompt so that the cacheable prefix is longer and more stable is the option with the largest ceiling and the most work.
If it shows a saving, the next question is whether the saving survives your deployment cadence. A prompt that is edited and redeployed twice a day invalidates the cache twice a day, and the warm-up cost is paid again on the first request of every cycle. For a few hundred requests per day that cost is noise; for a prefix serving thousands of requests per hour it is worth measuring separately.
One lever this page deliberately does not price is throughput. On most providers a cache read does not count against the input-tokens-per-minute limit, so a high hit rate buys headroom as well as money — which can matter more than the bill if you are rate-limited during peak. That is a capacity argument, not a cost one, and mixing the two into a single number would hide both.
Pricing Basis, Sources & Assumptions
This page does not assert vendor prices. The multipliers and the input rate are inputs you control, pre-filled with the published structure so the arithmetic is legible. Your contract may differ, and if it does, your numbers are the ones that matter.
| Pricing input | Basis used on this page |
|---|---|
| Source | The multiplier structure — a cache write priced above the base input rate, a cache read priced well below it, and a short versus long lifetime with different write costs — follows the Anthropic pricing documentation and the OpenAI API pricing page, both re-read on . Preset multipliers (1.25×, 2.00×, 0.10×) reflect that published structure; they are starting points, not a quote, and are not used until you select a preset or type your own. |
| Region | Not applicable — first-party API pricing is global per provider. Regional and multi-region endpoints on cloud marketplaces can carry a premium, and if you buy through one, use that invoice rate. |
| Currency | USD, as entered by the user |
| Last checked | — the existence of a write premium, a read discount, and two lifetime tiers was re-confirmed against provider documentation on this date. No rate is asserted. |
Modelling assumptions
- Uniform spacing. Requests are treated as evenly spaced at the gap you enter. Real traffic is bursty, which raises the hit rate above this estimate — a burst of ten requests in thirty seconds behaves like a fifty-second gap, not a ten-minute one. The model is deliberately the pessimistic case for a given mean gap.
- One write per window. The first request in each window writes and the rest read. Workloads that keep a cache alive continuously by touching it just inside the TTL will do slightly better, because the touch refreshes the lifetime without a new write.
- Cost is input-only. Output tokens are not modelled, because caching does not change them. The whole-bill figure refers to the input line, not to your total invoice.
- Excluded. Retrieval and storage fees on providers that bill cache storage by the hour, batch discounts, negotiated committed-use rates, the throughput benefit of cache reads not counting against rate limits, and provider-specific eviction under memory pressure.
- Month length. Billed days is an input, defaulting to 30. Calendar months range from 28 to 31, a ±10% swing on any monthly figure.