How to Handle Multi-Fold LLM API Price Increases: A Practical Guide

    This article explains why a headline price hike can translate into a much larger bill, breaks down the three API pricing tiers (uncached input, cached input, and output), and shows how to read the cost impact from the ratio between tiers. It then presents four response strategies: raising cache hit rate, compressing input and output, tiered model routing, and observability with budget guardrails. Use it to keep LLM API spending under control after a price increase.

    1. The Symptom: Why One Price Change Feels Like a Multi-Fold Increase

    A typical pricing adjustment has recently appeared in the industry: for a certain AI coding tool, the previous-generation model’s output price was 27 CNY per million tokens, while the new generation is listed at 100 CNY. On the input side, the price moved from 6.5 CNY (cache miss) / 1.1 CNY (cache hit) to 20 CNY / 2 CNY. Looking at the list prices alone, output is close to 4x and input is roughly 3x. The “5x increase” often mentioned in headlines is more of a perceived description: when a workload is dominated by long outputs and low cache hit rates, the actual amplification on the bill is noticeably higher than the multiple on the list price.

    Start with one basic point: token billing is not a single price, but a bill composed of several tiers. Ignoring the tier structure and focusing only on unit prices makes it easy to misjudge the real cost change.

    2. Breaking Down the Pricing Tiers: Three Prices, Three Cost Meanings

    Mainstream LLM APIs usually split the cost into three tiers:

    • Uncached input: the full context is billed, and this is the main cost source for long-context scenarios.
    • Cached input (cache hit): a reused repeated prefix is billed at a lower price, significantly below the uncached rate.
    • Output: billed by generation length, usually the most expensive tier.

    Comparing the two generations by ratio reveals the vendor’s pricing intent:

    Ratio Previous generation New generation Change
    Uncached input / cached input ~6x ~10x Widened
    Output / cached input ~25x ~50x Widened

    The conclusion is clear: the cached-input tier rose relatively modestly, the output tier rose the most sharply, and the price gap between cache hit and cache miss was deliberately widened. In effect, the price signal tells developers to persist reusable context and to keep generation length as short as possible.

    3. Cost Model: Writing the Bill as a Formula

    Let P_in be the uncached input unit price, P_cache the cached input unit price, P_out the output unit price, I_u the number of uncached tokens, I_c the number of cached tokens, and O the number of output tokens. Then:

    1. Cost = I_u * P_in + I_c * P_cache + O * P_out

    Since P_out is usually tens of times P_cache, the bill is extremely sensitive to O. A rough but useful rule of thumb: when the output share is high and the cache hit rate is low, a price increase is amplified several times over; conversely, if the hit rate is high and outputs are short, the impact of the increase stays manageable.

    4. Strategy 1: Raise the Cache Hit Rate

    A cache hit is essentially about reusing a stable prefix. On the engineering side, three things need to be done:

    1. Stabilize the prefix: put fixed content such as the system prompt, tool descriptions, and examples at the very front, and do not insert volatile fields such as timestamps or random IDs.
    2. Reuse within a session: keep the prefix consistent across multiple turns in the same session, and avoid rewriting the context every turn.
    3. Isolate invalidation: place volatile content (user input, retrieval results) after the stable prefix.

    Illustrative structure:

    1. [Stable prefix: role setup + rules + fixed examples] <- eligible for cache reuse
    2. [Semi-stable section: retrieved material]
    3. [Volatile section: the current user question]

    A common mistake is to concatenate changing content at the front, which invalidates the entire prefix every time, drops the hit rate to zero, and settles the bill at the uncached price.

    5. Strategy 2: Compress Output and Input

    Output-side optimization:

    • Set explicit length constraints, ask for “conclusion first, details after,” and reduce lead-in generation.
    • Store reusable long results in a structured form, and read them directly next time instead of regenerating.
    • Return responses in streaming mode and split long tasks into small steps, making it easy to terminate low-value generation midway.

    Input-side optimization:

    • For retrieval augmentation, control the number of recalled items and the length of each fragment; deduplicate, truncate, and summarize before adding them to the context.
    • Apply rolling summarization to conversation history, keeping only decision-relevant information.
    • Remove repeated system instructions and redundant examples.

    6. Strategy 3: Model Tiering and Routing

    Not every request needs the most capable model. A three-tier routing scheme can be established:

    1. Intent recognition -> simple tasks go to a lightweight model
    2. -> routine tasks go to the main model
    3. -> complex reasoning / long-form generation goes to a high-capability model

    Combined with caching and summarization, the overall bill can often drop significantly, while the high-capability model is reserved for requests that truly need it.

    7. Strategy 4: Observability and Budget Guardrails

    The prerequisite for cost governance is visibility:

    • Log the three token tiers for every request via instrumentation, rather than recording only the total cost.
    • Set up budget alerts and rate-limiting thresholds, with automatic downgrade when usage spikes abnormally.
    • Use general cloud product capabilities such as monitoring and alerting, logging services, and message queues to build metering and dashboards.

    If you use Baidu AI Cloud, you can combine its general-category products to handle metering, alerting, and archiving, forming a closed loop.

    8. Conclusion

    A multi-fold price increase is not the problem itself; the problem is that the bill structure changed while the calling pattern did not. Get the three things right, cache hit rate, output length, and model selection, and the impact of the price increase can be effectively absorbed.