Understanding LLM API Pricing: A Breakdown of the Billing Logic Behind Price Increases

    This article breaks down the billing logic behind recent price increases for flagship large language model APIs. It explains the three-part pricing structure—input, output, and cache hits—and why each tier has a different unit cost based on its underlying compute demands. Readers will learn how these price changes affect different usage patterns, and how to lower weighted token consumption through prefix caching, context management, output constraints, and tiered routing to make model selection a measurable engineering decision.

    1. The Phenomenon: Why the New Generation Price Shift Drew Attention

    Recently, a class of flagship large language models introduced a clear price increase in their latest generation: the output unit price is roughly five times that of the previous generation, while input and cache-hit prices were adjusted as well. This creates a magnitude structure of roughly “about a hundred per unit for output, about twenty for input, and about one for cache hits.” A developer’s first reaction is usually “prices went up,” but stopping at the numbers means missing more valuable information: this adjustment actually exposes the cost structure of large model services more clearly.

    To understand this, start with a basic premise: model service pricing does not charge per “call,” but per “the compute resources consumed within a call.” A single request contains at least three billable behaviors: reading existing context (input), generating new content (output), and hitting and reusing previously computed context (cache hits). The resource consumption of the three differs enormously, so their unit prices naturally do not sit in the same magnitude.

    2. Breaking Down the Billing Structure: The Resource Logic of Three-Tier Pricing

    2.1 Input: Compute-Intensive but Parallelizable

    The input stage requires a forward pass over the entire prompt. The compute roughly grows linearly with context length, but this step can be highly parallelized, so the unit cost is relatively controllable. When context grows from a few thousand tokens to hundreds of thousands, input cost scales linearly. This is the primary reason bills balloon in long-context scenarios.

    2.2 Output: Serial Generation, the Most Expensive Tier

    Output is generated token by token autoregressively. Each step depends on the previous one, making parallelization difficult, and it requires continuously occupying GPU memory and scheduling resources. Therefore, the output unit price is typically several times that of input. This round saw the largest increase on the output side, essentially pricing the most expensive resource truthfully.

    2.3 Cache Hits: Turning Repeated Computation into Cheap Reads

    If the prefix of the current request is exactly identical to a previous one, the system can directly reuse the already-computed intermediate results, only reading without computing. The cost is therefore an order of magnitude lower than normal input. The low cache-hit price is vendors using a price signal to encourage developers to adopt “stable prefix” engineering practices.

    An easy-to-understand illustration (expressing only magnitude relationships, not the pricing of any specific product):

    1. Total cost ≈ input tokens × input unit price
    2. + output tokens × output unit price
    3. + cached tokens × cache unit price

    3. The Impact of Price Increases on Real Bills: Who Is Affected Most

    Plugging the formula above into real workloads yields three profiles:

    • Short-interaction (Q&A, single-file completion): short context, short output, limited absolute cost increase, weakest perception.
    • Long-context (large repository understanding, long document analysis): enormous input token base; even with a mild input price increase, the total rises significantly.
    • High-generation (batch refactoring, test generation, document production): high output proportion, the group most directly affected by this adjustment.

    The conclusion is clear: price increases are not evenly distributed across scenarios. Selection and optimization must be based on your own token structure, not on unit price rankings.

    4. Strategy One: The Boundary Between Subscription and Pay-As-You-Go

    Two payment models are common in the industry: a fixed monthly fee in exchange for a quota (subscription), and paying for what you use (pay-as-you-go). Neither is absolutely better; the deciding factor is the predictability of your workload:

    • Stable workload, high daily call volume, fixed team size: subscription more easily turns cost into a budgetable fixed expense.
    • Highly variable workload with peaks and troughs, or a trial phase: pay-as-you-go is more flexible and avoids paying for idle quota.

    Note that subscription quotas are typically deducted by “weighted consumption,” where the output weight is higher than input, and cache hits carry the lowest weight. So for the same monthly fee, heavy-output usage will run out faster than long-input, low-output usage.

    5. Strategy Two: Lowering Weighted Consumption Through Engineering

    5.1 Improve Cache Hit Rate

    Place stable, unchanging content at the very front of the prompt: system instructions, tool definitions, code conventions, reference documents. Put the variable parts (user input, current file snippet) at the end. Once the prefix changes, the cache is invalidated.

    1. [Stable prefix] System role + conventions + long document
    2. [Variable suffix] Current question + code snippet to modify

    5.2 Govern Context Instead of Piling It On Endlessly

    First perform retrieval and filtering, sending only truly relevant snippets to the model; for long documents, use segmented summarization followed by aggregation; for conversation history, apply rolling compression. Every halving of context reduces input cost by roughly the same proportion.

    5.3 Control Output Length

    Clearly constrain output format and length, requiring only the changed snippet rather than the whole file; for batch tasks, validate on a small sample before scaling up, avoiding high-unit-price output being consumed by ineffective generation.

    5.4 Tiered Routing

    Route simple tasks to smaller, cheaper models or local rules, and send only complex reasoning to the flagship model. In engineering terms, run a lightweight classification first, then decide the routing target.

    6. Selection Checklist: Converting Price into Unit Business Cost

    Do not compare unit prices; compare “the cost of completing one business task”:

    1. Measure the input, output, and cache-hit token distribution of a typical task;
    2. Convert to single-task cost using a unified formula;
    3. Multiply by daily call volume to get a monthly baseline;
    4. Compare against subscription quota to determine the break-even point;
    5. Recalculate every quarter, because both models and prices iterate.

    7. Conclusion

    The price increase itself is not the problem; the problem is whether you understand what you are paying for. Break the bill into three parts—input, output, and cache—use cache reuse, context governance, output constraints, and tiered routing to bring down weighted consumption, and then choose between subscription and pay-as-you-go accordingly. Cost then shifts from an uncontrollable black box to an optimizable engineering metric. In the general practices of cloud platforms such as Baidu AI Cloud, combined with monitoring alerts, log analysis, and quota management, this approach can be further consolidated into a sustainable cost governance process.