LLM API Price Hikes: The Cost Logic Behind the Increase
This article breaks down why LLM API prices are rising, focusing on the shift in price ratios rather than just the headline multipliers. It explains why long-running agent workloads make these increases nearly inevitable, introduces a formula for converting list prices into real blended unit costs using input-output ratio and cache hit rate, and shows how stable prefixes can push hit rates above 90%. A practical optimization checklist and workload-specific selection advice help readers evaluate whether the new pricing is actually cheaper for their own usage.
1. What Happened: An Across-the-Board Price Adjustment
When a next-generation model from an AI coding tool published its new pricing, community discussions claimed the price had “increased fivefold.” The absolute numbers tell a more nuanced story: output pricing rose from CNY 27 to CNY 100 per million tokens (nearly 4x); uncached input rose from CNY 6.5 to CNY 20 and cached input from CNY 1.1 to CNY 2 (both around 3x). The cache-hit tier was actually the most moderate increase of all.
What matters is not the multiplier but the change in the ratio structure:
- Uncached input price / cached input price: widened from about 6x to 10x;
- Output price / cached input price: widened from about 25x to 50x.
In other words, the pricing “slope” has become steeper. The vendor is using price signals to strongly encourage one behavior: reuse reusable prefixes as much as possible and minimize the non-reusable portion. Understanding this has more engineering value than debating whether the increase is large.
2. Why Price Hikes Were Almost Inevitable After Agent Workloads Went Mainstream
In the chat era, interactions ranged from tens to a few thousand tokens. The cost of a single request was effectively capped by context length, so price sensitivity was naturally low. The agent era is completely different: a complex task can involve thousands of tool calls, accumulate hundreds of thousands of tokens, and run continuously for days across multiple parallel agents.
The cost pressure comes from three inference-side resource items that grow with context length, sometimes super-linearly:
- GPU memory usage: KV Cache must retain historical keys and values for every concurrent sequence. Long contexts consume the memory budget directly, reducing the number of concurrent requests.
- Storage and data movement: prefix caches must be written to storage and transferred across nodes, adding storage and network overhead.
- Decode bandwidth: during decoding, every generated token requires re-reading all historical KV, making bandwidth the bottleneck.
Under the old pricing structure, the per-unit revenue from such long-horizon tasks could not cover these costs, resulting in structural losses. The price increase is essentially a realignment of risk pricing, not a simple margin adjustment.
3. Converting List Prices into Real Unit Costs
Looking only at list prices leads to the wrong conclusion. Two variables must be introduced: the input-output ratio $r$ and the cache hit rate $h$. The effective input unit price is:
effective_input = price_hit * h + price_miss * (1 - h)blended = (r * effective_input + price_output) / (r + 1)
Scenario A: Enterprise long-context agent ($r=20$, $h=0.9$)
effective_input = 2*0.9 + 20*0.1 = 3.8 CNY/million tokensblended = (20*3.8 + 100) / 21 ≈ 8.4 CNY/million tokens
Scenario B: Low-frequency individual developer ($r=5$, $h=0.2$)
effective_input = 2*0.2 + 20*0.8 = 16.4 CNY/million tokensblended = (5*16.4 + 100) / 6 ≈ 30.3 CNY/million tokens
For the same model and the same price list, the former’s unit cost is slightly more than one-third of the latter’s. The conclusion is clear: the nominal price increase is effectively a discount for high-reuse customers, while callers that change their prefix every time pay the original price or even a premium.
4. Why Hit Rates Can Exceed 90%
A high hit rate does not depend on luck but on architecture. A common disaggregated inference approach in the industry separates the two phases: prefill, which processes long prefixes, is handled by one group of instances, while the generation phase is handled by another. Prefix KV flows between the pools over a high-speed network for reuse. Combined with prefix hash addressing, chunked caching, and eviction policies, stable system prompts, tool definitions, and few-shot examples can remain resident for a long time.
One premise must be accepted in engineering: the hit rate is a result determined jointly by architecture and calling habits, not a property of the model. With the same model, rewriting the system prompt every day will cause the hit rate to collapse to nearly zero.
5. An Actionable Optimization Checklist
- Prefix stability governance: move volatile content (timestamps, random IDs, user input) to the end of the prompt uniformly, keeping the prefix byte-for-byte identical;
- Prompt layering: separate system / tool schema / long-term knowledge / session context into layers, with the more stable content placed earlier;
- History compression: summarize long trajectories and externalize structured state to avoid repeatedly passing the full history as input;
- Tiered routing: send simple subtasks to lightweight models and escalate to stronger models only for complex reasoning, using a unified gateway for policy-based routing;
- Observability: instrument token composition, hit rate, and per-task cost, and treat cost as a performance metric alongside others;
- Budget guardrails: set step and token limits for parallel agents, and add circuit breaking for abnormal tasks.
Illustrative cost guardrail logic:
def should_continue(state, budget):if state.steps >= budget.max_steps:return Falseif state.tokens_used >= budget.max_tokens:return Falseif state.cost_estimate >= budget.max_cost:return Falsereturn True
6. Selection Recommendations
For production workloads that run for a long time and reuse prefixes heavily, the new pricing combined with a high hit rate is often more cost-effective than the old pricing. In such cases, prioritize evaluating cache friendliness, context management capabilities, and cost observability. For short interactions and low-reuse scenarios, control context length and avoid stuffing large blocks of static content into every request. Baidu AI Cloud provides an engineering foundation for this kind of cost accounting and invocation governance through general capabilities such as model services, container platforms, log services, and monitoring and alerting. The final criterion is simple: plug your own input-output ratio and hit rate into the formula and calculate it yourself.
