Understanding LLM API Pricing: Why a 5x Price Increase Doesn't Mean a 5x Bill
A practical breakdown of LLM API billing logic, covering input, cached, and output token pricing, subscription versus pay-as-you-go trade-offs, and five engineering techniques to control costs after a flagship model price increase.
1. The Phenomenon: Flagship Prices Jump, But Bills Don’t Scale the Same Way
A pattern worth noting has emerged in the industry: a flagship LLM’s list price has risen several times over compared to the previous generation. Output is now around 100 RMB per million tokens, input around 20 RMB, and cache hits only around 1 RMB. At first glance this looks like a straightforward price increase, but attributing a real business bill usually tells a more complex story: unit price is the multiplier, while usage structure is the base.
To see why, break down where the tokens in a single request go. A call typically produces four billable quantities: uncached input (cold context), cache-hit input (reused prefix), output (generated content), and on some platforms a separately listed inference add-on (such as long-context surcharges or thinking tokens). The unit prices of these four can differ by one to two orders of magnitude, so there is no necessary relationship between “unit price up 5x” and “bill up 5x.”
A rough cost model looks like this:
# Single-request cost estimate (illustrative; refer to official pricing pages)def cost(req, price):return (req.prompt_tokens * price.input+ req.cached_tokens * price.cache_hit+ req.completion_tokens * price.output) / 1_000_000
As long as the cache hit rate is high enough and output share is kept under control, the increase from a higher unit price gets partly offset by structural optimization.
2. Pricing Logic for the Three Token Types: Why Output Is Most Expensive and Cache Is Cheapest
Output tokens are priced highest because the generation stage must run a serial forward pass token by token; it cannot be parallelized in one shot the way input can, so compute utilization is inherently lower. Output length is also decided autonomously by the model, meaning the provider bears the uncertainty risk.
Input tokens are priced in the middle because the prefill stage can be highly parallelized, yielding more output per unit of compute. Cache hits are cheapest, and the essence is a discount for “paying again for something already computed”: when a request prefix exactly matches prior content, its internal state can be reused directly, and only the new suffix needs recomputation.
There is an engineering implication here that is often overlooked: caching matches on the prefix. If a single character in the prefix changes (a timestamp, a random ID, a shifting system prompt), everything after it degrades to a cache miss. So caching gains are not “on by default,” they are “on only when the structure is right.”
High-hit prefix (stable):[system instructions][tool definitions][project conventions][fixed examples][new content this turn]Low-hit prefix (drift-prone):[system instructions][current time=...][random session ID][new content this turn]
3. Subscription Quotas vs. Pay-as-You-Go: Where the Cost Boundary Lies
Coding subscriptions aimed at code-writing scenarios typically bundle model access into fixed monthly tiers, where higher tiers unlock stronger models and larger quotas; some schemes also separate general chat entitlements from code entitlements. Open-platform pay-as-you-go charges strictly for what you use, which suits spiky traffic or scenarios needing precise accounting.
A simple decision rule:
# Monthly route selection (illustrative logic)break_even = subscription_price / (avg_cost_per_request * requests_per_month)# break_even < 1 -> subscription is more cost-effective# break_even > 1 -> pay-as-you-go is better, or pick a lower tier
In practice, high-frequency workloads with high context repetition, such as interactive coding and long-repository context, fit quota-based subscriptions better; batch jobs, offline evaluation, and occasional calls fit pay-as-you-go. A hybrid model (subscription covering daily baseline, pay-as-you-go absorbing peaks) usually gives most teams the lowest total cost.
4. Five Engineering Techniques to Absorb a Unit Price Increase
- Fix the context prefix. Put system instructions, tool descriptions, and coding conventions first and keep them stable; push volatile information to the end. Hit rates typically improve by an order of magnitude.
- Constrain output. Use explicit format and length constraints to cut wasted generation. Output tokens are the most expensive part, so compressing them pays off directly.
- Tiered model routing. Send simple classification, formatting, and completion to small or lightweight tiers; reserve the flagship tier for complex refactoring and long-horizon reasoning.
- Batching and asynchrony. Use batch channels for offline tasks, trading latency for price.
- End-to-end metering. Log input, cache hits, and output separately for every call, ship them to a logging service and monitoring alerts, and build a cost dashboard by business line and by feature.
# Minimal caller-side instrumentation (illustrative)usage = resp.usagemetrics.record({"input": usage.prompt_tokens,"cached": getattr(usage, "cached_tokens", 0),"output": usage.completion_tokens,"feature": "code_review",})
5. A Selection Checklist: Convert “Expensive” into “Cost per Unit of Output”
To evaluate whether any model generation is worth upgrading to, normalize everything to a single metric: cost per unit of effective output. Take the average number of calls and average token composition to complete a standard task (such as one bug fix or one module write-up), multiply by the corresponding unit prices, then divide by the first-pass success rate. When unit price rises but first-pass rate improves and rework drops, total cost can still fall; conversely, if the new model produces longer, more verbose output, the increase gets amplified.
Also, don’t treat the pricing page as the only input. Context limits, structured-output reliability, concurrency and rate-limit policies, how open the caching capability is, and quota accounting rules (whether thinking tokens count as output) all materially affect the bill, and should be confirmed against the latest official documentation.
6. Conclusion
A several-fold increase in flagship unit prices is the result of both capability upgrades and compute costs, but it does not mean usage cost rises proportionally. What truly determines the bill is token structure and reuse efficiency: stable prefixes drive high cache hit rates, controlled output compresses the most expensive part, tiered routing avoids using a sledgehammer to crack a nut, and subscription vs. pay-as-you-go split by workload characteristics. Get these four things solid, and cost per unit of output can stay flat or even decline even during a price-increase cycle.
