Understanding LLM API Cache Pricing: Why the List Price Increase Is Not the Whole Story
This article breaks down the pricing logic behind a recent LLM API price increase, focusing on how cache hit rates, input-to-output ratios, and prefix stability determine the actual bill. It explains the engineering basis of tiered cache pricing, provides a cost model with worked examples, and outlines practical prompt structuring, retrieval, observability, and architecture practices for controlling token costs.
1. The Setup: A Pricing Change That Looks Like a Blanket Increase
After a coding tool vendor launched its next-generation model, the most immediate reaction in developer communities was that it had become several times more expensive. Breaking the list price apart gives a more moderate conclusion than the headline, but the structural change matters more:
- Output: roughly 27 CNY per million tokens in the previous generation versus 100 CNY in the new one, close to 4x.
- Uncached input: roughly 6.5 CNY to 20 CNY, about 3x.
- Cached input: roughly 1.1 CNY to 2 CNY, about 2x.
The real change is not in the multipliers but in the ratios:
| Ratio | Previous generation | New generation | Change |
|---|---|---|---|
| Uncached input / cached input | ~6x | ~10x | Wider |
| Output / cached input | ~25x | ~50x | Wider |
In other words, the cached input tier rose the least while output rose the most. The vendor is using price as a lever to push one behavior hard: keep reusable prefixes in the cache and eliminate repeated computation.
2. Why Vendors Can Price This Way: Disaggregated Inference and Cache Reuse
This pricing only holds if the engineering side can genuinely achieve a high prefix reuse rate. A common industry approach splits inference into two stages: a prefill stage that processes the long input and a decode stage that generates tokens one by one. The two have very different demands on compute and memory bandwidth, and running them on the same GPU makes them compete for resources.
The value of disaggregated deployment is that the intermediate state produced by prefill (the key-value cache) can be managed explicitly and reused across requests. In coding scenarios with long system prompts, fixed tool definitions, and repeated question answering over long documents, a hit rate above 90% is engineering-achievable. The vendor passes the compute saved here back to the “hit” tier while recovering margin through expensive output. This is not a price increase; it is a redrawing of who subsidizes whom.
3. A Quantitative Estimate: One Model, Two Very Different Bills
Define a blended unit cost formula:
Blended cost = (input-output ratio × effective input price + 1 × output price) / (input-output ratio + 1)Effective input price = hit price × hit rate + miss price × (1 - hit rate)
Scenario A: enterprise long-context agent, input-output ratio 20:1, hit rate 90%
Effective input price = 2 × 0.9 + 20 × 0.1 = 3.8 CNYBlended cost = (20 × 3.8 + 100) / 21 ≈ 8.4 CNY per million tokens
Scenario B: low-frequency individual developer, input-output ratio 5:1, hit rate 20%
Effective input price = 2 × 0.2 + 20 × 0.8 = 16.4 CNYBlended cost = (5 × 16.4 + 100) / 6 ≈ 30.3 CNY per million tokens
The two differ by roughly 3.6x. The conclusion is clear: for high-reuse customers the list price increase is effectively a discount, while for casual users who change the prompt every time it is the full price or a premium. Your bill is determined by your architecture, not by the list price.
4. Four Variables That Determine Your Bill
- Cache hit rate: the only first-order lever, sliding the effective input price anywhere between 2 and 20 CNY.
- Input-output ratio: the larger the ratio, the more input-side optimization is amplified and the more the high output price is diluted.
- Prefix stability: whether the system prompt, tool schemas, and few-shot examples are byte-for-byte identical.
- Session granularity: short sessions and frequently created new contexts keep triggering misses.
5. Practices You Can Apply
(1) Layer the prefix and put the stable part first
[Stable layer] System role + safety policy + tool definitions + output format constraints[Semi-stable layer] Domain knowledge, coding standards, project structure notes[Volatile layer] User query, retrieved snippets, timestamps, random IDs
Reversing the order invalidates the whole cache. Cache matching is a token-by-token prefix comparison, so once volatile content is placed first, everything after it is billed as a miss.
(2) Move volatile fields to the end or drop them
def build_prompt(system: str, tools: str, query: str, req_id: str) -> str:# Put volatile request IDs and timestamps at the end, or record them via a logging service instead of the promptreturn f"{system}\n{tools}\n{query}\n<req>{req_id}</req>"
(3) Use retrieval instead of an ever-growing context
Chunk long documents into object storage and a vector retrieval pipeline, and inject only the snippets actually needed for the current request. This raises the hit rate and lowers total input volume.
(4) Control output length
Output is the most expensive tier. Constrain max tokens, ask for short structured answers, and split long-form generation into multiple small outputs. The payoff is immediate.
(5) Observability first
Instrument the call path to separately track cached and uncached input volume, output volume, and cache hit rate, with monitoring and alerting thresholds. Without this data, any cost optimization is guesswork.
(6) Architecture-level fallbacks
Merge requests for offline tasks that are latency-insensitive and batchable; use container platform elastic scaling for high-concurrency scenarios to avoid paying for peak capacity year-round.
6. Common Mistakes
- Choosing a model on list price alone: ignoring the hit rate can throw the budget off by several times.
- Concatenating timestamps, random numbers, or UUIDs into the prompt: a single point breaks the entire cache.
- Blindly expanding the context window: the uncached input price is one of the most expensive tiers.
- Treating the cache as a correctness dependency: the cache only affects cost and latency; business correctness still requires validation and retries.
7. Conclusion
The essence of this price adjustment is shifting cost responsibility from the “model” to the “way you call it.” For developers, cache hit rate, prefix stability, and input-output ratio are engineering variables you control yourself. Govern your prompt structure and build observability first, then discuss model selection and budget. In a tiered pricing market, architecture capability is negotiating power.
