LLM Inference Pricing: How Cache Hits Determine Your Real Cost
This article breaks down how modern LLM inference services price a request across three tiers—input cache-miss, input cache-hit, and output—and explains why these prices track actual compute cost rather than token counts. It shows how to calculate the effective unit price from the list price, cache hit rate, and input-to-output ratio, then compares two real-world scenarios to demonstrate that usage patterns, not list prices, decide your final bill. It closes with practical strategies for lowering cost, from improving cache reuse to compressing output and using observability to guide optimization.
1. The Three-Tier Pricing Structure: Input, Output, and Cache Hits
Mainstream LLM inference services have largely abandoned the simple “one price per million tokens” model. Instead, they break a single request into three price tiers:
- Input – cache miss: The request’s prefix matches no cached content and must be computed in full from scratch, at the highest input-side price.
- Input – cache hit: The request prefix closely matches previously cached content, so the KV cache can be reused directly, usually at a price well below the miss tier.
- Output: Newly generated tokens cannot be reused and form the highest overall price tier.
The essence of this structure is pricing by compute, not by character count. For the model, reusing a cached prefix costs far less compute than starting from scratch, while generating each output token requires a full forward pass with no room for discounts. The price gradient therefore reflects the true compute cost curve.
2. What the Price Ratios Signal
Absolute prices alone mean little; the more telling metric is the multiplier between tiers.
Across successive model generations, a common trend is that the gap between input-miss and input-hit widens (for example, from around 6x to 10x), and the gap between output and hit widens as well (for example, from 25x to 50x). These numbers send a clear signal:
- The cache-hit tier rises relatively modestly, indicating the provider wants to use pricing to encourage users to increase prefix reuse.
- The output tier rises noticeably, because output is a hard compute cost that can be neither optimized nor reused.
In other words, new-generation pricing is often not an across-the-board increase but a redistribution of cost pressure: a discount on the reusable portion, full price on the portion that cannot be reused. A nominal price increase is, in practice, a structured pricing strategy.
3. Calculating Real Cost: The Effective Unit Price Formula
What actually determines your bill is not the list price you see but the effective unit price. Define:
- Cache-hit input price
P_hit, cache-miss priceP_miss, output priceP_out - Cache hit rate
r
Then the effective input-side price is:
P_in_eff = P_hit * r + P_miss * (1 - r)
Introducing the input-to-output ratio k (input tokens ÷ output tokens), the blended cost per unit of consumption is:
C = (k * P_in_eff + P_out) / (k + 1)
This formula separates “list price” from “usage characteristics”: the list price is an exogenous variable, while r (hit rate) and k (input-to-output ratio) are variables you can influence through architecture and prompt design.
4. A Numerical Comparison of Two Scenarios
The figures below are illustrative numbers (meant only to explain the method; unit: USD per million tokens) used to compare two typical users.
Scenario A: Enterprise-grade Agent, input-to-output ratio around 20:1, cache hit rate 90%
This kind of long-context coding or agent scenario has a highly fixed, repeatedly reused system prompt and large blocks of context. Assume a hit tier of $2, a miss tier of $20, and output of $100:
Effective input price ≈ 2 × 0.9 + 20 × 0.1 = 3.8Blended cost ≈ (20 × 3.8 + 1 × 100) / 21 ≈ 8.4
Scenario B: Occasional-calling developer, input-to-output ratio around 5:1, cache hit rate 20%
Every prompt is different, so the cache is almost impossible to hit. With the same price assumptions:
Effective input price ≈ 2 × 0.2 + 20 × 0.8 = 16.4Blended cost ≈ (5 × 16.4 + 1 × 100) / 6 ≈ 30.3
Conclusion: For the same model, the per-unit cost in Scenario A is only about a third of that in Scenario B. What determines cost is not the list price but two usage characteristics—cache hit rate and input-to-output ratio. So when discussing “how many times a model’s price rose,” any conclusion that ignores the way the model is used is likely to be distorted.
5. Cost-Reduction Strategies: Take Control
Once you understand the cost structure, you can optimize deliberately:
- Increase cache reuse. Place the stable, unchanging system prompt, tool definitions, and a few examples at the very front of the request; put dynamic content (user input, real-time data) at the end. The more stable and longer the prefix, the higher the hit rate—and this portion rides the cheap “hit tier.”
- Compress wasteful output. The output tier is the most expensive and cannot be reused, so reduce redundant reasoning, avoid lengthy restatements, and constrain output length where necessary.
- Optimize the input-to-output ratio. Input is cheap and output is expensive, so letting the model generate in a single pass and reducing repeated back-and-forth is often more economical than many short exchanges.
- Raise the hit rate at the architecture level. Disaggregated inference (decoupling prefill and decode) is a common industry approach for centrally managing and reusing caches; deploying prefill and decode separately can significantly improve prefix hit rates.
- Verify with observability. Combine logging with monitoring and alerting to continuously track actual metrics such as hit rate and input-to-output ratio, rather than judging cost by feel—build optimization on data.
6. Summary
The tiered pricing of LLM inference is essentially “charging by real compute.” The modest rise in the cache-hit tier and the noticeable rise in the output tier point to one fact: pricing is tilting toward “cheap when reusable, expensive when not.” For agent-style workloads that run fixed context over the long term, this amounts to a discount; for occasional calls that frequently change prompts, it may approach or even exceed the original price. Rather than fixating on list-price multipliers, developers should focus on raising the cache hit rate, optimizing the input-to-output ratio, and letting monitoring data drive cost reduction—with the same model, the right usage can make the per-unit cost differ by several times.
