LLM API Pricing Increased 5x: How to Calculate the Real Cost
A practical guide to understanding LLM API costs beyond unit price. Learn how token structure, cache hit rates, and model capability affect your bill, plus six optimization tactics and a neutral framework for comparing pricing plans.
1. The Phenomenon: A 5x Unit Price Does Not Mean a 5x Cost
A recent new-generation release of a general-purpose LLM service adjusted its API pricing to roughly five times that of the previous generation: about RMB 100 per million output tokens, about RMB 20 per million input tokens, and about RMB 1 per million cache-hit tokens. The announcement quickly split opinion into two camps: one calling it “outrageously expensive,” the other arguing that “the capability improved, so the higher price is justified.”
Both judgments stay at the unit-price level. For developers and enterprises, what actually determines the bill is not the unit price but the effective cost per task, which is shaped by three variables: the token consumption structure of a single task, the cache hit rate, and how sensitive the task is to model capability. Ignore these three points, and any “expensive or not” conclusion falls apart.
2. Breaking Down the Billing Structure: Three Token Types Are Not the Same Product
Mainstream LLM APIs typically price three token categories separately, and understanding the differences is the prerequisite for doing the math.
- Input tokens: prompts, system instructions, retrieved context, and conversation history all count. This is the largest cost source in long-context scenarios.
- Output tokens: model-generated content, usually at the highest unit price, because compute during inference grows linearly with generation length.
- Cache-hit tokens: for repeated input with an identical prefix, the server reuses the already-computed intermediate state, so the price can be as low as one-twentieth of the input price or even less.
An illustrative cost formula:
Cost per task =input tokens × input unit price+ output tokens × output unit price+ (1 - cache hit rate) × repeated prefix tokens × input unit price // the missed portion is charged at the input price+ cache-hit tokens × cache unit price
Key takeaway: a high output unit price does not mean a high total cost. A batch task with a very low output share and a very high cache hit rate may see total cost rise by only about 20% even if the unit price increases fivefold. Conversely, a generation task with long outputs and no repeated prefix will scale almost in lockstep with the unit price.
3. Why a New-Generation Model Can Charge More: An Engineering Explanation of the Capability Premium
Higher pricing usually corresponds to upgrades in inference architecture and training investment, with observable results: more reliable complex instruction following, fewer errors in long tool-call chains, and higher first-pass rates for code and structured output.
For engineering teams, this creates an easily overlooked “hidden cost offset”:
- A higher first-pass rate means fewer retries.
- Fewer retries mean less duplicated consumption of input and output tokens.
- Lower manual review and rework hours, which are often more expensive than the API bill itself.
So when evaluating a new model, compare the end-to-end total cost of completing the same batch of tasks, not the unit price.
4. Plans and Usage: Converting the “Multiplier” into Usable Engineering Volume
The original discussion noted that a certain subscription plan’s “consumable quota” is several times smaller than that of comparable overseas products, making it seem like poor value. This comparison needs a common basis, and three metrics are recommended:
- Quota multiplier = total consumable tokens in the plan ÷ plan price;
- Task capacity = total consumable tokens ÷ average tokens per task;
- Effective output = task capacity × first-pass rate.
Only when both the “quota multiplier” and the “effective output” approach or exceed the benchmark offering can product competitiveness be compared at all. If a RMB 99 tier only supports roughly RMB 2,000 to 5,000 of pay-as-you-go usage, and higher tiers support usage in the tens of thousands to hundreds of thousands of RMB, then there is a cost basis for competing head-on with overseas options.
5. Cost Optimization Checklist: Six Actions You Can Apply Immediately
- Stable prefix: keep system prompts, tool definitions, and few-shot examples fixed at the very front of the request to maximize cache hits.
- Context slimming: in retrieval-augmented scenarios, rerank and truncate first, keeping only the necessary fragments.
- Output constraints: use structured output and length limits to suppress redundant generation, since output tokens are often the most expensive.
- Tiered routing: send simple tasks to a smaller model and escalate to the large model only for complex tasks.
- Batching and async: run offline tasks off-peak and use batch interfaces for better pricing.
- Observability: build monitoring, alerts, and log dashboards for token consumption, cache hit rate, and cost per task.
# Pseudocode: tiered routing + cost estimationdef route(prompt, task_type):if task_type in ("classification", "extraction", "rewriting"):return small_model(prompt) # low-cost pathreturn large_model(prompt) # high-capability pathdef estimate_cost(in_tok, out_tok, cache_hit_tok, price):return (in_tok * price["in"]+ out_tok * price["out"]+ cache_hit_tok * price["cache"])
6. Neutral Selection Advice
In the general cloud services market, model offerings from different vendors differ markedly in unit price, caching mechanisms, and plan quotas. Three principles should hold when comparing: a unified token basis, a unified task sample, and a unified quality threshold. If an enterprise already uses Baidu AI Cloud capabilities, it can combine them with general product categories such as object storage, message queues, container platforms, log services, and monitoring and alerting to build a reusable model-invocation and cost-accounting pipeline, turning price fluctuations into measurable, optimizable engineering metrics.
7. Conclusion
A fivefold unit-price increase is a marketing-level number. The engineering-level answer is: figure out the token structure first, then talk about whether it is expensive. Whoever masters cache hit rates, context governance, and tiered routing will be able to push the bill back into a controllable range in the new pricing cycle.
