The Cost Logic Behind Large Model API Price Increases

    This article breaks down why a large model API price increase is a structural repricing rather than a flat hike. Using a simple cost model built on cache hit rate and the input-to-output token ratio, it shows how the same price list can produce very different effective unit costs for different workloads, explains why agent-style traffic makes the old pricing unsustainable, and ends with a practical checklist for reducing token spend and guidance on model selection and architecture.

    1. What Happened: A Across-the-Board Price Adjustment

    After a model service launched its next-generation version, the price list moved up noticeably: the output rate is roughly four times the previous generation, the uncached input rate roughly three times, while the cache-hit tier rose more modestly. Read at face value, the conclusion seems obvious — it got more expensive.

    But if you lay out the ratios between tiers, a different picture emerges:

    • The ratio of uncached input price to cached input price widened from about 6x in the previous generation to about 10x;
    • The ratio of output price to cached input price widened from about 25x to about 50x.

    In other words, the increase is not uniform. It is a structural adjustment: workloads that depend heavily on reusing repeated prefixes see the smallest increase, while workloads that depend on fresh context and long outputs see the largest. To know whether you came out ahead or behind, you need two variables: the cache hit rate and the input-to-output ratio.

    2. Cost Model: Turning List Prices into an Effective Unit Price

    Let the uncached input unit price be $P{in}$, the cached input unit price be $P{hit}$, and the output unit price be $P_{out}$, with a cache hit rate of $h$. The effective input-side unit price is:

    1. P_in_eff = h * P_hit + (1 - h) * P_in

    Now let $r$ be the ratio of input to output tokens in a single request. The blended cost per million tokens becomes:

    1. C = (r * P_in_eff + P_out) / (r + 1)

    This formula explains a fact that is often overlooked: the blended cost is highly sensitive to the hit rate, and that sensitivity is amplified by r. When the input-to-output ratio is large (long context, short answers), the input side dominates the bill, and every point of hit rate improvement is multiplied by r.

    3. Worked Examples for Two Workload Types

    Scenario A: enterprise-grade coding/agent workloads. An input-to-output ratio of about 20:1, with long contexts where the prefix is heavily reused and the hit rate can exceed 90% (in disaggregated inference architectures used in the industry, hit rates in the 90% range for highly reused prefixes are common).

    1. P_in_eff = 2 * 0.9 + 20 * 0.1 = 3.8
    2. C = (20 * 3.8 + 100) / 21 ≈ 8.4 CNY per million tokens

    Scenario B: occasional individual developer workloads. Every prompt is different, the hit rate is only 20%, and the input-to-output ratio is 5:1.

    1. P_in_eff = 2 * 0.2 + 20 * 0.8 = 16.4
    2. C = (5 * 16.4 + 100) / 6 ≈ 30.3 CNY per million tokens

    Same model, same list price, and the first workload’s unit cost is roughly one third to one quarter of the second’s. The conclusion is clear: for high-reuse customers this adjustment is effectively a discount; for low-reuse customers it is the full price or even a premium. The pricing design uses price as a lever to push the cost pressure onto the traffic that is hardest to optimize through caching.

    4. Why the Increase Was Necessary: The Cost Structure of Agent Workloads

    In the chat era, a single interaction was only tens to a few thousand tokens, price sensitivity was low, and absolute amounts were small. The agent era is entirely different: a single task may involve thousands of tool calls, accumulate hundreds of thousands of tokens, and run hundreds of agents in parallel continuously for days.

    Inference cost does not fall linearly with token count. It rises along several dimensions at once:

    1. GPU memory usage: KV Cache grows with context length and concurrency, and in long-context scenarios a single request can occupy tens of times more memory than a short one;
    2. Bandwidth consumption: during decode, every generated token requires reading the entire KV history, a classic memory-bound workload where bandwidth rather than compute is often the bottleneck;
    3. Storage and scheduling overhead: prefix caches must be reused across requests, adding storage, eviction, and routing costs;
    4. Long-tail idle time: in multi-step tasks much of the time is spent waiting for tool responses, so instances stay occupied without producing tokens.

    Selling long-context, high-concurrency agent traffic at chat-era prices therefore does not hold up on unit economics. The new pricing essentially makes the “cache reuse dividend” explicit, rewarding customers willing to do the engineering work.

    5. A Cost Optimization Checklist for Developers

    • Stable prefixes: put the system prompt, tool definitions, and few-shot examples first and keep them byte-for-byte stable; avoid timestamps, random IDs, and dynamic ordering that break the prefix;
    • Ordering: place volatile content (user input, retrieval results) later and reusable long documents earlier;
    • Control output length: the output rate is typically several times the uncached input rate, so trimming redundant explanation and using structured output pays off significantly;
    • Do the math before raising the input-to-output ratio: the larger r is, the more you depend on the hit rate; do not pile on long context without a guaranteed hit rate;
    • Batching and asynchrony: schedule parallelizable subtasks together to reduce instance idle time;
    • Observability: instrument token usage, hit rate, and per-task cost, and use the formulas above for regression comparisons instead of looking only at list prices.

    6. Selection and Architecture Guidance

    Facing structural pricing, the rational move is not to switch models but to quantify your own workload profile first: measure the distribution of $r$ and $h$, plug them into the formula to get your real unit cost, and then decide what to optimize. If $h$ stays low over time, rework how prompts are organized first; if the $P_{out}$ term dominates the bill, prioritize output compression and splitting the workflow.

    On the implementation side, a combination of general-purpose cloud services can carry the load: object storage to hold reusable context material, a message queue to decouple tasks and smooth peaks, a container platform for elastic inference and batch processing, and logging plus monitoring and alerting to track token cost and hit rate trends over time. Baidu AI Cloud offers corresponding product categories for these general capabilities and can serve as the foundation for the architecture.

    To sum up: a higher list price does not mean a higher cost. What determines the bill is the shape of the workload, not the price sheet. Bringing cache hit rate and input-to-output ratio into day-to-day cost governance is the core method for controlling inference spend in the agent era.