LLM API Pricing Shifts: Cache Hits, Output Tokens, and Agent Costs

    This article examines recent generational changes in LLM API pricing as a rebalancing of price tiers rather than a simple across-the-board increase. It breaks down uncached input, cache-hit input, and output pricing; compares blended costs for enterprise agents and low-frequency developers; and explains how long-running agents, KV cache, and sparse MoE architectures shape inference costs. It closes with practical cost-governance steps for developers.

    When discussing generational price increases for LLM APIs, the most common mistake is to look at a single tier—how much the output price rose, how much the input price rose—and then conclude that “everything got more expensive.” A more useful question is: Are the relative increases across billing tiers consistent? What cost signals does that inconsistency send?

    Consider a commonly discussed example price structure (the numbers below are used only to analyze pricing structure and do not correspond to any specific vendor’s official quote): the previous-generation output tier was about 27 yuan per million tokens, while the new generation is about 100 yuan per million tokens, or nearly 4x on the output side. Uncached input rose from about 6.5 yuan to 20 yuan, and cache-hit input rose from about 1.1 yuan to 2 yuan, making the input side roughly 3x overall. On the surface, every tier is rising. But breaking down the ratios reveals the more important change:

    • The price ratio between uncached input and cache-hit input widened from about 6x to about 10x.
    • The price ratio between output and cache-hit input widened from about 25x to about 50x.
    • The absolute increase in the cache-hit tier was relatively moderate, while the output tier rose most significantly.

    This means the pricing center of gravity is shifting from “treating all input tokens equally” toward “rewarding reusable prefixes and constraining high-cost output.” The moderate increase in the cache-hit tier suggests that platforms want users to cache stable system prompts, tool descriptions, long-document prefixes, and similar content. The higher output price reflects the greater scarcity of latency, memory bandwidth, and concurrency resources during decoding. In other words, a price table is not just a billing table; it is also an externalization of cost structure and engineering constraints.

    Breaking Down the Three Price Tiers: Why Cache Hits Are Cheaper and Output Is More Expensive

    1. Uncached Input: Prefill Cost Remains, but Can Be Parallelized

    When input misses the cache, the model must complete prefill: encoding the prompt, performing attention computation, and building the KV cache. For long contexts, this computation is significant, but prefill can usually improve throughput through batching, parallel computation, and operator optimization. Therefore, although the uncached input tier rose, its increase is usually lower than that of the output tier.

    2. Cache-Hit Input: Reusing Prefixes Sharply Lowers Marginal Cost

    A cache hit means that stable content such as system prompts, tool definitions, and long-document prefixes has already completed prefill, and subsequent requests can reuse the existing KV cache. For high-frequency calls, fixed system prompts, and long-context agents, the cache hit rate directly determines the effective input price. In the example, the cache-hit tier rose from 1.1 yuan to 2 yuan—a moderate increase—indicating that the platform is encouraging a call pattern of “stable prefix + variable tail.”

    3. Output Decoding: Serial Generation Makes Bandwidth and Latency Costs More Prominent

    Output tokens are generated one token at a time through decoding, which is inherently more serial. The decoding stage is often constrained by memory bandwidth, KV cache reads and writes, batch scheduling, and latency targets, so resource consumption and scheduling difficulty per token are higher. It is therefore not surprising that the output tier rose most sharply. The price ratio between output and cache-hit input widening from 25x to 50x essentially prices output resources—which are highly latency-sensitive and have low parallelism—more expensively.

    Real Costs for Two User Types: Enterprise Agents vs. Individual Developers

    Looking only at unit prices can easily lead to misjudgment. A more reasonable approach is to calculate the blended cost per million tokens. Assume the input-output ratio is R, the cache hit rate is H, the uncached input price is P_miss, the cache-hit input price is P_hit, and the output price is P_out. Then:

    1. def blended_cost(input_output_ratio, cache_hit_rate,
    2. miss_price=20.0, hit_price=2.0, output_price=100.0):
    3. actual_input_price = hit_price * cache_hit_rate + miss_price * (1 - cache_hit_rate)
    4. total = (input_output_ratio * actual_input_price + output_price) / (input_output_ratio + 1)
    5. return actual_input_price, total
    6. # Enterprise long-context agent: input-output ratio about 20:1, cache hit rate 90%
    7. actual_in_1, total_1 = blended_cost(20, 0.9)
    8. # Actual input price about 3.8 yuan per million tokens; blended cost about 8.4 yuan per million tokens
    9. # Low-frequency individual developer: input-output ratio about 5:1, cache hit rate 20%
    10. actual_in_2, total_2 = blended_cost(5, 0.2)
    11. # Actual input price about 16.4 yuan per million tokens; blended cost about 30.3 yuan per million tokens

    Based on this example calculation, the enterprise agent scenario has an actual input price of about 3.8 yuan per million tokens and a blended cost of about 8.4 yuan per million tokens. The low-frequency developer scenario, where the prompt changes on every call, has an actual input price of about 16.4 yuan per million tokens and a blended cost of about 30.3 yuan per million tokens. Under the same model, the former’s unit cost is about one-third to one-quarter of the latter’s.

    This explains an apparently contradictory phenomenon: prices are rising across the board on the surface, but in practice this is tiered pricing. Enterprise customers that run the same system prompt for a long time, reuse prefixes heavily, and have a high input-output ratio receive something close to a “cache discount.” Individual developers who change prompts each time and have low cache hit rates bear a price closer to the full rate, or even a premium. For the platform, this structure both covers the real inference cost of long-context agents and uses caching to select more stable and predictable workloads.

    The Agent Era: Long Tasks Push Inference Costs to the Foreground

    In traditional question-answering scenarios, a single request has limited context and output, so unit-price increases are not strongly felt. In the agent era, however, task patterns have changed: it is not rare for a single task to involve thousands of tool calls, hundreds of thousands of tokens consumed, and hundreds of instances running in parallel for several days. The key cost of such tasks is not only “generating the final answer,” but also carrying historical context, tool returns, plans, and intermediate state in every round of tool calls.

    Long contexts introduce multiple costs: KV cache occupies GPU memory and grows with context length; the decoding stage must repeatedly read and write the cache, increasing bandwidth consumption; cache storage and eviction policies require additional memory management; and when multiple agents run in parallel, scheduling, batching, timeout, and retry mechanisms all amplify resource usage. If an early low-price strategy were still used, a single call might not cover the real cost on the inference side. Therefore, generational price increases are not simply commercial price hikes; they are the result of inference costs moving from “implicit” to “explicit” as long-task agents become widespread.

    Sparse MoE Architectures: Fewer Activated Parameters Does Not Mean Lower Total Cost

    New-generation models often use very large sparse MoE architectures: total parameters in the trillions, hundreds of experts, and only a small number of experts activated per token. Sparse activation can effectively control per-token computation, but it does not mean costs fall linearly. Resident memory for weights, communication overhead in expert routing, load balancing, operator fusion and kernel optimization, and implementation complexity under hybrid attention mechanisms are all real engineering costs.

    This is especially true in expert-parallel scenarios, where routing determines which experts tokens are dispatched to, and cross-device communication and batching efficiency directly affect throughput. The larger the total parameter count, the higher the pressure on weight storage and resident memory; the more experts there are, the more complex routing and communication become; and hybrid attention requires engineering trade-offs among different attention modes. These costs do not disappear because “fewer parameters are activated”; they shift from the compute side to storage, communication, and engineering optimization. The pricing structure—raising the output tier while treating the cache-hit tier relatively moderately—is a response to these cost structures.

    Cost Governance Recommendations for Developers

    First, treat cache hit rate as a core metric. Keep stable system prompts, tool descriptions, and long-document prefixes as early as possible and byte-stable, and place variable content at the tail. Second, control output length. Output has the highest unit price, so structured output, maximum length limits, early termination, and summary compression can significantly reduce costs. Third, optimize the input-output ratio. Long-context agents should reduce irrelevant history backfilling and use summaries, retrieval, and state compression. Fourth, evaluate models by cost per task, not only by price per million tokens; track task success rate, retry count, cache hit rate, and end-to-end cost. Fifth, distinguish online and offline workloads. Batch or shift latency-insensitive tasks to off-peak periods or batch processing to reduce consumption of latency-sensitive resources.

    Conclusion

    Generational price increases for LLM APIs should not be understood simply as “everything getting more expensive.” A more accurate judgment is this: the output tier rose significantly because decoding resources are scarce; the cache-hit tier rose relatively moderately because of reuse value; and the price gaps between uncached and cached input, and between output and cache-hit input, both widened. Enterprise agents achieve lower blended costs through high cache hit rates and high input-output ratios, while low-frequency developers whose prompts change frequently bear higher effective unit prices. Behind this are inference costs pushed up by long-task agents, long-context KV cache, sparse MoE communication, and engineering optimization. For developers, the real response is not to stare only at unit prices, but to build an engineering cost-governance system around cache reuse, output control, context compression, and cost per task.