LLM API Price Hikes: A Breakdown of the Cost Logic Behind Token Pricing

    This article breaks down why a new LLM API price list is not a flat increase but a rebalancing of the pricing structure across uncached input, cached input, and output tiers. It introduces a cost model based on cache hit rate and input-to-output ratio, explains why prompt caching has become a pricing lever under disaggregated inference, why output tokens are the most expensive tier, and how sparse architectures shift fixed costs to memory and bandwidth. It also covers agent-era workloads and ends with a practical checklist for tracking and reducing real blended unit cost.

    1. The Phenomenon: Not a Across-the-Board Increase, but a Rebalancing of Pricing Tiers

    After a certain generation of large language model APIs published new prices, community discussion focused mostly on “how many times the price went up.” But if you split the price into three tiers—uncached input, cached input, and output—the conclusion is completely different: the output tier rose the steepest, uncached input came second, and the cached-input tier stayed relatively moderate. At the same time, two key ratios were pulled far apart: the ratio of uncached input to cached input widened from roughly 6x to roughly 10x, and the ratio of output to cached input widened from roughly 25x to roughly 50x.

    This shows that the essence of the increase is not a blanket rise in unit prices, but a redistribution of cost pressure onto the tier that consumes the most inference resources, while offering a near-discount channel through cache hits. For readers, what really needs to be calculated is not the list price, but the actual blended unit price under their own business profile.

    2. Cost Model: Three Variables Determine Your Real Bill

    Let the uncached input unit price be P_in_miss, the cached input unit price be P_in_hit, the output unit price be P_out, the cache hit rate be h, and the input-to-output ratio be r (input tokens / output tokens). Then:

    1. effective input unit price = h * P_in_hit + (1 - h) * P_in_miss
    2. blended unit cost = (r * effective input unit price + P_out) / (r + 1)

    Plugging in a set of illustrative values (P_in_miss=20, P_in_hit=2, P_out=100, in CNY per million tokens):

    • Enterprise long-context agent scenario: r≈20, h≈0.9 → input side≈3.8, blended≈8.4
    • Scattered, ad-hoc call scenario: r≈5, h≈0.2 → input side≈16.4, blended≈30.3

    Same model, same price list, and the former’s unit cost is about one-third to one-quarter of the latter’s. The gap does not come from the model, but from the calling pattern.

    3. Why Cache Hits Became a Pricing Lever

    Disaggregated inference architectures split prefill and decode across different resource pools, allowing prefix KV Cache to be reused across requests. In engineering terms, it is feasible to push hit rates for long system prompts and fixed tool descriptions to very high levels. But reuse brings memory residency and scheduling complexity, so pricing necessarily sets a significant spread between “hit” and “miss,” using price signals to guide callers to proactively converge their prefixes.

    Actionable optimization directions include: moving invariant content to the front as a stable prefix and placing volatile fields such as timestamps, random IDs, and user state at the end; controlling ordering jitter in tool definitions and retrieved snippets; and keeping prefixes byte-for-byte identical across multi-turn conversations to avoid any implicit rewriting that invalidates the cache.

    4. Why Output Is the Most Expensive

    During the decode stage, generating each token requires reading all activated weights and the context KV, making memory bandwidth the bottleneck, and it cannot be amortized through parallelism the way prefill can. The longer the context, the more attention and KV read/write overhead grows linearly or even super-linearly, which makes the output tier the most reasonable cost recovery point. The engineering implication is direct: compressing output, using structured short answers, and avoiding having the model restate long context are the highest-return ways to save money.

    5. The Cost Reality of Sparse Architectures

    A certain generation of models uses a sparse expert structure with trillions of total parameters while activating only a tiny fraction of them. Fewer activated parameters reduce per-token compute, but the weight scale that remains resident in memory, cross-device communication from expert routing, and operator optimization under the hybrid attention mechanism are all real fixed costs. Sparsification optimizes compute elasticity, not the memory and bandwidth bill, which explains why list prices can rise without violating cost fundamentals.

    6. Workload Characteristics in the Agent Era

    In the chat era, a single interaction involved only tens to a few thousand tokens, with low price sensitivity. In agent form, a single task may involve thousands of tool calls, accumulate hundreds of thousands of tokens, and support hundreds of instances running in parallel continuously for days. Under such workloads, cache hit rate and input-to-output ratio become the dominant items on the bill, and any prefix jitter is amplified into a considerable cost.

    7. Implementation Checklist

    1. Build a cost dashboard split by scenario, with dimensions including at least hit rate, input-to-output ratio, and average context length.
    2. Enforce governance of high-reuse prefixes, move volatile content to the end, and include hit rate in pre-release regression checks.
    3. Set length budgets and structured constraints on the output side to reduce redundant restatement.
    4. For long-context tasks, prioritize service forms that support prefix reuse and disaggregated inference, and pair them with logging services and monitoring alerts to track unit cost.
    5. On top of the general container and observability capabilities of platforms such as Baidu AI Cloud, build your own load-testing and cost-regression pipeline, and make selection decisions with data rather than list prices.

    Conclusion: The price list is only the starting point; hit rate and input-to-output ratio are the real coefficients of the bill. Engineering your calling pattern can still secure a structural discount during price-hike cycles.