The Cost Logic Behind LLM API Price Increases and What It Means for Agent Practice
This article breaks down a recent across-the-board LLM API price increase by focusing on the ratios between input-cache-hit, input-cache-miss, and output pricing rather than the headline numbers. It introduces a reusable cost estimation model based on the input-to-output token ratio (r) and cache hit rate (h), compares two contrasting scenarios, and explains why Agent workloads make cost re-evaluation essential. It closes with six engineering practices for reducing cost through prefix reuse, context management, batching, model routing, and observability.
1. The Trigger: A Pricing Update That Raised Everything
After a new-generation general-purpose LLM launched, its pricing moved noticeably above the previous generation. On the output side, the price climbed from roughly 27 CNY to 100 CNY per million tokens, close to a fourfold increase. On the input side, cache misses rose from 6.5 CNY to 20 CNY, and cache hits rose from 1.1 CNY to 2 CNY, both around a threefold jump. If you only look at the list prices, the conclusion seems obvious: it is unaffordable.
But list price is not the same as your bill. What actually determines cost is the ratio structure across the three tiers, and whether your workload falls into the range covered by discounts.
2. Translating List Prices into Ratios: Where the Discount Hides
Normalizing the two generations of prices reveals two key shifts:
- Input cache miss / input cache hit: widened from about 6x to 10x;
- Output / input cache hit: widened from about 25x to 50x.
The implication is clear: the cache-hit tier saw the mildest increase, while the output tier rose the sharpest. The vendor did not simply raise every tier by the same proportion. Instead, it redistributed the relative weight of each tier, concentrating cost pressure on “computation that cannot be reused.” This is a typical cost-oriented pricing strategy. A cache-hit input consumes almost only storage and bandwidth, a cache-miss input requires full prefill computation, and output must continuously occupy memory bandwidth during the decode stage. The real resource profiles of the three differ enormously.
3. A Reusable Cost Estimation Model
Let the input-to-output token ratio be r and the cache hit rate be h. Then:
effective input price = P_in_hit * h + P_in_miss * (1 - h)blended price = (r * effective input price + P_out) / (r + 1)
Scenario A: an enterprise-grade long-context coding Agent, r = 20, h = 0.9
effective input price ≈ 2*0.9 + 20*0.1 = 3.8 CNYblended price ≈ (20*3.8 + 100) / 21 ≈ 8.4 CNY per million tokens
Scenario B: a low-frequency individual developer whose prompt differs every time, r = 5, h = 0.2
effective input price ≈ 2*0.2 + 20*0.8 = 16.4 CNYblended price ≈ (5*16.4 + 100) / 6 ≈ 30.3 CNY per million tokens
Same model, same list price, yet the two differ in unit cost by about 3.6x. The conclusion is not romantic: this adjustment is effectively a discount for customers who run a fixed system prompt over the long term with highly reused prefixes, while for casual users who swap prompts every time it is list price or even a premium.
4. Why Agent Scenarios Force a Recalculation
In the chat era, a single interaction involved only tens to a few thousand tokens, so price swings were nearly imperceptible. The Agent era is entirely different. A single task may involve thousands of tool-call steps and accumulate hundreds of thousands of tokens, with hundreds of Agents running in parallel and continuously for days. Here, cost grows linearly or even super-linearly with context length, for reasons that include:
- During inference, the KV Cache expands linearly with context and concurrency, making memory a hard constraint;
- The decode stage is limited by memory bandwidth, and under long context every step must move more state;
- Prefill compute consumption is directly tied to input length, and cannot be amortized when the cache misses.
At the same time, new-generation models generally move toward ultra-large sparse architectures (trillion-level total parameters, with a dozen or so activated out of hundreds of experts). The activated parameters keep single-pass compute in check, but the weights that stay resident in memory, the communication overhead of expert routing, and operator optimization under hybrid attention mechanisms are all real hardware investments. On the cost side, the price increase is internally consistent.
5. Six Cost-Reduction Practices on the Engineering Side
- Maximize prefix reuse: Put the system prompt, tool definitions, and domain knowledge at the front and keep them stable, place volatile content later, and make the hit region as long as possible.
- Structure prompts in layers: Organize them into a stable layer / session layer / ephemeral layer, and avoid any global timestamp or random ID polluting the prefix.
- Compress context and write back summaries: For long tasks, replace full history with rolling summaries; pushing
rdown is more effective than shaving the unit price. - Batch and go asynchronous: Route offline tasks through batch channels, trading throughput for cost.
- Route across model tiers: Hand simple subtasks to small models, and call the flagship model only at nodes that need strong reasoning.
- Observability first: Instrument the gateway layer to track tokens, hit rate, and per-task cost, and build a cost dashboard with monitoring, alerting, and logging so that cost optimization has a basis.
6. Conclusion
The right way to evaluate a price increase is not to compare list prices, but to plug in your own r and h and compute a weighted figure. The vendor uses ratios to steer cost pressure toward non-reusable computation; what developers can do is reshape their workloads into a “high-reuse” form. In long-running Agent tasks, savings from prefix design and context governance at the architecture level often far exceed any room for negotiation at the unit-price level.
