LLM API Pricing Doubled? The Real Cost Drivers Behind Token Bills
This article breaks down why LLM API list prices can rise sharply while the actual user experience changes far less, and what really determines the bill. It explains the four token categories in usage-based billing (input, output, cache-hit, and cache-write), why subscription quotas make sticker prices misleading, and why coding and agent workloads are the most price-sensitive. It also covers practical cost controls: stabilizing prefixes to maximize cache hits, compressing output, tiered model routing, usage observability, and keeping a replaceable abstraction layer, plus a short decision checklist.
1. The Phenomenon: List Prices Rise, but the Experience May Not Move With Them
A certain class of large-parameter models has recently raised its public pricing noticeably: compared with the previous generation, output-side prices are up roughly fivefold, input-side prices have risen as well, and the cached portion remains at a very low level. Once a price structure like this is published, the most common reaction in discussion threads is “we can’t afford this anymore.” But if you factor in the quota you can actually use inside a subscription plan, the periodic reset mechanism, and the limits that keep different feature pools separate, the conclusion is often more nuanced: the gap in sticker prices gets compressed quickly, and the divergence between the real user experience and the sticker price is larger than you might expect.
To understand this, start by unpacking the word “price.” The published unit price is a retail reference price aimed at ad hoc calls and elastic scaling. Most heavy users, however, go through a subscription channel and receive a bundled quota instead. The denominators of these two systems are different, so comparing them directly is bound to be misleading.
2. Pricing Structure: Four Token Types, Four Costs
Mainstream usage-based billing typically splits a single request into four metering units, and each one corresponds to a different real resource cost.
- Input tokens: a full forward pass is required, so this is the most expensive.
- Output tokens: generated autoregressively token by token, with no parallelism, while continuously reading the entire history context, so the unit price is usually significantly higher than input.
- Cache-hit tokens: the prefix is already reused on the system side, eliminating repeated computation, so the price can be one to two orders of magnitude lower.
- Tokens written to cache: establishing the reuse relationship for the first time incurs extra overhead, generally priced slightly above ordinary input.
This explains why “output costs several times more than input” is the norm rather than an anomaly. It also explains why the cache-hit price is pushed so low: what vendors really want to encourage is letting repeated, stable prefixes settle, trading a single write for long-term low-cost reads.
A simplified cost estimate can be written as:
def estimate_cost(in_tok, out_tok, cached_tok, price):# price is the unit price per million tokens, in CNYreturn (in_tok * price["in"] / 1_000_000+ out_tok * price["out"] / 1_000_000+ cached_tok* price["cached"] / 1_000_000)
What really determines the bill is the ratio of out_tok to cached_tok, not the unit price itself.
3. Why Subscription Quotas Make Sticker Prices Misleading
The point of a subscription is not that it is cheap, but that it moves uncertainty from the bill to the quota. It brings three constraints that are easy to overlook.
First, the quota is finite and resets. Periodic resets mean you may hit a state of “no quota available” during peak times, while usage-based billing is still usable at the same moment, just at a cost. The value of availability is hard to reflect in a unit price.
Second, different features often belong to separate, independent quota pools. If conversational interaction and agentic coding are metered separately, the total actually available is clearly smaller than the “one big pool” users intuitively assume.
Third, temporary changes on the operations side directly alter the experience. Frequent resets, limited-time promotions, and regional differences can turn “the sticker price is cheap” into “you can’t even get in line” within a week.
So a more rigorous comparison is to convert to cost per unit of effective output: plug in the quota ceiling, reset frequency, number of pools, and throttling probability, then divide by the amount of coding or Q&A work you actually complete.
4. Why Coding Workloads Are the Most Price-Sensitive
Coding and agent tasks have three characteristics that amplify cost:
- Extremely long context. Repository structure, dependency lists, and prior conversation stack up, so a single request can easily reach tens of thousands of tokens.
- A high output share. Generating code, patches, and test cases all produce long outputs, which land precisely on the most expensive metering item.
- Frequent retries. If one attempt fails, you run it again, and failed requests are billed too.
The conclusion is direct: in this scenario, the cache hit rate and output length control matter far more than differences after the decimal point in the unit price.
5. Practical Optimization Techniques
5.1 Stable Prefixes, Maximum Cache Hits
Put unchanging content at the front: system instructions, tool definitions, project conventions, directory descriptions. Put changing content at the back. Illustration:
[stable zone] system role + coding standards + directory tree + dependency versions[semi-stable zone] current module description[changing zone] this round's user question and incremental code
Change the order, and the cache may be invalidated in its entirety. This is the single most common cause of an out-of-control bill.
5.2 Compress Output
Ask for minimal-change patches instead of full-file rewrites; constrain the return scope; split large tasks into multiple smaller rounds. Cut the output in half, and the most expensive item drops by half.
5.3 Tiered Routing
Send simple completions to a small-parameter model or a local completion approach, and reserve the large-parameter model for complex refactoring. A rule-based or lightweight classifier as a front gate can usually cut most of the high-priced calls.
5.4 Build Usage Observability
At minimum, record the four token counts per request, the cache hit rate, the number of failed retries, and task success or failure. Without this data, any model selection is a guess.
request_id | in | out | cached | hit_ratio | retries | success
5.5 Keep a Replaceable Abstraction Layer
Wrap model calls behind a unified interface so that switching providers only changes configuration. When pricing and quota policies change frequently, replaceability is itself a cost advantage. In related practice at Baidu AI Cloud, this combination of “unified access + monitoring and alerting + log retention” is a general engineering approach that applies to any backend.
6. Selection Decision Checklist
- What is your output-to-input ratio? Above 3, and you should focus on optimizing output.
- Is the prefix stable? If not, you won’t capture the cache dividend.
- Do you depend on periodically reset quotas? If so, prepare a fallback path for peak throttling.
- Are you carved up by independent quota pools? Merge the statistics before calculating the real available amount.
- Is there failure-retry amplification? Add caps and backoff.
7. Conclusion
A doubled unit price is a signal, not a verdict. What really determines cost is four variables: cache hit rate, output length, retry rate, and quota availability. Bring them into an observability system, then use a unified abstraction layer to preserve room to switch, and price fluctuations turn from a risk into a manageable engineering parameter.
