LLM API Price Increases Explained: Cache Hit Rate as a Cost Lever
A new three-tier LLM pricing structure—output, input cache miss, and input cache hit—makes headline price increases less important than cache hit rate and input/output ratio. This article explains why cache hits become a pricing denominator, shows how to calculate blended costs with Python examples, identifies the break-even hit rate, and lists practical engineering measures such as prompt layering, prefix cleanup, output governance, semantic caching, tiered routing, and cost observability.
LLM API Price Increases Explained: Cache Hit Rate as a Cost Lever
Introduction: The Unit of Discussion Has Changed
In the past two years, discussions about LLM pricing have mostly centered on one metric: cost per million tokens. In chat-style interactions, a single Q&A exchange usually involves only dozens to a few thousand tokens. Even significant changes in the absolute price per token may feel negligible to end users, because the total cost often amounts to no more than a meal or a coffee.
Agents change that calculation. An agent that can independently decompose tasks, repeatedly call tools, and explore multiple branches may involve thousands of tool-call steps and hundreds of thousands of tokens in a single task. If hundreds of agents run in parallel for several days, the cost shifts from a one-off API call to a continuous operating expense. At that point, changes in any price tier are amplified by context length and task steps into differences of one or more orders of magnitude.
This is why newer-generation models no longer publish only input and output prices. Instead, they split pricing into three tiers: output, input cache miss, and input cache hit. This is not a pricing trick. It reflects a more explicit alignment with the real cost structure of inference.
The following table shows illustrative tiered prices, in CNY per million tokens:
| Billing tier | Previous generation (illustrative) | New generation (illustrative) | Change factor |
|---|---|---|---|
| Output | 27 | 100 | ≈3.7x |
| Input, cache miss | 6.5 | 20 | ≈3.1x |
| Input, cache hit | 1.1 | 2 | ≈1.8x |
1. What Changed Is Not the Unit Price, but the Ratios Between Tiers
If you only look at the absolute increase, the conclusion may seem simple: prices have risen across the board by three to four times. Comparing tiers pairwise, however, reveals much more useful information:
- Input cache miss ÷ input cache hit: increased from roughly 6x to about 10x.
- Output ÷ input cache hit: increased from roughly 25x to about 50x.
These ratio changes show one thing: the new pricing reallocates cost toward requests that are poor at reusing cached computation. The cache-hit tier increases most gently, by less than 2x. The output tier increases the most sharply. The cache-miss input tier sits in the middle.
In other words, vendors are no longer using a single average price to cover all customers. They have written “whether you can reuse existing intermediate computation” directly into the price structure. For enterprise customers that run the same system prompts over long periods and have highly reusable prefixes, this behaves like a discount. For individual developers whose prompts differ each time and whose reuse rate is low, the effective cost may approach or even exceed the old price.
This also points to the right way to evaluate a new pricing structure: do not look only at list price; look at the structure. Do not look only at unit price; look at hit rate.
2. Why Cache Hits Become the Denominator of Pricing
To understand this tier design, we need to return to the two main phases of inference.
Prefill is compute-intensive. It runs the entire prompt through the model in parallel to produce all intermediate states needed for the first output token. This stage can reduce per-unit compute cost through high parallelism.
Decode is autoregressive, token-by-token generation. For each new token, the model must read the KV cache for all previous tokens and perform one full-model parameter read. The bottleneck is often not compute but memory bandwidth and memory capacity. The key issue is that KV cache memory usage grows approximately linearly with sequence length, and the amount of cache read during each decode step also grows linearly with length. When the context is very long, or when attention implementations involve quadratic or recomputed terms, some overhead can rise superlinearly.
The essence of a cache hit is this: if the prefix of the current request is exactly identical to the prefix of a previous request—for example, the same system prompt, the same long document, or the same tool definitions—the KV cache for that prefix can be reused directly, and the entire prefill stage for that portion can be skipped. The savings are real: compute, memory bandwidth, and time to first token (TTFT), not merely an accounting discount.
Making this reuse reliable in production usually requires several supporting capabilities. Common industry practices include:
- Disaggregated inference architecture: separate prefill and decode into different resource pools, allowing each to scale according to its own bottleneck characteristics.
- KV cache pooling and tiered storage: keep hot cache in GPU memory and host memory, move cold cache to shared storage, and organize layers by hit frequency.
- Cross-request and cross-session scheduling: route requests with identical prefixes to nodes holding the relevant cache, and set reasonable cache retention times.
- Prefix fingerprinting and consistency checks: use byte-level hashing to identify reusable prefixes and avoid ineffective reuse caused by content that looks similar but is not identical.
There are public cases in coding-related scenarios where prefix cache hit rates exceed 90%. This is the confidence level behind pricing structures that can push the cache-hit tier down to roughly one-tenth of the miss tier.
3. Doing the Math: The Same Model Can Have More Than a 3x Cost Difference
Calculating blended cost is not complicated. The core idea is to first compute the input-side unit price as a hit-rate-weighted expectation, then convert it into an overall unit price according to the input/output ratio.
Let the input hit rate be h, the cache-miss input price be p_miss, the cache-hit input price be p_hit, the output price be p_out, and the input/output ratio be r = tokens_in / tokens_out.
Effective input price = h * p_hit + (1 - h) * p_missBlended total price = (r * effective input price + p_out) / (r + 1)
The following Python function turns this calculation into reusable logic for capacity planning and cost estimation:
from dataclasses import dataclass@dataclass(frozen=True)class PriceTier:"""List prices per million tokens."""out: floatin_miss: floatin_hit: floatdef blended_in(self, hit_rate: float) -> float:if not 0.0 <= hit_rate <= 1.0:raise ValueError("hit_rate must be between 0 and 1")return hit_rate * self.in_hit + (1 - hit_rate) * self.in_missdef blended_total(self, hit_rate: float, io_ratio: float) -> float:"""Blended price adjusted by input/output token ratio."""if io_ratio <= 0:raise ValueError("io_ratio must be greater than 0")return (io_ratio * self.blended_in(hit_rate) + self.out) / (io_ratio + 1)NEW_GEN = PriceTier(out=100.0, in_miss=20.0, in_hit=2.0)PREV_GEN = PriceTier(out=27.0, in_miss=6.5, in_hit=1.1)# Scenario A: enterprise coding agent with long context and high prefix reusescene_a = dict(hit_rate=0.90, io_ratio=20.0)# Scenario B: individual developer with short sessions and different promptsscene_b = dict(hit_rate=0.20, io_ratio=5.0)for name, cfg in (("Scenario A", scene_a), ("Scenario B", scene_b)):cost = NEW_GEN.blended_total(**cfg)print(f"{name}: input {NEW_GEN.blended_in(cfg['hit_rate']):.1f} CNY, "f"blended {cost:.1f} CNY per million tokens")
Using these values:
- Scenario A: enterprise agent: effective input price ≈
2 × 0.9 + 20 × 0.1 = 3.8CNY; blended total ≈(20 × 3.8 + 100) / 21 ≈ 8.4CNY per million tokens. - Scenario B: individual developer: effective input price ≈
2 × 0.2 + 20 × 0.8 = 16.4CNY; blended total ≈(5 × 16.4 + 100) / 6 ≈ 30.3CNY per million tokens.
For the same model and the same list prices, the unit cost in Scenario A is only about one-third of Scenario B. The high output price is a shared burden. What really separates the two scenarios is the combined effect of cache hit rate and input/output ratio.
From this, two operational conclusions are worth remembering:
- The higher the input/output ratio, the larger the leverage from caching. In long-context scenarios such as codebase analysis, very-long-document summarization, and multi-turn tool calls,
rmay reach 10 to 50. In these cases, input cost dominates the total, and a drop in hit rate from 0.9 to 0.5 can double the blended unit price. - Output-heavy scenarios are not rescued by caching. When
ris close to 1, for example in content generation or long-form writing, the blended price becomes highly sensitive top_out, and the benefit of optimizing cache hit rate is diluted. These scenarios should prioritize output-length governance and model-tier routing rather than focusing solely on prefix reuse.
Next, we can solve for the break-even hit rate. If you want the new-generation blended unit price to be no higher than the previous-generation cost in the same scenario, the following condition must hold:
def required_hit_rate(prev: PriceTier, curr: PriceTier,io_ratio: float, prev_hit: float) -> float:"""Minimum hit rate for the current tier to stay at or below previous cost."""prev_cost = prev.blended_total(prev_hit, io_ratio)return (prev_cost * (io_ratio + 1) - curr.out- io_ratio * curr.in_miss) / (io_ratio * (curr.in_hit - curr.in_miss))
In practice, this function can serve as a pre-purchase evaluation threshold. The hit rate it returns is the KPI that your engineering implementation must achieve. If your architecture cannot reach it, the price increase is real and is not offset by the vendor’s “discount.”
4. Why Agents Force a Pricing Reset
Returning to the supply side, long-horizon agents put pressure on inference infrastructure at a completely different scale from chat applications:
- GPU memory usage scales linearly with concurrency and context length: when hundreds of agents run in parallel, KV cache capacity rather than compute becomes the primary bottleneck and directly determines how many concurrent requests a GPU can support.
- The lifetime of KV cache is extended: a task running for five days with hundreds of thousands of tokens cannot simply discard intermediate states. Retaining, migrating, and persisting cache all add overhead.
- Decode-stage bandwidth is consumed repeatedly: thousands of tool-call steps mean thousands of decode processes, and each step requires rereading the context.
- Failure retries and branch exploration: agent exploratory behavior can multiply ineffective tokens, and this cost must be covered by an appropriate pricing tier.
If the old price structure were used for these workloads, the inference side would effectively operate at a loss. This is the fundamental reason the industry is collectively moving toward pricing layers based on reuse capability.
5. A Practical Optimization Checklist for Developers
Since the new pricing structure assigns weight to hit rate, the engineering optimization space becomes clear.
1. Layer prompts and put stable content first
Order matters. If the order is wrong, caching becomes useless. A recommended four-part structure is:
[Fixed prefix] System prompt + role constraints + output format rules[Tool definitions] Tool/function schemas and descriptions (change very rarely)[Semi-stable block] Project conventions, coding standards, long documents, domain knowledge[Frequently changing] Current user message, retrieved snippets, timestamp, session ID
The principle is: the lower the change frequency, the earlier the content should appear. Once segment boundaries are fixed, do not adjust them. Inserting a dynamic field in the middle invalidates all content after it.
2. Remove hidden variables from the prefix
Common pitfalls include current timestamps, random request IDs, session identifiers, log summaries, unfixed sort results, dictionary iteration order, and inconsistent whitespace or line breaks in templates. These seemingly harmless fields can change the prefix hash every time and reduce cache hits to zero. It is worth adding an automated CI check that compares the hashes of two consecutively constructed prompts for the same business scenario to ensure the prefix is exactly identical.
3. Govern output length
The output tier is the most expensive tier and cannot be cached. Useful techniques include requiring structured output with JSON Schema constraints, limiting explanatory text, making detailed explanations optional, and converting long-form generation into segmented streaming output with prefix reuse.
4. Use retrieval and semantic caching to eliminate repeated prefixes
In multi-tenant scenarios, many requests share the same background material. Such content can be turned into independent reusable segments, or a semantic cache layer can be introduced. For highly similar requests, the system can return cached results directly and bypass inference. The granularity, retention time, and invalidation policy of the cache must match business consistency requirements. Scenarios with strong real-time requirements should use shorter TTLs.
5. Batch processing and tiered routing
Split tasks by latency requirements: route online interactions to high-priority small models, send offline batch processing to large asynchronous queues, and schedule non-urgent long-horizon tasks during periods with spare capacity. Combined with model-tier routing—simple tasks to small models, complex tasks to flagship models—this often yields greater savings than merely compressing prompts.
6. Build cost observability
This is the easiest item to overlook and one of the most important for long-term cost control. At minimum, record the following for each request: input tokens, cached tokens, output tokens, hit rate, whether cache was invalidated, per-request cost, and cumulative budget consumption. Use these metrics to connect monitoring, alerting, and logging services, set budget thresholds, and trigger alerts for abnormal spikes. Further, build a cost dashboard and break down cost by business line, tenant, model, and scenario.
A minimal metric set:
COST_METRICS = {"tokens.input": "Total input tokens","tokens.cached": "Input tokens served from cache","tokens.output": "Output tokens","cache.hit_rate": "Hit rate = tokens.cached / tokens.input","cost.per_request": "Blended cost per request","cost.budget_used": "Budget usage ratio for alerting",}
With the cache.hit_rate curve, you can determine whether prompt layering actually works. Without it, optimization is mostly guesswork.
7. Do not sacrifice quality for savings
Two directions deserve attention. First, caching may conflict with freshness. Answers involving real-time data should not hit stale cache. Second, the relationship between context expansion and quality is nonlinear. Longer context is not automatically better. Position bias and attention dilution can bury key information. Every optimization change should be paired with a regression evaluation set to verify that accuracy and tool-call success rate do not degrade while tokens are reduced.
Conclusion
At first glance, the tiered pricing of newer-generation models looks like a three- to fourfold price increase. In substance, it makes the cost structure explicit: vendors price reusable intermediate computation very cheaply, while pricing non-reusable real-time computation more expensively.
The implications differ sharply for two types of users. For enterprise agent workloads that can maintain cache hit rates around 90%, have high input/output ratios, and use strictly reusable prefixes, the effective unit cost may actually decrease. For individuals with fragmented prompts and low reuse rates, the outcome is closer to the original price, or even higher.
Rather than obsessing over the rise or fall of list prices, it is better to do three things: calculate your input/output ratio and real hit rate, use the break-even hit-rate formula to judge whether the new price is worthwhile, and turn prompt layering, prefix cleanup, output governance, batch scheduling, and cost observability into engineering standards. As agents take over long-horizon tasks, cost optimization capability itself becomes a core engineering capability. It determines whether your system can continue running sustainably in real business environments.
