Understanding the Cost Logic Behind Large Model API Price Increases
This article breaks down why a large model API price increase can look like a 3-4x hike on the surface yet affect different workloads very differently. It explains how tiered pricing (cache-hit input, cache-miss input, output), prefix caching economics, and a simple blended-price model determine the real cost, and offers a practical optimization checklist for reducing spend through stable prefixes, higher input-to-output ratios, load testing, tiered routing, and output control.
1. The Phenomenon: One Price Change, Three Very Different Increases
A platform’s next-generation large model showed a clear jump in public pricing: the output side rose from 27 yuan per million tokens in the previous generation to 100 yuan, nearly 4x; the input side rose from 6.5 to 20 yuan on a cache miss and from 1.1 to 2 yuan on a cache hit, both around 3x. Looking at these three numbers alone, it is easy to conclude “it got three to four times more expensive,” but that conclusion is wrong—it fails to distinguish workload shape.
More informative than the absolute prices are the ratios between tiers:
| Ratio | Previous Gen | New Gen | Change |
|---|---|---|---|
| Miss input / Hit input | ~6x | 10x | Widened |
| Output / Hit input | ~25x | 50x | Widened |
| Output / Miss input | ~4.2x | 5x | Slightly widened |
The pattern is clear: the smallest increase is on the cache-hit tier, and the steepest increase is on the output tier. The pricing structure has shifted from “relatively flat” to “steep,” which means cost is no longer determined by the total number of tokens, but by where those tokens land.
2. Why Vendors Dare to Make the Structure Steep: The Economics of Prefix Caching
A steep pricing structure depends on a high enough hit rate. A disaggregated inference architecture (placing prefill and decode in separate resource pools, combined with global prefix cache reuse) can push the prefix hit rate above 90% for long-context intelligent coding workloads; this capability is already common practice in the industry and is not unique to any single vendor.
The reason is not hard to understand: requests from intelligent coding tools are highly homogeneous—the same system prompt, the same set of tool definitions, and the same repository context are carried repeatedly, with only the trailing user instruction changing. The fully identical prefix does not need to be recomputed, and a hit is billed at the lowest tier. Vendors use the price lever to shift this portion of the cost away, while leaving the cost of repeated computation to requests that miss.
3. A Quantitative Model: The Blended Unit Price Depends on Two Variables
Let the input-to-output ratio be $r$ (input tokens / output tokens) and the hit rate be $h$. Then:
effective input price = hit price × h + miss price × (1 - h)blended unit price = (r × effective input price + output price) / (r + 1)
Sample implementation:
def blended_price(r, h, hit=2.0, miss=20.0, out=100.0):in_price = hit * h + miss * (1 - h)return (r * in_price + out) / (r + 1)print(blended_price(20, 0.90)) # ≈ 8.4 yuan/million tokensprint(blended_price(5, 0.20)) # ≈ 30.3 yuan/million tokens
Scenario A (enterprise long-context agent, $r=20$, $h=0.9$): effective input price is about 3.8 yuan, blended about 8.4 yuan.
Scenario B (low-frequency individual developer, $r=5$, $h=0.2$): effective input price is about 16.4 yuan, blended about 30.3 yuan.
The same model, the same price list, and the unit cost differs by about 3.6x. The conclusion: the price increase is almost imperceptible for high-hit workloads (8.4 yuan is still below the previous generation’s level for the same scenario), while for low-hit workloads it is a real several-fold rise.
4. An Actionable Optimization Checklist
- Stable prefix: Put the system prompt, tool schema, and few-shot examples at the front and freeze them, placing volatile content at the end; do not put timestamps or random IDs in the prefix.
- Raise the input-to-output ratio: Feed enough context in one pass and reduce back-and-forth probing dialogue; produce long-document summaries and repository-level retrieval in a single shot.
- Load test rather than estimate: Measure the hit rate with real traffic samples; the hit rate is the cost metric most worth monitoring.
- Tiered routing: Send high-hit long-context requests to the flagship tier, and short requests and batch jobs to a lightweight tier or a local small model.
- Govern output: Use structured output and limit redundant reasoning; the output tier is the most expensive one, so compressing it yields the most direct benefit.
5. Conclusion
To judge whether a price increase is really more expensive, you cannot look at the multiple on the sticker price, but at “tier ratios × where your own workload lands.” Raising the hit rate from 20% to 90% is equivalent to cutting the blended cost to about a quarter; under a steep pricing structure, the cache hit rate is the new primary cost variable. Model services on platforms such as Baidu AI Cloud also use tiered billing for input/output/cache, and the engineering side should incorporate prefix design and hit-rate monitoring into routine capacity planning.
