Decoding LLM API Pricing: Why Output Tokens Cost More and How to Control Your Bill
This article breaks down the billing logic behind recent large language model API price increases, focusing on why output tokens can cost many times more than input tokens and how cached prefixes reduce cost. It explains the three token categories used in usage-based billing, the technical drivers behind higher output prices, and practical engineering strategies such as prefix reuse, output compression, model routing, context governance, and observability. It also compares subscription quotas with pay-as-you-go pricing and ends with a selection checklist to help developers keep costs predictable across price changes.
1. The Signal: Output Prices Jumped Several Times Over, and Developers Noticed
A flagship large language model recently published a clearly revised price list: the output-side unit price rose roughly fivefold compared with the previous generation, reaching the level of about 100 RMB per million tokens. Input is priced at roughly one fifth of output, while the cached portion can be billed at around 1 RMB per million tokens. What triggered discussion was not the increase itself, but the fact that these numbers exposed the real cost structure of LLM services for the first time.
For developers, a model’s unit price is never an isolated number. The bill is determined by the product of three variables: call volume, the token composition of each request, and the cache hit rate. A price change only alters one coefficient, but if engineering has no control over the other two, cost swings get amplified. So instead of debating whether it is expensive, it is more useful to treat this adjustment as an occasion to revisit how usage-based billing actually works.
2. Inside the Billing Structure: Why Three Token Categories Differ by Up to 100x
Mainstream LLM APIs usually split a request into three categories with very different prices, because each corresponds to a completely different compute cost.
The first is input tokens: the prompt and context that the model reads. This requires one full forward pass, the cost is relatively controllable, and the unit price sits in the middle.
The second is output tokens, generated autoregressively one token at a time. Every new token requires recomputing over the entire existing context, cannot be parallelized, and compute consumption accumulates with sequence length. This is the fundamental reason output costs significantly more than input, and it is where this round of increases is concentrated. It also explains why bills for long-form summarization apps often far exceed expectations: their output volume is not small.
The third is the cached portion. When multiple requests share an identical prefix (a fixed system prompt, lengthy coding conventions, the body of a long document), the server can reuse the already computed intermediate state and skip the repeated forward pass, so this portion can be priced close to zero. The nearly 100x gap between the cache hit price and the output price is the biggest lever in cost optimization.
A schematic cost estimation can be written as:
def estimate_cost(in_tokens, out_tokens, cached_tokens,p_in=20, p_out=100, p_cache=1):# Unit price: RMB per million tokensreturn (in_tokens * p_in+ out_tokens * p_out+ cached_tokens * p_cache) / 1_000_000
As long as you push down out_tokens and cached_tokens, total cost can stay at the original level or even lower, even if the unit price rises several times.
3. The Technical Drivers Behind the Increase
From an engineering perspective, the rising cost on the output side is not purely a commercial decision; there are explainable technical reasons.
First, model size and activated parameter counts are growing. Flagship models are moving toward sparse, large-scale mixture-of-experts architectures with total parameter counts in the trillions. Although a single inference activates only a small fraction, memory footprint and scheduling complexity still rise with the total size.
Second, context windows are expanding. Million-token context means the intermediate state of attention computation grows substantially, and memory and bandwidth pressure in long-sequence scenarios is far higher than for short requests.
Third, compute demand is being reallocated toward the inference stage. As applications shift from “conversation” to “long-horizon task execution,” output length and the number of inference steps multiply, and the server must reserve more resources for sustained generation. That cost ultimately shows up in output pricing.
In other words, more expensive output is essentially the pricing mapping of “the model is more capable, and a single task consumes more resources.”
4. What to Do: Keep Cost Under Control on the Engineering Side
The actionable optimizations in the face of a price change are clear, and most are model-agnostic.
First, maximize prefix reuse. Pin stable content (role setup, output format constraints, domain conventions, reference documents) at the very front of the request and push variable parts as far back as possible. The more stable and longer the prefix, the higher the cache hit rate.
Second, compress output length. Use explicit format constraints, field whitelists, segmented generation, and result validation to avoid redundant explanations. Output is the most expensive side; a one percent reduction in output often outweighs a large optimization on the input side.
Third, use tiered routing. Classify tasks by difficulty: send simple classification, extraction, and rewriting to lightweight models or a rules engine, and reserve complex reasoning for the flagship model. A common industry practice is to maintain a routing layer that selects models of different tiers by task label.
Fourth, govern context. In retrieval-augmented scenarios, cap the number of retrieved chunks and their length, rerank and deduplicate before concatenation, and avoid stuffing large irrelevant passages into the context. This improves hit rate and lowers input cost at the same time.
Fifth, invest in observability first. Log input, output, and cache-hit token counts, latency, and result quality for every call, and set budget thresholds with monitoring and alerts. Without per-item metering, no optimization can be verified.
5. Subscription Quotas vs. Pay-as-You-Go
Beyond usage-based APIs, the market also commonly offers coding subscriptions that exchange a fixed monthly fee for a call quota, usually split into tiers, where higher tiers unlock stronger model tiers and larger quotas; some schemes also sell general chat entitlements separately from coding entitlements. This is not a replacement for pay-as-you-go but a match for different load curves.
Three rules of thumb:
- When load is stable and predictable and monthly call volume stays above a certain threshold, subscription quotas have a lower unit cost and suit day-to-day team development.
- When load is sparse, highly variable, or bursty in phases, pay-as-you-go is more economical and avoids paying for idle quota.
- Critically, confirm how quota is deducted: whether input and output are converted separately or unified into credits; whether cache hits count toward deduction; whether quota resets monthly or can be carried over. These rules often affect actual cost more than the price difference between tiers.
A practical approach is to run pay-as-you-go for one to two weeks first, collect the real token distribution, and then work backward to the subscription tier you should choose, rather than buying the highest tier on intuition.
6. Selection Checklist
Bringing the analysis together, here is a checklist you can apply directly:
- Determine whether your main cost sits on input or output; output-heavy scenarios are the most sensitive to increases.
- Verify whether your platform supports prefix caching, and confirm the hit determination rules and billing basis.
- Set up per-item metering and budget alerts so every call is attributable.
- Design tiered model routing so not every task lands on the flagship model.
- Compare the effective unit price of subscription quotas against pay-as-you-go, and decide with measured data rather than the price sheet.
- Watch the differences between context length tiers and the model tiers available within a plan, so you do not buy quota you cannot use at the tier you need.
A price adjustment itself is not frightening; an opaque cost structure is. Get token composition, cache hit rate, and model routing right, and developers hold the initiative through any round of price changes. If you need elastic compute plus supporting data storage, logging, and monitoring capabilities to underpin the above, you can look at the general cloud product capabilities offered by Baidu AI Cloud and combine them as needed.
