Skip to content
llm-spend
GitHub
Deep dive · case study

The bill that fell 86% without changing the model

Prompt caching is the biggest lever on real agentic coding costs, usually bigger than which model you pick. Here’s the arithmetic.

$12.42
Same task, cache off (CHF 10.00)
$1.74
Same task, 97% cache hit (CHF 1.40)
97%
Cache-hit rate that produced it
86%
Bill reduction, model unchanged
What happened

A 97% cache-hit rate did the work

The same agentic coding task ran twice against the same model. Priced naively at the flat input rate it would have cost $12.42 / CHF 10.00. Actual billed cost, at a measured 97% cache-hit rate, was $1.74 / CHF 1.40.

Nothing about the model changed. 97% of the input tokens (the stable prefix of system prompt and codebase that repeats every turn) came from cache instead of being re-billed in full. So the first question about an agentic workload isn’t “which model?” but “what’s your hit rate, and does this tier even have a cache meter?”

The mechanism

How cache reads and writes are priced

Two rates, not one. Both decide the curve.

Cache read

~10% of the input price

Reusing a cached prefix costs about a tenth of fresh input. Claude reads run ~10% of input; Azure’s published cache meter lands nearby (DeepSeek V4 Pro ~$0.145 vs $1.74 fresh, ~91.7% off).

Cache write

~1.25× the input price, once

Writing a prefix into cache costs a one-time premium, ~1.25x input on Claude and on GPT-5.6. It’s amortized across every later read, so a prefix reused many times pays the write once and banks the ~90% discount.

Caching wins when a large context is reused: a stable system prompt and codebase re-sent across dozens of turns, exactly where costs otherwise spiral.

The curve

Workload cost vs cache-hit rate

The same 60M input / 210K output workload against DeepSeek-V4 Pro Global (published Azure cache rate $0.145/M). Watch the total collapse as the hit rate climbs.

Cache hitFresh inputCached inputOutputTotal (USD)Total (CHF)vs no cache
0%$104.40$0.00$0.731$105.13CHF 84.63
50%$52.20$4.35$0.731$57.28CHF 46.11
−46%
80%$20.88$6.96$0.731$28.57CHF 23.00
−73%
90%$10.44$7.83$0.731$19.00CHF 15.30
−82%
97%$3.13$8.44$0.731$12.30CHF 9.90
−88%
99%$1.04$8.61$0.731$10.39CHF 8.36
−90%

Cache rate for V4 Pro is published in Azure’s retail catalog and reconciles to billing exports. At a 99% hit rate this workload drops 90% versus no caching ($105.13$10.39).

The punchline

Caching beats model choice

On this workload, DeepSeek-V4 Pro at a 90% cache-hit rate costs $19.00. Compare models using the blended cost at your observed cache-hit rate, not their headline input price: a model with a slightly higher fresh-input rate can still be cheaper once a stable prompt and codebase are repeatedly reused.

Before you downgrade a model to save money, check whether the tier has a cache meter and what your real hit rate is. The lever is usually caching, not the model. See the interactive calculator to test your own numbers, or the verification method for finding an undocumented cache rate.