LLM API Pricing Increased 5x: How Developers Can Calculate the Real Cost
This article breaks down how large language model API pricing is structured across input tokens, output tokens, and cached tokens, and explains why a higher unit price does not necessarily mean a proportionally higher bill. It introduces a reproducible cost model, shows how to measure cost per completed task, compares subscription plans with pay-as-you-go billing using a unified metric, and outlines four general cost-optimization techniques—prefix stabilization, context trimming, output constraints, and tiered routing. It also covers how to turn cost into an observable engineering metric with budget guardrails. The goal is to help developers replace unit-price comparisons with a four-dimension evaluation framework.
1. The Phenomenon: A 5x Unit Price Does Not Mean a 5x Bill
The industry has recently seen a notable price adjustment: a new generation of a general-purpose LLM service raised its output-side unit price to roughly five times that of the previous generation, raised the input side as well, and kept cached hits at a very low price. Community discussion quickly split into two camps. One argues the price is justified because the model ranks near the top on public benchmark leaderboards. The other converts subscription plan usage into an equivalent figure and concludes it is far more expensive than comparable overseas services.
The root of the dispute is that three fundamentally different things are being measured with the same ruler: unit price (per 1K tokens), subscription plan (per month), and normalized usage (per task). There is no fixed conversion relationship among them, so any cross-product “expensive/cheap” conclusion is essentially invalid unless the measurement basis is stated first. This article does not evaluate any specific product. Instead, it abstracts the pricing structure into a general model and provides a reproducible cost-estimation method.
2. Breaking Down the Billing Structure: Three Units Decide the Real Bill
Billing for mainstream LLM services usually consists of three parts:
- Input tokens: prompts, system instructions, retrieved context, and conversation history all count.
- Output tokens: generated content, usually priced several times higher than input because the generation stage cannot be parallelized.
- Cached-hit tokens: requests with an identical prefix can reuse intermediate computation results, often at one-tenth the normal input price or lower.
Key takeaway: the output unit price is the most sensitive variable, and the cache hit rate is the most easily overlooked lever. In coding and AI Agent tasks, output is often hundreds to thousands of tokens, while input can reach tens of thousands of tokens because context is repeatedly carried along. In that case, the cache hit rate can affect the bill even more than the unit price itself.
An illustrative cost model can be written as:
def cost(tokens_in, tokens_out, cached_in,p_in, p_out, p_cache, unit=1_000_000):return (tokens_in - cached_in) * p_in / unit \+ tokens_out * p_out / unit \+ cached_in * p_cache / unit
Note that cached_in is the portion deducted from the input, not an additional discount. Many teams make estimation errors by treating caching as a “cashback,” which skews their budgets.
3. Why “Third on the Leaderboard” Does Not Imply “Reasonable Pricing”
Leaderboard rankings measure the upper bound of capability, while the bill determines the cost of acquiring a unit of that capability. The correct metric that connects the two is cost per completed task—the average amount of money spent to complete one acceptance-ready task.
Calculating it requires three quantities: average input per task, average output per task, and cache hit rate. Empirically, AI Agent tasks consume significantly more than single-turn Q&A because they involve multiple tool calls, retries after failures, and accumulating context. So it is not contradictory that “one product’s per-task consumption is close to that of a more expensive product”: a lower unit price combined with more consumption can leave total cost flat or even higher.
The rigorous approach is to build your own evaluation set first, then measure:
cost per task = Σ(input/output/cached tokens per request × corresponding unit price) / number of completed tasks
Only this number is comparable across options.
4. Subscription Plans vs. Pay-As-You-Go: Do Not Compare Sticker Prices Directly
A subscription is essentially a prepaid discount plus a usage cap, while pay-as-you-go is essentially linear cost with no cap. Comparing the two requires normalizing to two dimensions: “usable tokens obtained per unit of currency” and “whether the peak is throttled.”
Let the plan price be S and the normalized usage be U; the value ratio is U/S. If a plan priced at 199 corresponds to 1,200–2,800 in pay-as-you-go credit, the discount multiple is roughly 6–14x; if 99 corresponds to 2,000–5,000 in credit, the discount multiple is roughly 20–50x. A gap this large in discount multiples is the real source of “product strength” differences, not the unit-price number.
Also evaluate non-price constraints: concurrency limits, context-length limits, peak-hour queuing, and degradation policies after exceeding the cap. Under load testing, these constraints often become bottlenecks before price does.
5. Four General Cost-Optimization Techniques
- Prefix stabilization: Put the system prompt, tool definitions, and fixed examples at the very front and avoid dynamic concatenation, maximizing cache hits. Avoid inserting timestamps or random IDs at the start of the prompt.
- Context trimming: Use retrieval instead of full injection, truncate history by relevance, and set a token budget cap.
- Output constraints: Use structured output and explicit word or field limits to compress generation length; this has the most direct effect on the output side.
- Tiered routing: Send simple tasks to a smaller model or rule-based logic, and call the high-capability model only for complex tasks.
def route(task):if task.complexity < 0.3:return "small_model"return "flagship_model"
6. Budget Guardrails: Turn Cost into an Observable Metric
Cost governance needs to be engineered, not reviewed once a month when the bill arrives:
- Log the token triple and cost for every call at the request layer, and write them to a logging service;
- Configure daily budgets, per-task budgets, and abnormal-growth alerts with monitoring and alerting;
- Set a cap on retries for failed requests to avoid retry storms amplifying cost;
- Periodically re-measure cost per completed task as a hard metric for model-selection reviews.
7. Conclusion
A price adjustment is not the problem in itself—inconsistent measurement bases are the source of decision-making errors. Developers should abandon the intuition of “unit-price comparison” and shift to a four-dimension evaluation framework: cost per completed task + cache hit rate + plan discount multiple + concurrency constraints. Only if an option offers a high discount multiple and stable cache hits under a low-barrier plan does it truly have a cost basis to compete with higher-priced options; otherwise, even the highest leaderboard ranking can hardly translate into sustainable engineering returns.
