LLM Inference Costs in the Agent Era: Pricing and Caching Strategy Analysis
This article examines a major LLM provider’s new pricing structure, explains how disaggregated inference and KV cache reuse are reshaping inference economics, models the real costs for enterprise agents versus casual developers, and outlines cache-aware optimization strategies for developers.
1. Pricing Shifts: Headline Increases and Hidden Discounts
A major LLM provider recently released a new-generation model, and its published billing rates quickly drew attention from the developer community. On the surface, the listed prices rose sharply across the board: output pricing increased from RMB 27 to RMB 100 per million tokens, nearly a 4x increase; cache-miss input pricing rose from RMB 6.5 to RMB 20, roughly a 3x increase; and cache-hit input pricing moved only slightly from RMB 1.1 to RMB 2.
A closer look at the price ratios reveals a more interesting pattern. In the previous generation, cache-miss input was about 6x the price of cache-hit input. In the new generation, that ratio widened to 10x. More dramatically, the ratio of output price to cache-hit input price jumped from 25x to 50x.
This means that among all billing tiers, the cache-hit tier saw the mildest increase, while the output side saw the steepest rise. At first glance, this looks like a broad price increase. But when viewed alongside technical trends, it is better understood as a targeted pricing adjustment for different usage scenarios.
2. Technical Foundation: Disaggregated Inference and Very High Cache Hit Rates
To understand the logic behind this pricing strategy, it is necessary to look at the inference architecture itself. In traditional chat scenarios, user prompts are usually short and different on every request, so cache reuse is very low. In complex agent scenarios, however, especially long-context coding agents, the system prompt, tool definitions, and historical context are often highly consistent across multiple calls.
The industry’s mainstream disaggregated inference architecture was designed to address this problem. Traditional inference architectures couple Prefill and Decoding in the same GPU cluster, which leads to contention between compute and memory-access resources. Disaggregated architectures decouple the two and introduce a global KV Cache storage layer.
When an LLM processes input, it converts tokens into Key and Value matrices and caches them in GPU memory for later Self-Attention use. This is the KV Cache. Under a disaggregated architecture, the KV Cache can be persisted. When a new request arrives, the system automatically compares the request prefix. If the prefix matches, the system reads the existing KV Cache directly from the cache layer and skips expensive Prefill computation.
According to public technical blog posts, this architecture has enabled some models to achieve cache hit rates above 90% in certain coding scenarios. This is a critical technical breakthrough because it directly changes the cost structure of LLM inference.
3. Scenario Modeling: The Cost Divide Between Enterprise Agents and Casual Developers
Based on a cache hit rate above 90%, we can use a mathematical model to reconstruct the actual consumption costs for different user groups.
Scenario 1: Enterprise agent developers
Assume an enterprise agent application has an input-to-output ratio of about 20:1, which is common in long-context scenarios, and maintains a 90% cache hit rate through careful system design.
- Effective input price ≈ RMB 2 × 0.9 + RMB 20 × 0.1 = RMB 3.8 per million tokens
- Output price = RMB 100 per million tokens
- Blended cost per million tokens ≈ (20 × 3.8 + 1 × 100) / 21 ≈ RMB 8.4
Scenario 2: Occasional casual developers
Assume a developer uses the model only occasionally, submits a very different prompt each time, has a cache hit rate of only 20%, and has an input-to-output ratio of 5:1.
- Effective input price ≈ RMB 2 × 0.2 + RMB 20 × 0.8 = RMB 16.4 per million tokens
- Output price = RMB 100 per million tokens
- Blended cost per million tokens ≈ (5 × 16.4 + 1 × 100) / 6 ≈ RMB 30.3
The comparison shows that for the same model, the unit cost for an enterprise agent can be only about one-third that of a casual developer. On the surface, the price increase is universal. In practice, the provider is offering an implicit discount to large enterprise customers who run the same system prompt repeatedly and reuse prefixes heavily, while charging list price or even a premium to casual developers who change prompts every time and contribute little cache reuse.
4. Underlying Logic: The Compute Economics from the Chat Era to the Agent Era
Why must providers adopt this pricing strategy? The answer lies in the difference in compute consumption between the chat era and the agent era.
In the chat era, an interaction typically involves only tens to thousands of tokens. Users are not very sensitive to unit price, and the overall cost is extremely low. In the agent era, the situation changes fundamentally. In complex multi-step agent tasks, a single task may involve thousands of tool calls, and the context can rapidly expand to hundreds of thousands of tokens. If autonomous tasks run in parallel across hundreds of nodes for multiple days, token consumption can grow exponentially.
If providers continued to use the flat pricing of the chat era, they would face serious losses in agent scenarios. The reason lies in the underlying physical costs of LLM inference:
- GPU memory footprint: As context length increases, the memory required for KV Cache grows linearly. A KV Cache for hundreds of thousands of tokens may consume tens of GB of GPU memory, greatly reducing the space available for batch size.
- Decoding bandwidth consumption: During autoregressive generation, every token generated requires reading all historical KV Cache from GPU memory to the compute units. This means bandwidth consumption grows linearly or even superlinearly with context length.
Therefore, although the new architecture solves the problem of memory fragmentation through disaggregated storage and improves throughput, the underlying hardware bandwidth and storage costs remain high. Providers must raise output prices and cache-miss input prices to cover these real hardware costs.
5. Developer Strategies: Using Caching Mechanisms to Optimize Costs
Faced with this cache-hit-rate-based pricing model, developers—especially enterprise application architects—need to make prefix reuse a core optimization goal:
- Fix the System Prompt: Place the system role definition, global instructions, safety rules, and other stable content at the very beginning of the prompt, and keep this prefix absolutely consistent across all requests to maximize global cache hits.
- Structure tool definitions: In multi-turn agent interactions, tool lists and definitions often consume a large number of tokens. Keep the tool declaration section stable, and avoid dynamically changing tool order or adding/removing tools on every call.
- Separate dynamic and static context: When designing prompt templates, place static context such as document background and few-shot examples at the front, and place dynamic variables such as the user’s current question at the end. This allows the static portion to trigger cache hits reliably.
- Manage conversation history carefully: In long conversations, periodically summarize the history instead of blindly inserting all past dialogue into the context. This reduces token consumption and helps keep the historical prefix stable.
In summary, the sharp rise in LLM prices is not simply commercial extraction. It is the inevitable result of upgrades to the underlying inference architecture and the restructuring of compute costs in the agent era. Developers need to understand the technical principles of KV Cache and disaggregated inference, and embrace caching mechanisms at the architecture-design level, in order to truly control compute costs in the next phase of AI deployment.
