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

    This article breaks down a generational LLM API price adjustment to show that the real change is not the headline rate but the relative multipliers between pricing tiers. It explains the three standard billing dimensions (uncached input, cached input, and output), provides a blended-cost formula based on cache hit rate and input-to-output ratio, and compares two scenarios to demonstrate how identical pricing yields very different effective costs. It also covers why agent workloads make legacy pricing unsustainable, why sparse architectures are not inherently cheaper, and a practical list of cost-optimization techniques.

    A Across-the-Board Price Hike: What Actually Changed

    Suppose a general-purpose LLM service completes a generational pricing adjustment: the output side rises from roughly CNY 27 to CNY 100 per million tokens, while the input side moves from about CNY 6.5 (cache miss) and CNY 1.1 (cache hit) to CNY 20 (miss) and CNY 2 (hit). At face value, this looks like a three-to-fourfold increase across the board. But once you decompose the pricing structure, a very different picture emerges: what the adjustment really changes is not the absolute price, but the relative multipliers between tiers.

    Tier Previous generation New generation Multiplier change
    Output ~CNY 27 CNY 100 ~3.7x
    Input (cache miss) ~CNY 6.5 CNY 20 ~3.1x
    Input (cache hit) ~CNY 1.1 CNY 2 ~1.8x
    Miss/hit ratio ~6x 10x Widened
    Output/hit ratio ~25x ~50x Widened

    The key signal is in the last two rows: the smallest increase applies to the cache-hit tier, the steepest to the output tier, and the price gap between them is systematically widened. This means pricing is shifting from an “averaged” model to a “structural” one—for the same model capability, the actual bill can differ severalfold depending on the calling pattern. For readers, what matters is not the price list itself, but understanding which tier their own usage falls into.

    A General Abstraction of Three-Tier Pricing

    Most inference services can be abstracted into three billing dimensions:

    • Uncached input: the full prompt must be recomputed in a forward pass, the most expensive case;
    • Cached input: the prefix reuses an existing KV Cache and only incremental computation is needed, the cheapest case;
    • Output: token-by-token autoregressive decoding, where every step reads all weights and the full history, creating the greatest memory-bandwidth and VRAM pressure.

    Let the hit rate be h, the uncached input price P_in, the cached input price P_cache, the output price P_out, and the input-to-output token ratio r. The effective unit cost can be written as:

    1. def blended_cost(P_in, P_cache, P_out, h, r):
    2. """Return the blended cost per million total tokens (CNY)."""
    3. in_price = P_cache * h + P_in * (1 - h) # expected input-side unit price
    4. return (r * in_price + P_out) / (r + 1) # weighted by input-to-output ratio

    This function has only two free variables: the hit rate h and the input-to-output ratio r. Together they fully determine the cost structure.

    Quantifying Two Scenarios

    Scenario A: enterprise-grade long-context agent. Input-to-output ratio around 20:1, heavy prefix reuse, hit rate around 90%.

    Expected input-side unit price ≈ 2×0.9 + 20×0.1 = CNY 3.8; blended cost ≈ (20×3.8 + 100)/21 ≈ CNY 8.4 per million tokens.

    Scenario B: individual developer making scattered calls. Input-to-output ratio around 5:1, a different prompt every time, hit rate around 20%.

    Expected input-side unit price ≈ 2×0.2 + 20×0.8 = CNY 16.4; blended cost ≈ (5×16.4 + 100)/6 ≈ CNY 30.3 per million tokens.

    Same model, same price list, yet A’s unit cost is roughly 1/3.6 of B’s. This is the “structural discount”: users who reuse a fixed system prompt and tool descriptions over the long term get the discounted rate, while users who rewrite context every time pay list price or even a premium. Understanding this is more practically valuable than arguing over “how many times the price went up.”

    Why Agent Workloads Make Legacy Pricing Unsustainable

    In conversational scenarios, a single interaction typically involves only tens to a few thousand tokens, so price swings have limited impact on the bill. Agent scenarios are entirely different: a single task may involve thousands of tool-calling steps, accumulate hundreds of thousands of tokens, and run with many agents in parallel, autonomously and continuously for days.

    The cost pressure of such workloads comes from three sources, all growing linearly or even super-linearly with context length:

    1. VRAM usage: the KV Cache must stay resident in VRAM for every concurrent session, the main bottleneck under long context;
    2. Decode bandwidth: every generated token requires moving all activation weights and historical cache, so memory bandwidth rather than compute becomes the ceiling;
    3. Scheduling and fragmentation: batching extremely long sequences is hard to saturate, lowering effective utilization.

    A common approach in industry technical blogs is a disaggregated inference architecture (decoupling prefill and decode, pooled cache scheduling) that pushes the hit rate for reusable prefixes above 90%. Once the hit rate becomes a first-class concern, pricing inevitably tilts toward the hit side—the fundamental reason the multipliers are being widened.

    The Real Cost of Sparse Architectures

    New-generation models are broadly moving toward massive sparsity: total parameters reach the trillion scale, yet each token activates only a tiny fraction of the experts (for example, a dozen or so out of thousands). Fewer activated parameters does not mean lower cost:

    • The weight footprint resident in VRAM grows with total parameters, independent of the activation volume;
    • Expert routing adds communication overhead, especially pronounced across nodes;
    • New mechanisms such as hybrid attention and linear attention require ongoing investment in operator implementation and kernel tuning.

    So “the activated parameters are tiny, therefore it should be cheaper” is a common misjudgment. Real cost is determined jointly by VRAM capacity, communication, and bandwidth.

    A Practical Optimization Checklist

    • Stable prefixes: fix the system prompt, tool schemas, and few-shot examples, organize them by block, and place variable content last;
    • Longer reuse windows: merge scattered requests and extend session and cache lifetimes;
    • Control output length: output carries the highest unit price, so structured short outputs and capped maximum generation length yield direct savings;
    • Tiered routing: send simple tasks to smaller models or rules, and call the flagship model only for complex tasks;
    • Observability: use logging services and monitoring alerts to track token consumption, hit rate, and unit cost by business dimension, attributing the bill to specific pipelines;
    • Capacity elasticity: use container platforms and message queues for peak shaving and asynchronous processing, avoiding paying for peak capacity year-round.

    Conclusion

    The essence of this price adjustment is not a simple increase, but a shift of the cost signal from “token count” to “context reuse capability.” For enterprise-grade long-context agent workloads, the effective unit cost may actually drop; for scattered calls with frequently changing prompts, cost rises noticeably. What readers should really do is treat hit rate and input-to-output ratio as first-class metrics in architecture design and continuously optimize with observable data, rather than fixating on the price list. For unified model serving and cost-governance capabilities, you can look into general-purpose model services and monitoring and logging product categories offered by providers such as Baidu AI Cloud.