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.
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?”
How cache reads and writes are priced
Two rates, not one. Both decide the curve.
~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).
~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.
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 hit | Fresh input | Cached input | Output | Total (USD) | Total (CHF) | vs no cache |
|---|---|---|---|---|---|---|
| 0% | $104.40 | $0.00 | $0.731 | $105.13 | CHF 84.63 | — |
| 50% | $52.20 | $4.35 | $0.731 | $57.28 | CHF 46.11 | −46% |
| 80% | $20.88 | $6.96 | $0.731 | $28.57 | CHF 23.00 | −73% |
| 90% | $10.44 | $7.83 | $0.731 | $19.00 | CHF 15.30 | −82% |
| 97% | $3.13 | $8.44 | $0.731 | $12.30 | CHF 9.90 | −88% |
| 99% | $1.04 | $8.61 | $0.731 | $10.39 | CHF 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).
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.