Prompt caching savings calculator

Enter a reusable prefix and the number of successful reuses after one cache write. Compare the full request costs with and without caching, including the suffix and output.

Inputs
The identical prefix written once, then fully read on each successful reuse.
9 reuses means 10 requests total. Count only hits before expiry under the chosen TTL policy.
Processed at the ordinary input rate on every request.
Use total billed output, including thinking tokens.
Blank uses the preset. For custom, enter every term. A write multiplier of 1.25 means the total write price, not a 125% surcharge.
Blank uses the preset. For custom, enter every term. A write multiplier of 1.25 means the total write price, not a 125% surcharge.
Blank uses the preset. For custom, enter every term. A write multiplier of 1.25 means the total write price, not a 125% surcharge.
Blank uses the preset. For custom, enter every term. A write multiplier of 1.25 means the total write price, not a 125% surcharge.
Blank uses the preset. For custom, enter every term. A write multiplier of 1.25 means the total write price, not a 125% surcharge.
Blank uses the preset. For custom, enter every term. A write multiplier of 1.25 means the total write price, not a 125% surcharge.

Results

Savings per cache cycle
$0.17
Without caching
$0.32
With caching
$0.15
Savings percentage
51.88%
Minimum reuses to break even
1 reuses (2 requests)
Applied caching terms (2026-11-14)
TermValue
Input / output per 1M tokens$2 / $10
Write / read multipliers1.25× / 0.05×
Minimum prefix512 tokens
TTL5 minutes
Requests in cycle10
  • One initial write and the entered number of successful full-prefix reads. TTL is a planning condition; this tool does not predict cache hits or expiration.
  • A negative saving means caching costs more. Equality counts as break-even, not a positive saving. A new write after expiry starts a new cycle.
  • Suffix and output costs are included in both totals. Storage fees, tool charges, taxes and regional premiums are excluded; custom terms model write/read billing only.

Results update as you type. The share link stores your inputs after the # in the address, which is not sent to our server, but anyone you send it to can read them.

Prices change often. We list the date we last checked each price; confirm on the provider’s official pricing page before you budget.

How it works

Use one cache cycle: an initial write followed by R successful reads of the same prefix before it expires. P is the prefix size, S the uncached suffix, O the billed output, A the input price and B the output price per million tokens. W and r are the total write and read multipliers. These billing categories follow the linked Anthropic and OpenAI caching guides.

N = R + 1 without cache = N × [(P + S) × A + O × B] ÷ 1,000,000 with cache = [P × A × (W + R × r) + N × (S × A + O × B)] ÷ 1,000,000 saving = without cache − with cache saving % = saving ÷ without cache × 100 minimum reuses = ceil((W − 1) ÷ (1 − r))

The break-even expression is derived by setting cached prefix cost no higher than ordinary prefix cost. It applies when the prefix is eligible, its ordinary cost is positive, W ≥ 1 and r < 1. Equality counts as break-even. A write multiplier of 1 needs zero reuses to tie; a read multiplier of 1 cannot recover a write premium. If the prefix is below the minimum, caching is not applied. Zero baseline cost has no defined savings percentage.

Astra presets model explicit-only caching. Set prompt_cache_options.mode: "explicit" and put prompt_cache_breakpoint: { "mode": "explicit" } on a supported content block immediately after the reusable prefix. Content after that breakpoint uses ordinary input pricing. The 12-hour retention option requires the Responses API. Implicit mode can write changing suffix content and is not modeled here; an unchanged prefix alone does not guarantee the assumed cache hits.

All terms are editable. Blank overrides use the preset; custom mode requires every term. Astra applies its long-prompt prices above 272,000 prefix-plus-suffix tokens, before any price override. TTL records the assumed retention policy; you supply successful reads, not elapsed request times. A changed prefix, missed cache or expired entry needs a separate cycle. This model excludes storage fees and assumes an unchanged suffix/output size across requests. No intermediate values are rounded. Money uses cents, except nonzero sub-cent amounts use three significant digits; percentages use up to two decimal places.

Worked examples

Nine reads after a short-lived write

Claude Sonnet 5.5: a 10,000-token prefix, 1,000-token suffix and 1,000 output tokens, with nine reuses, make ten requests. At $2 input and $10 output per million, no caching costs $0.32. A 5-minute write at 1.25× and reads at 0.05× cost $0.154 before display rounding. Savings are $0.166, or 51.875% (displayed as $0.17 and 51.88%). One reuse is enough to break even.

A one-hour write needs more reuse

Keep that same Sonnet workload but choose a one-hour write at 2×. One reuse means two requests: $0.064 without caching and $0.065 with caching, a $0.001 loss. Break-even requires ceil((2 − 1) ÷ (1 − 0.05)) = 2 reuses. With two reuses, the costs are $0.096 without and $0.078 with caching, saving $0.018.

Frequently asked questions

Does the reuse count include the initial request?
No. Nine reuses means one initial write plus nine cache reads: ten requests total. Each new write after expiry starts a new cycle.
Is a 1.25× write multiplier an extra 125% fee?
No. It is the total rate for tokens written to the cache. A 1.25× multiplier costs 25% more than ordinary input for that write. The calculator does not charge ordinary input again for those same tokens.
How short can a cached prefix be?
The selected Sonnet 5.5 and Fable 5.2 presets require 512 tokens on the Claude API; the selected Astra presets require 1,024 visible input tokens. Smaller prefixes get no caching saving here. Other models and platforms can have different minimums.
Does choosing a TTL guarantee every reuse hits?
No. TTL alone does not guarantee a cache hit. Routing and an identical eligible prefix also matter. Use observed successful reads from API usage when available. The calculator does not simulate refresh rules or request timing.
Why can savings be negative?
The initial write premium can exceed the savings from subsequent reads. A long TTL with few reads may cost more. Uncached suffix and output charges reduce the percentage saved on the total bill but cancel out of the prefix break-even calculation.
Can I model another provider?
Choose custom and enter its input/output prices, total write multiplier, read multiplier, minimum prefix and TTL. This supports write/read token billing with write multipliers at least 1 and read multipliers between 0 and 1. Providers that charge cache storage separately need an additional storage calculation.

Sources

Last reviewed 2026-11-14; next review due by 2026-12-14. The method is written out above so you can check our math.