Behind the LLM Inference Price Increases: The Cache Economics of Billing

    This article explains how tiered LLM inference pricing (uncached input, cached input, and output) changes the effective cost of API usage. It presents a blended cost formula based on cache hit rate and the input-to-output ratio, works through two usage scenarios with numbers, and describes engineering practices, such as stable prompt prefixes and output length control, that help raise cache reuse and lower cost.

    Price lists are only the starting point for developers and businesses. The call pattern determines the actual bill. Inference billing is usually split into tiers such as uncached input, cached input, and output. The increase differs across these tiers. Combined with the input-to-output ratio, cache hit rate, and how much context gets reused, the unit cost of the same model can differ several times over between applications. This article does not focus on any specific provider. It treats the topic as a general technical question: how to read an inference billing structure, how to calculate the blended cost, and how to use engineering methods to improve cache hit rates and control output length.

    1. Three-Tier Pricing: Different Increases, Different Signals

    Assume an example model from a previous generation is priced at CNY 6.5 per million uncached input tokens, CNY 1.1 per million cached input tokens, and CNY 27 per million output tokens. A newer example model is priced at CNY 20, CNY 2, and CNY 100 per million tokens for the same three tiers. These figures are for cost-model illustration only and do not represent any specific service commitment. The output price rises by almost 4x, the uncached input price by about 3x, and the cached input price by about 2x.

    The ratios between tiers matter more than the individual increases. The ratio of uncached input to cached input grows from about 6x to 10x. The ratio of output to cached input grows from about 25x to 50x.

    These ratios send a clear signal. The cached input tier rises relatively modestly, while the output tier rises sharply. In inference, the prefill stage processes input and can reuse cached prefixes. The decode stage generates tokens one at a time, which is hard to cache, and its compute and memory bandwidth costs persist throughout generation. The pricing therefore favors reusing prefixes and discourages long outputs and long, unpredictable inputs. This matches the cost structure of inference systems. However, a higher list price does not mean every customer’s bill rises by the same proportion. The bill depends on the call pattern, so it must be calculated from that pattern.

    2. A Blended Cost Model: Two Levers

    Let P_miss be the uncached input price, P_hit the cached input price, and P_out the output price, all in CNY per million tokens. Let R be the input-to-output ratio, meaning R million input tokens for every million output tokens. Let h be the cache hit rate. The effective input price is:

    P_in_eff = P_hit × h + P_miss × (1 - h)

    The blended unit cost per million output tokens is:

    C = (R × P_in_eff + P_out) / (R + 1)

    The denominator R + 1 represents the total of input and output tokens. The formula shows that two levers drive the actual cost. A higher cache hit rate h brings the effective input price closer to the cached price. A higher input-to-output ratio R gives input costs more weight in the blended cost. Conversely, when the output price is high and output makes up a large share of tokens, the output tier has a bigger effect on total cost. Developers should convert a price list into a cost model for their own scenario. Otherwise, they are likely to misjudge their costs.

    3. Two Usage Scenarios: The Same Model, Costs That Differ Several Times Over

    Enterprise agent scenario. A long-context coding assistant often has an input-to-output ratio of about 20:1, and its cache hit rate can reach 90%. The effective input price is about 2 × 0.9 + 20 × 0.1 = 3.8 CNY per million tokens. The output price stays at CNY 100 per million tokens. The blended cost is about (20 × 3.8 + 1 × 100) / 21 ≈ 8.4 CNY per million tokens. Input volume far exceeds output volume here. The fixed system prompt, tool descriptions, codebase summaries, and retrieval templates are highly reusable, so caching moves most input tokens into the low-price tier.

    Ad hoc call scenario. A developer who uses the service occasionally, with a different prompt each time, has a cache hit rate of about 20% and an input-to-output ratio of about 5:1. The effective input price is about 2 × 0.2 + 20 × 0.8 = 16.4 CNY per million tokens. The blended cost is about (5 × 16.4 + 1 × 100) / 6 ≈ 30.3 CNY per million tokens. The unit cost in the first scenario is roughly one-third to one-quarter of the second. The difference does not come from different model capabilities. It comes from different call patterns. The enterprise workload reuses a stable prefix over a long period. The ad hoc workload introduces a new long context on every call, so its hit rate is low and its input price stays close to the uncached tier.

    4. Why Cache Hit Rate Is the Core Metric

    In long-context inference, the key-value cache of a shared prefix can be reused. This reduces repeated prefill computation and memory bandwidth use. Disaggregated inference architectures pool prefill and decode resources and schedule them separately, which can improve cache reuse. In highly templated coding scenarios, some practitioners have raised prefix cache hit rates to very high levels. However, a high hit rate does not happen automatically. It depends on prefix stability, how the context is organized, consistent request routing, cache capacity, and the eviction policy.

    Engineers can take the following steps:

    • Place stable system prompts, tool descriptions, and domain rules at the beginning of the context.
    • Place dynamic retrieval results and user input at the end.
    • Version tool descriptions, so that unnecessary changes do not break the prefix.
    • Keep multi-turn sessions on the same routing path where possible.
    • Trim retrieval results before concatenating them.
    • Monitor the cache hit rate, the share of uncached input tokens, and the distribution of output lengths.

    Cache-friendly design is not simply about writing more cache entries. It means making request structure predictable and reusable.

    5. Pricing Signals and the Limits of Fairness

    Pricing that makes output and uncached input expensive while keeping cached input cheap is, in essence, a price on the reusability of compute resources. Enterprise customers who run the same system prompt for long periods and reuse prefixes heavily effectively pay prices closer to a discount. Individual developers who change prompts every time and send long, random contexts pay prices closer to the list price or even a premium. This difference is not entirely unreasonable. However, billing transparency matters. Customers need to know how a cache hit is determined, how long a cache entry lasts, whether routing across requests is stable, and whether hit statistics can be observed. Enterprises should build their own cost curves through load testing and monitoring, rather than relying only on public list prices.

    6. Practical Recommendations and Pseudocode

    For enterprises: Build a cost tiering scheme that separates stable prefixes, semi-stable templates, and dynamic content. Manage system prompts to limit frequent changes. Constrain output length through structured output and segmented generation. Track the cache hit rate, the input-to-output ratio, and the unit cost. Choose a model suited to each task rather than sending every request to the highest-tier model.

    For individual developers: Reuse sessions and fixed templates, keep long contexts short, limit output length, split tasks into smaller steps, and avoid sending large amounts of unrelated material with each request.

    1. function effective_input_price(miss, hit, h):
    2. return hit * h + miss * (1 - h)
    3. function blended_cost(miss, hit, out, R, h):
    4. p = effective_input_price(miss, hit, h)
    5. return (R * p + out) / (R + 1)
    6. Enterprise scenario:
    7. p = effective_input_price(20, 2, 0.9) // 3.8
    8. c = blended_cost(20, 2, 100, 20, 0.9) // approx. 8.4
    9. Ad hoc scenario:
    10. p = effective_input_price(20, 2, 0.2) // 16.4
    11. c = blended_cost(20, 2, 100, 5, 0.2) // approx. 30.3

    Conclusion

    A price increase in LLM inference cannot be judged from a single tier’s list price. A steep rise in the output tier penalizes long outputs and low-reuse calls. The relatively modest rise in the cached input tier rewards businesses that reuse prefixes. The cache hit rate and the input-to-output ratio are the two key levers. Enterprise agents can bring their blended cost down through stable prefixes, layered context, and cache-friendly architecture. Ad hoc developers are more likely to pay a premium for uncached input and long outputs. Including the call pattern in the cost model is the practical engineering response to pricing changes.