LLM API Price Increases: A Breakdown of Cache-Based Billing Logic
This article breaks down why a new-generation general-purpose LLM's higher list prices do not translate into proportionally higher bills. It explains the billing formula using cache hit rate and input-to-output ratio, compares two workload profiles, outlines why high cache hit rates are achievable in production, and lists practical cost-optimization steps.
1. The Phenomenon: List Prices Are Up Across the Board, but Bills May Not Rise Proportionally
A new-generation general-purpose LLM has announced a clear price increase: the output-side unit price is roughly four times that of the previous generation, the input side (cache miss) is roughly three times, while the cache-hit price rises more moderately. Looking only at the price sheet, the conclusion is “prices are up across the board.” But once you plug in real workloads, the conclusion reverses—the change in your bill depends on two variables: the cache hit rate and the input-to-output ratio.
To make the derivation easier, let’s abstract the three price tiers into symbols:
P_in_miss: input unit price on a cache missP_in_hit: input unit price on a cache hitP_out: output unit price
The ratio relationships between the previous and new generations can be summarized as follows: the output side is scaled by 4x, both input sides by roughly 3x; at the same time, the price gap between miss and hit widens from about 6x to 10x, and the gap between output and hit widens from about 25x to 50x. This set of ratio changes is the key to understanding the price increase: the vendor has concentrated its discount on the “reusable prefix.”
2. Billing Model: Writing the Bill as a Recomputable Formula
Let the number of input tokens be N_in, the number of output tokens be N_out, and the cache hit rate be h. Then:
Cost = N_in * (h * P_in_hit + (1 - h) * P_in_miss) + N_out * P_out
Unit blended cost (per million tokens, with r = N_in / N_out):
C_mix = (r * (h * P_in_hit + (1 - h) * P_in_miss) + P_out) / (r + 1)
This formula shows that the magnitude of the price increase is not a linear function of the list price, but is modulated jointly by h and r. The higher h is and the larger r is, the greater the weight of the hit-price tier, and the more the effective increase is diluted.
3. A Comparative Calculation for Two Workload Types
Using the order of magnitude of the public list prices (input 20 / hit 2 / output 100, in CNY per million tokens):
- Enterprise-grade long-context intelligent coding workload:
r = 20,h = 0.9
Effective input unit price ≈2*0.9 + 20*0.1 = 3.8, blended cost ≈(20*3.8 + 100)/21 ≈ 8.4 - Low-frequency retail-style calls:
r = 5,h = 0.2
Effective input unit price ≈2*0.2 + 20*0.8 = 16.4, blended cost ≈(5*16.4 + 100)/6 ≈ 30.3
The two differ by roughly 3.6x. Same model, same price sheet—the cost difference comes from workload shape, not discriminatory pricing by the provider.
4. Why a High Hit Rate Is Achievable in Engineering
Mainstream inference services commonly adopt a disaggregated architecture: prefill and decode are split across separate resource pools, and combined with prefix caching and request scheduling, the same system prompt, the same tool definitions, and the same long-document prefix are reused repeatedly. Prefixes that can be reused in engineering include: system instructions, tool schemas, code repository context, and long document fragments. The prerequisite for a high hit rate is “stable prefix + ordered requests + sufficient cache capacity.”
5. An Actionable Optimization Checklist
- Fix the prefix: keep the system prompt and tool definitions stable, and move volatile content to the end of the user message.
- Layer the prompt: organize it in three tiers—static (cacheable), semi-static (low-frequency changes), and dynamic (changes every turn).
- Batch and concurrency control: avoid frequent evictions that cause hit-rate jitter.
- Compress output: the output unit price is the most expensive, so trim redundant explanations, use structured output, and cap the maximum generation length.
- Cost attribution: record
h,r, and token distribution per business line, and use the formula above to review bills.
def mix_cost(n_in, n_out, h, p_hit=2.0, p_miss=20.0, p_out=100.0):in_unit = h * p_hit + (1 - h) * p_missreturn (n_in * in_unit + n_out * p_out) / 1_000_000
6. Conclusion
The “5x” in the list price is a marketing figure; the “1.xx” in the bill is the engineering figure. Only by factoring the cache hit rate and the input-to-output ratio into capacity planning and model selection can you capture the real discount during a price-increase cycle. If you need a stable cost baseline, you can combine the general-purpose container platform, log service, and monitoring and alerting capabilities offered by Baidu AI Cloud to build an observable token-cost dashboard.
