How to Recalculate LLM API Cost Efficiency After a Price Increase
When an LLM provider changes its pricing, the model that looked cheapest can quickly lose its edge. This article explains how to break down token-based billing into input, cached input, and output costs, identify the factors that amplify spending, and tier model selection by cost sensitivity so you can compare real cost per completed task instead of price per token.
1. Why a Price Change Invalidates Earlier Model Choices
When a model provider adjusts its billing rates, the first casualty is usually not the budget sheet but the technical decision that was made on the assumption that one model was simply “cheaper.” The reason is straightforward: most teams evaluate cost by looking only at the price per million input tokens, while an actual bill is made up of three parts — input, cache hits, and output — and output is typically the most expensive segment. Once the price structure shifts, a model that previously looked like the best value can lose its advantage quickly, while a tier that was dismissed as too expensive can become attractive once caching and context strategies are optimized.
Cost efficiency, then, is not an inherent property of a model. It is the result of model unit price multiplied by the shape of your business calls. Any conclusion about cost efficiency that ignores call patterns is almost certain to be misleading.
2. Breaking Down Billing: A Three-Part Cost Model
mainstream LLM APIs are metered by token and distinguish three billing categories:
- Regular input: the prompt and context newly added in the current request;
- Cached input: the prefix portion that repeats from earlier requests and hits a server-side cache, usually priced well below regular input;
- Output: the completion generated by the model, typically several times the price of regular input.
The “output costs six times the input” observation in the original text is not an outlier but a common pricing gradient in the industry. This means that a classification task emitting only a few dozen words per turn and a task generating a long report can differ by an order of magnitude in cost per unit of business value, even on the same model.
A reusable estimation formula:
cost per call = input tokens / 1e6 * P_in+ cached tokens / 1e6 * P_cache+ output tokens / 1e6 * P_outeffective cost = cost per call / successful output per task
What belongs in the decision is the effective cost — what you pay to complete one deliverable task — not the token unit price.
3. Four Underestimated Cost Amplifiers
- Output length. Output carries the highest unit price and consumes latency during generation, so long-text scenarios should favor segmented generation and structured output constraints.
- Context redundancy. If system prompts, tool definitions, and conversation history are retransmitted in full every turn, input cost grows linearly with session length.
- Cache hit rate. Prompt design that keeps the prefix stable and pushes variable parts to the end can substantially raise cache reuse — the most easily overlooked way to cut cost.
- Failed retries. Timeouts, malformed output, and truncation all cause duplicate billing, so any chain with a high retry rate must be budgeted for.
4. Tiered Selection: Split Tasks by Cost Sensitivity
A practical approach is to divide business calls into three layers and match each with a different capability tier:
- High-value, low-frequency layer: complex reasoning, code generation, long-document understanding — choose the most capable tier; this layer usually accounts for the smallest share of cost;
- Middle layer: routine Q&A, summarization, structured extraction — choose a tier that balances capability and cost;
- High-concurrency, low-value layer: intent recognition, label classification, format validation — choose a cost-sensitive tier and compress output as much as possible.
Illustrative routing logic:
def route(task):if task.complexity >= 3 or task.output_tokens > 2000:return "high_capability"if task.category in ("classify", "extract", "validate"):return "cost_sensitive"return "balanced"
5. An Engineering Checklist for Lower Cost
- Prompt layering: put fixed content first and variable content last to improve cache reuse;
- Output constraints: use schema-based output to limit fields and length, reducing wasted tokens;
- Semantic caching: reuse results for frequent, similar requests and eliminate calls outright;
- Batching and asynchronous processing: schedule non-real-time work together to smooth out peaks;
- End-to-end metering: aggregate token consumption by business dimension in logging services and monitoring alerts to locate the callers driving cost.
In related practice at Baidu AI Cloud, the common recommendation is to wrap model calls in a unified gateway layer that centralizes routing, caching, rate limiting, and metering, so cost policies are not scattered across business code and hard to adjust.
6. Conclusion
A price change is only an external variable; what really determines long-term cost is call patterns and engineering constraints. Build a three-part cost model, select models in tiers by value, and treat caching and output length as first-class optimization targets — then you can recompute quickly and migrate smoothly whenever any tier’s price moves, instead of passively accepting the bill.
