LLM API Pricing Increased 5x: How Developers Can Build a Reproducible Cost Model
This article breaks down how a fivefold increase in LLM API pricing affects real bills, showing that unit price alone does not determine cost. It introduces a per-task cost formula covering input, output, cache-hit tokens, and retries, then explains how to use tier leverage, cache hit rates, output limits, model routing, and per-task evaluation to keep unit costs under control during a price-up cycle.
1. The Phenomenon: Higher Unit Prices and the “Multiple” Illusion
A recent new-generation release of a general-purpose LLM service raised API prices by roughly fivefold compared with the previous generation, reaching the order of 100 RMB per million output tokens, 20 RMB per million input tokens, and 1 RMB per million cache-hit tokens. The first reaction in most discussions is “how many times more expensive is it,” but that conclusion usually ignores two variables. First, unit-price baselines already differ by orders of magnitude across vendors. Second, a real bill is determined jointly by “unit price × usage structure,” not by unit price alone.
This article therefore does not evaluate any specific vendor or product. Instead, it abstracts the problem into a general engineering question: in an environment where inference unit prices are rising overall, how do you build a reproducible cost model and use architecture and invocation strategies to push the cost per unit of work back into an acceptable range?
2. Breaking Price Down into a Computable Cost Formula
The billing dimensions of mainstream LLM APIs typically include four categories: input tokens, output tokens, cache-hit tokens, and optional batch or long-context surcharges. The unit price for cache hits is significantly lower than for regular input, which directly reflects vendors encouraging prefix reuse and reducing repeated computation.
A practical single-task cost model looks like this:
Cost_task = (Tin - Tcache) * Pin+ Tcache * Pcache+ Tout * Pout+ N_retry * Cost_task // retry amplification term
Here Tin is total input tokens, Tcache is tokens served from cache, Pin/Pcache/Pout are the three unit prices, and N_retry is the average number of retries. This formula reveals a frequently overlooked fact: when the output unit price is five times the input unit price, output length is the dominant cost driver, and optimizing output is often more effective than compressing input.
Using the prices in the premise for an illustrative calculation (unit: RMB per million tokens, Pin=20, Pout=100, Pcache=1):
| Scenario | Input | Cache hit | Output | Cost per task |
|---|---|---|---|---|
| Short Q&A | 2k | 0 | 500 | 0.09 |
| Code generation | 8k | 6k | 2k | 0.24 |
| Long-document summarization | 30k | 20k | 3k | 0.50 |
| Multi-turn agent | 60k | 50k | 8k | 1.10 |
As the table shows, raising the cache hit rate from 0 to above 80% can cut the cost of long-input scenarios by several times, while growing output from 500 to 8,000 increases cost by more than ten times.
3. “Plan Quota Multiple” Is the Real Value Metric
Whether users perceive a service as expensive or cheap essentially comes from the leverage ratio between the subscription fee and the usable quota. If a tier costs 199 RMB and supports roughly 1,200 to 2,800 RMB of usage, the leverage is about 6 to 14 times. Mature offerings in the industry typically start at 20 times, meaning a 20 USD tier corresponds to hundreds of dollars of usage and a 200 USD tier corresponds to usage in the tens of thousands.
Defining this ratio as Leverage = usable quota / subscription fee yields a clear selection criterion:
Leverage < 10: suitable for low-frequency, low-risk assistive scenarios, not for a production main path;10 ≤ Leverage < 20: usable for small and medium workloads, with caching and rate limiting in place;Leverage ≥ 20: economically capable of supporting high-concurrency agent tasks.
In other words, only when a low tier offers more than 20x leverage and higher tiers scale quota linearly can a product compete with mainstream overseas offerings. This has nothing to do with benchmark rankings: benchmarks set the capability ceiling, while leverage determines the usable scale.
4. Cache Hit Rate: The Most Undervalued Cost Lever
The cache-hit unit price is only one twentieth of the regular input price, so improving the hit rate is the highest-return action. Engineering practices that can be implemented include:
- Prefix stabilization: keep the system prompt, tool definitions, and few-shot examples fixed at the very front of the request, and avoid letting volatile content such as timestamps or random IDs pollute the prefix.
- Prompt layering: concatenate a “stable layer, session layer, instant layer” in order so the stable layer stays byte-for-byte identical.
- In-session reuse: in multi-turn conversations and agent loops, history can be reused naturally instead of rewriting the context every turn.
- Batching and asynchrony: route non-real-time work through the batch channel, which usually comes with a lower unit price and looser latency constraints.
Illustrative code (pseudo-implementation, structure only):
def build_prompt(system_v1, history, user_input):# system_v1 is versioned and constant, keeping the prefix cacheablestable = system_v1session = render(history)instant = user_inputreturn stable + session + instant
5. Controlling Output Length and Retry Amplification
Because output carries the highest unit price, output governance should be a first-class concern:
- Use structured output to constrain fields and length instead of letting the model improvise;
- Set a
max_tokenscap and combine it with segmented generation, producing an outline first and then expanding section by section; - Cache reusable generation results (keyed by a content hash) to avoid paying twice;
- Suppress retry amplification: apply exponential backoff and a maximum retry count for timeouts and rate limits, keeping
N_retryunder 0.1.
6. Evaluate by Cost per Task, Not Unit Price per Million Tokens
For cross-vendor comparison, the correct approach is to fix a set of real business tasks, record the input, cache-hit, and output token distribution for each task, and then compute cost per task and cost per thousand invocations. Comparing unit prices alone leads to conclusions that contradict the bill, and comparing benchmarks alone ignores economics. Both must enter the selection matrix: capability, latency, cost per task, and quota leverage, weighted together.
7. Architecture-Level Cost Reduction
- Model routing: send simple intents to small models or rules and escalate complex tasks to large models, which noticeably dilutes average cost;
- Semantic caching: retrieve and reuse results for frequent similar requests via vector matching, where a higher hit rate translates directly into a lower bill;
- Context compression: replace full concatenation with summary-based history compression and retrieval augmentation;
- Observability: connect logging and monitoring with alerting, and build dashboards and threshold alerts for token consumption, cache hit rate, and cost per task to close the cost loop.
8. Conclusion
A fivefold increase in unit price is not enough on its own to judge whether a service is expensive. Three things matter: whether quota leverage reaches the 20x range, whether the cache hit rate can stay above 80%, and whether output length and retries are under control. If developers can formalize the cost formula, front-load caching, and make evaluation task-based, they can keep unit task cost under control during a price-up cycle. For cloud and model services in China, vendors such as Baidu AI Cloud offer combinations of general-purpose model services, object storage, logging, and monitoring with alerting that can serve as an optional engineering foundation for building the cost loop described above.
