LLM API Pricing Increased 5x: How to Calculate and Control Token Costs
This article breaks down a fivefold increase in LLM API pricing and shows how to evaluate its real impact on your bill. It explains the three-part token pricing model (input, output, and cache-hit tokens), why average token consumption per task matters more than unit price, how to assess subscription plans against pay-as-you-go, and a practical checklist for cost optimization through prefix stabilization, context trimming, output constraints, tiered routing, and observability.
1. The Situation: A New Generation of Models Comes With a Sharp Price Increase
When a recent next-generation general-purpose LLM became available, its API pricing rose roughly fivefold compared with the previous generation: about 100 (currency units) per million output tokens, about 20 per million input tokens, and about 1 per million cache-hit tokens. The change triggered broad discussion among developers: Is the increase justified? Are costs still controllable? This article does not evaluate any specific vendor or product. Instead, it frames the issue as a general engineering question: under token-based billing, how do you assess the impact of a model price change on business costs and make practical cost-optimization decisions?
2. Breaking Down the Billing Structure: A Three-Part Pricing Model
Most mainstream LLM APIs use three-part billing:
- Input tokens: prompts, context, retrieved snippets, and other content sent with the request;
- Output tokens: the content generated by the model;
- Cache-hit tokens: repeated prefixes (such as system prompts, long documents, or fixed knowledge blocks) that reuse a server-side cache and are billed at a significantly lower price.
Understanding the relative ratios among these three parts matters more than looking at unit prices alone. Using the prices above, the input-to-output unit price ratio is about 1:5, and the cache-hit-to-input ratio is about 1:20. This means: output length is a cost amplifier, while cache hits are the most effective cost lever.
A simplified model can estimate the cost of a single request:
cost per request = input tokens / 1e6 * 20+ output tokens / 1e6 * 100+ cache-hit tokens / 1e6 * 1
3. Real Cost Is Determined by Token Consumption per Task
Comparing unit prices alone leads to a one-sided conclusion. What actually determines the bill is average token consumption per task, which depends on the task type:
- Long-context document Q&A: heavy input-side consumption, high cache benefit;
- Code generation and rewriting: output-heavy, cost-sensitive;
- Multi-turn agent tasks: context accumulates repeatedly, making the cache hit rate a key variable.
Therefore, when assessing the impact of a price increase, first build a token profile of your own workload: record the proportions of input, output, and cache-hit tokens separately, then plug them into the new prices to get the real answer to “how many times more expensive is it?”
4. How to Evaluate Subscription Plan Value Correctly
The value of a subscription plan cannot be judged by the sticker price alone; it depends on the exchange ratio of “usable volume within the plan / plan price.” Evaluation steps:
- Calculate average historical consumption per task (including input, output, and cache);
- Estimate how many tasks the plan can support;
- Calculate “actual cost per task = plan price / supported tasks”;
- Compare it with the cost per task under pay-as-you-go and choose the lower one.
Only when the plan’s exchange ratio is high enough does it offer a competitive value proposition against pay-as-you-go; otherwise, prioritize pay-as-you-go combined with cache optimization.
5. Cost Optimization Checklist
- Prefix stabilization: Place system prompts, tool definitions, and fixed knowledge blocks at the front and keep them byte-for-byte stable to improve the cache hit rate;
- Context trimming: Compress retrieved snippets and remove redundancy in retrieval-augmented scenarios;
- Output constraints: Control output tokens through structured output and length limits;
- Tiered routing: Send simple tasks to smaller models and escalate only complex ones, avoiding a one-size-fits-all high-end configuration;
- Observability: Integrate logging and monitoring/alerting, and build dashboards and budget alerts for token consumption and cache hit rate.
6. Conclusion
A price increase itself is not the problem; invisible and uncontrollable costs are the problem. Developers should shift their focus from unit-price comparison to token-structure governance: quantify per-task consumption, improve cache hits, constrain output length, and set up budget alerts. If you need elastic compute and general cloud capabilities such as data storage and log monitoring, you can combine them on demand from general product categories on platforms like Baidu AI Cloud, keeping costs controllable and the architecture robust amid price fluctuations.
