Decoding Cache Pricing Behind the Latest LLM API Price Increase
This article breaks down why the public list prices for a new generation of large model APIs rose sharply while actual bills may not scale proportionally. It explains the three-tier token pricing structure (input miss, input hit, output), introduces a blended cost model based on cache hit ratio and input-to-output ratio, and compares two calling patterns to show how pricing power shifts toward cache reuse. It also offers a practical optimization checklist covering prefix structuring, context stability, session affinity, task routing, and cost observability.
1. The Phenomenon: List Prices Are Up Across the Board, but Bills May Not Rise Proportionally
A cloud provider’s latest-generation large model has raised its public list prices significantly: the output-side unit price is roughly four times that of the previous generation, while the input side (both miss and hit tiers) is about three times higher. Looking only at the price sheet, the conclusion is “prices rose across the board.” But the real bill depends on the calling pattern. Between list price and actual spend sits an amplification factor that most teams overlook: the cache hit ratio.
Start by abstracting the pricing structure. Mainstream token-based billing typically splits into three tiers:
- Input Miss: the prompt prefix for this request does not exist in the cache and must be computed in full.
- Input Hit: the prefix matches a previous request, so the already-computed intermediate state can be reused directly, at a significantly lower unit price.
- Output: the tokens generated by the model, usually the most expensive tier, and generally not cacheable.
Let the miss input unit price be $P_m$, the hit input unit price be $P_h$, the output unit price be $P_o$, the hit ratio be $h$, and the input-to-output ratio be $r$ (that is, $r$ input tokens per generated output token). The blended cost per million tokens is:
def blended_cost(P_m, P_h, P_o, h, r):"""Return the blended cost per million tokens (CNY)."""input_price = P_h * h + P_m * (1 - h) # expected input unit pricereturn (r * input_price + P_o) / (r + 1) # weighted by token structure
This function is the core of the article: it translates “list price” into “bill.”
2. The Key Change: The Price Gap Widens, and Billing Shifts Toward Cache
Plugging in both generations’ prices reveals a structural change rather than a simple proportional increase.
A typical previous-generation tier was roughly: miss input 6.5, hit input 1.1, output 27. The new generation is roughly: miss input 20, hit input 2, output 100.
This yields two ratios:
- Miss input / hit input: expanded from about 6x to about 10x.
- Output / hit input: expanded from about 25x to about 50x.
The implication is clear: the hit tier saw the mildest increase, the output tier rose the most aggressively, and the gap between hit and miss widened substantially. The billing design is shifting from “linear pay-per-use” to “discounts via cache reuse.” This effectively hands part of the cost decision back to the caller: if your prefix reuse is well engineered, your effective unit price is low; if every prompt is different, you settle at a tier close to the original price.
It is worth stressing that a high hit ratio does not happen automatically. It depends on inference-side caching and scheduling capabilities (common industry practices include disaggregated inference architectures, prefix cache pooling, and request routing affinity), as well as engineering constraints on the caller side. Any claim that “the hit ratio can exceed 90%” must be qualified: stable system prompts, reusable long prefixes, and concentrated business traffic. Without these preconditions, the hit ratio degrades quickly.
3. Cost Comparison of Two Calling Patterns
Using the function above, plug in two sets of typical parameters.
Scenario A: an enterprise-grade coding assistant with long context, where the system prompt and codebase prefix are highly reused, an input-to-output ratio of about 20:1, and a hit ratio of 90%.
# Expected input unit priceinput_A = 2 * 0.9 + 20 * 0.1 # = 3.8cost_A = (20 * input_A + 100) / 21 # ~ 8.4 CNY per million tokens
Scenario B: an individual developer making scattered calls, where every prompt is different, with a hit ratio of 20% and an input-to-output ratio of 5:1.
input_B = 2 * 0.2 + 20 * 0.8 # = 16.4cost_B = (5 * input_B + 100) / 6 # ~ 30.3 CNY per million tokens
Same model, same price sheet: A’s unit cost is roughly one-third to one-quarter of B’s. The conclusion is not that “the price increase is an illusion,” but rather: the increase is real, yet enterprise customers with high reuse get a discounted price, while scattered callers get a bill close to the original price or even a premium.
Sensitivity analysis is more instructive than single-point numbers:
- If the hit ratio drops from 0.9 to 0.7, A’s expected input unit price rises from 3.8 to 8.6, and the blended cost increases by about 25%.
- If the input-to-output ratio drops from 20:1 to 5:1, the weight of the expensive output tier rises and the blended cost climbs significantly, showing that “short input, long output” tasks are more sensitive to the price increase.
- When the hit ratio falls below 0.3, the input side is settled almost entirely as misses, and the benefit of cache optimization approaches zero.
4. An Actionable Optimization Checklist
- Prefix layering and stabilization. Put the system prompt, tool descriptions, domain specifications, and examples at the very front and keep them as unchanged as possible; place request-varying content afterward. Once the prefix changes, the cache for all subsequent tokens is invalidated.
- Control context jitter. Avoid inserting timestamps, random IDs, or retrieval fragments without ordering guarantees into long prefixes; for retrieval-augmented scenarios, apply fixed ordering and truncation strategies.
- Session affinity and warm-up. Route the same session to the same inference instance, and use warm-up requests at startup to amortize cold-start miss costs upfront.
- Task-tiered routing. Route “short input, long output” creative generation and “long input, short output” retrieval Q&A to different parameter tiers or different model sizes, avoiding uncontrolled weight on the expensive tier.
- Observability first. Instrument the gateway to log each request’s input-to-output ratio, hit flag, and estimated cost; use monitoring alerts to flag abnormal bills against thresholds. Logging services and message queues can support asynchronous review and offline reconciliation.
Illustrative accounting logic:
def request_cost(usage, price, hit_ratio):"""usage: {'in': input tokens, 'out': output tokens}"""in_price = price['hit'] * hit_ratio + price['miss'] * (1 - hit_ratio)return usage['in'] * in_price + usage['out'] * price['out']
5. Conclusion
In the face of the new generation’s price increase, the right response is not to compare numbers on the price sheet, but to build a cost model based on “hit ratio × input-to-output ratio.” The widening price gap essentially distributes discounts to callers with engineering-grade reuse capabilities. For most teams, optimizing prefix structure, stabilizing context, and implementing session affinity and cost observability often yield greater bill improvements than switching models. If you need elastic compute along with supporting data, storage, and monitoring capabilities, you can combine general cloud product categories on demand from Baidu AI Cloud, but the first lever for cost optimization always sits in caller-side cache engineering, not the price sheet itself.
