LLM API Pricing: How Cache Hit Rates Reshape the Real Cost
Higher LLM API prices do not affect every workload equally. Using two pricing tiers and contrasting usage scenarios, this article explains how cache hit rates and input-to-output ratios determine effective token costs, why providers price cached inputs differently, and how developers can optimize prompts, context, and model routing to control spending.
From List Prices to Effective Costs: The Economics of Caching
A recent pricing change for a new generation of a major large language model sparked debate. Output pricing rose from RMB 27 to RMB 100 per million tokens—nearly a fourfold increase. Uncached input pricing increased from RMB 6.5 to RMB 20 per million tokens, roughly tripling. Cached input pricing, meanwhile, rose more moderately, from RMB 1.1 to RMB 2.
These figures appear to describe a straightforward, across-the-board price increase. But list prices alone do not tell developers how much their workloads will actually cost.
The pricing structure also reflects a shift in how inference costs are allocated. Its central lever is cache hit rate: the share of input tokens that can be served from reusable cached context rather than processed from scratch.
All prices below are expressed in RMB per million tokens, retaining the currency used in the original pricing comparison.
The Pricing Ratios Reveal a Structural Change
The relationships between the price tiers are as important as the headline increases.
Under the previous pricing structure, uncached inputs cost approximately six times as much as cached inputs:
6.5 / 1.1 ≈ 5.9
Under the new structure, that ratio reaches ten:
20 / 2 = 10
The ratio between output pricing and cached input pricing also increases, from approximately 25 to 50:
Previous generation: 27 / 1.1 ≈ 24.5
New generation: 100 / 2 = 50
In other words, uncached processing becomes more expensive relative to cache reuse, while cached inputs receive a larger relative discount.
This structure aligns with an emphasis on inference efficiency. In the long-context scenario described here, a disaggregated inference architecture is associated with cache hit rates above 90%. At sufficiently high hit rates, providers can offer a low cached-input price to attract workloads with frequent context reuse, while charging more for uncached inputs to cover cold-start processing and fresh computation.
The result is not simply a higher price per token. It is stronger pricing differentiation between reusable and newly processed context.
Two Workloads, Two Very Different Cost Profiles
To understand effective costs, consider two contrasting usage patterns.
Enterprise Agent: High Context Reuse
Assume an enterprise agent repeatedly uses a fixed system prompt and substantial portions of user conversation history. Its input-to-output token ratio is 20:1, a pattern associated with long-context coding agents, and its input-token cache hit rate is 90%.
Its effective input price is:
Effective input price = (2 × 0.9) + (20 × 0.1)
= 1.8 + 2 = RMB 3.8 per million input tokens
With output priced at RMB 100 per million tokens, the blended cost across all consumed input and output tokens is:
Blended cost = [(20 × 3.8) + (1 × 100)] / 21
= (76 + 100) / 21
≈ RMB 8.4 per million total tokens
The high output price still matters, but input tokens dominate this workload, and most of them receive cached-input pricing.
Independent Developer: Low Context Reuse
Now consider an independent developer whose requests contain different prompts and rarely reuse a common prefix. Assume a cache hit rate of 20% and an input-to-output ratio of 5:1.
The effective input price becomes:
Effective input price = (2 × 0.2) + (20 × 0.8)
= 0.4 + 16 = RMB 16.4 per million input tokens
The blended cost is:
Blended cost = [(5 × 16.4) + (1 × 100)] / 6
= (82 + 100) / 6
≈ RMB 30.3 per million total tokens
The enterprise agent’s blended unit cost is approximately one-third-and-a-half of the independent developer’s cost, or about 3.6 times lower.
These are different workload profiles, not a controlled comparison of caching alone: both cache hit rate and input-to-output ratio change. Nevertheless, they illustrate the central point. The same model can have dramatically different effective costs depending on how it is used.
The pricing lever has shifted from a simple input-versus-output distinction toward the degree of context reuse.
Why Providers Price Cached Inputs Differently
LLM inference has two main stages:
- Prefill: Processing input tokens.
- Decode: Generating output tokens.
When requests reuse a stable system prefix, cached prefill state can reduce the work required for subsequent requests. Instead of processing the entire prefix again, the service can reuse cached state and process the additional context.
That reduces the marginal computation associated with repeated inputs. A low cached-input price—RMB 2 in this example—encourages reuse and helps providers improve resource utilization.
Requests that require the full prefix to be processed again incur more fresh computation. Their demand can also be less predictable. A higher uncached-input price—RMB 20 here—charges more for that work and creates an incentive to avoid unnecessary recomputation.
Output generation remains a separate cost category. Input-prefix caching does not eliminate the decoding work needed to generate new output, and autoregressive generation proceeds sequentially. In this pricing structure, output therefore carries the highest rate.
This is a form of making inference costs visible. Rather than absorbing the benefits of caching into one blended price, the provider exposes them through separate billing tiers.
For enterprise users, sufficiently high cache reuse can potentially offset higher list prices. Effective costs may even fall below those of a previous model if the older workload achieved a substantially lower cache hit rate—for example, below 50%. That outcome is conditional, however: it depends on the actual hit rates and token mix under both pricing structures.
For developers with highly variable requests, more of the bill reflects newly processed context. The pricing system increasingly charges according to the computational characteristics of each workload.
How to Optimize Costs Through Architecture and Request Design
Model selection should begin with a workload-specific cost model, not just a comparison of advertised token prices.
Four practices are particularly useful.
1. Maximize Stable Prefix Reuse
Place fixed system instructions, tool definitions, and reusable task templates in a stable prefix. Keep its content, ordering, and length consistent where possible.
Frequent changes to the system prompt or early conversation messages can invalidate reusable prefix state. Stable prefixes are especially relevant to code generation, customer-support conversations, and document-processing workflows.
The objective is to reuse genuinely shared context, not merely to make prompts longer.
2. Manage Context Length Deliberately
Long-context workloads can provide substantial opportunities for reuse, but context should not grow indefinitely.
When a conversation passes an appropriate threshold, consider summarizing older turns while retaining essential information. This can reduce total input tokens, although changes to the shared prefix must be managed carefully to preserve reuse where possible.
The trade-off is between carrying useful cached context and paying for unnecessary input.
3. Measure the Input-to-Output Ratio
For output-heavy tasks, such as long-form writing, output pricing can dominate the bill. Request concise answers where appropriate, or use structured output requirements to keep responses within the needed scope.
For input-heavy tasks, such as retrieval-augmented generation (RAG), focus on retrieval relevance and removing unnecessary context.
A high cache hit rate does not make output inexpensive, and a low input price does not compensate for unlimited generation.
4. Route Workloads Across Model Tiers
If an application includes both high-reuse and low-reuse requests, consider separating them.
High-reuse workloads may be suitable for the newer model’s cached-input pricing. Low-reuse requests may be more economical on a lower-priced lightweight model or a previous-generation model.
The goal is to balance overall spending rather than force every request through the same pricing structure.
What Cache-Aware Pricing Means for AI Applications
This pricing shift signals that inference cost predictability is becoming an important consideration in enterprise AI adoption.
A single “price per million tokens” is no longer enough to estimate a bill. Developers also need to account for:
- The proportion of input tokens served from cache.
- The ratio of input tokens to output tokens.
That creates demand for cost-optimization middleware: SDKs that help construct stable prefixes, cache-aware request-routing gateways, and billing forecasts based on observed request patterns.
Over time, teams that manage context reuse effectively may obtain substantially more model usage from the same spending budget. Cache design becomes both an engineering concern and a business decision.
When a headline announces that model prices have doubled—or increased severalfold—the useful question is not simply whether the price went up. It is which parts of the workload became more expensive, and how often those rates apply.
Users who repeatedly send uncached context face the largest exposure to higher input prices. Teams that optimize reusable prefixes and request patterns may achieve lower marginal costs, even under a more expensive headline pricing schedule.
The broader shift is from relatively uniform token pricing toward finer-grained pricing based on how computation is consumed. Understanding that distinction is essential to evaluating the real cost of an LLM API.
