LLM API Price Hikes: The Real Compute Cost Logic Behind Token Pricing
This article explains why LLM API prices can rise even as per-unit compute costs fall, and why per-token price is a poor comparison baseline. It breaks down three-part pricing (input, output, cache hit), shows how cache hit rate often affects the bill more than model price, and explains why agentic coding consumption is driven by multi-turn plan-build-commit loops. It also covers subscription quota evaluation, a scenario-based model selection table, six cost-engineering practices, and a cost-controlled model invocation architecture on Baidu AI Cloud.
1. The Phenomenon: Unit Prices Rise While “Unit Costs Fall”
The industry has recently seen a seemingly contradictory pattern: a new generation of large-parameter models launched with public prices several times higher than the previous generation, reaching roughly RMB 100 per million output tokens, RMB 20 per million input tokens, and RMB 1 per million cache-hit tokens. At the same time, another batch of models with even larger parameter counts has been getting cheaper. Much of the discussion collapses into a simplistic conclusion: bigger models should be cheaper, so a price increase signals bad faith.
To understand this, you have to separate three variables: the token cost of a single call, the total tokens needed to complete a real task, and the effective output per unit of time. Unit price is only one component of the first variable. Parameter count determines the capability ceiling and the compute overhead of inference, but pricing also includes amortized R&D, inference cluster utilization, the memory and bandwidth pressure created by long contexts, and the cost of building the caching system. A larger model does not necessarily cost more per inference, because sparse architectures, more aggressive quantization, and more efficient operator implementations can all make a “bigger” model run “cheaper.”
So the right question about a price increase is not “why is it more expensive than the previous generation,” but: at the same task completion quality, is the total cost per deliverable unit going up or down?
2. Breaking Down the Pricing Structure: What Each of the Three Tiers Means
Most mainstream LLM APIs use three-part pricing, and understanding it is essential for cost control.
- Input price: covers prompts, system instructions, conversation history, and pasted code context. In coding scenarios, input tokens are usually the main source of consumption.
- Output price: typically several times the input price, because the generation phase is token-by-token autoregressive decoding that cannot be parallelized as heavily as prefill, so compute utilization is inherently lower. This is the fundamental reason output pricing is generally much higher than input pricing.
- Cache-hit price: when a request prefix exactly matches recent requests, the server can reuse the already-computed intermediate state and skip repeated prefill, so the price can be a fraction of the input price.
An illustrative cost estimation logic (numbers are for method demonstration only):
Cost per request ≈ input tokens × input unit price+ output tokens × output unit price+ uncached prefix tokens × (input unit price - cache hit unit price)
An often-overlooked conclusion: the cache hit rate usually affects the bill more than the model’s unit price does. A stable system prompt, a fixed repository description, and reusable tool definitions will keep hitting the cache as long as the prefix stays byte-for-byte identical. Conversely, prepending timestamps, random IDs, or dynamic retrieval results to the prompt invalidates the entire prefix and multiplies the cost.
3. The Real Cost Anchor: Why API Unit Price Is a Poor Baseline
For most developers, token-based APIs are unaffordable. The reason is simple: token consumption in agentic coding is not linear. It involves multi-turn loops of planning, building, and verification/commit, and each round resends a large amount of context to the model. A “seemingly simple” refactor may involve dozens of calls and millions of tokens.
A more practical approach is a subscription coding plan, budgeting by “quota” rather than “unit price.” Four metrics matter when evaluating one:
- The ratio of short-window quota to long-window quota. For example, if a plan’s long-window quota is only about one tenth consumed when the short window is exhausted, the long-window quota in practice only supports a few short windows.
- Context window utilization. The benefit of long context is fitting an entire module in one shot; the cost is that every request becomes more expensive.
- Task granularity. A lower-tier plan is reasonably positioned for one targeted optimization pass per day, not continuous full-day development.
- Response latency. Slow inference directly cancels out the efficiency gains from parallelism.
A reusable selection guide:
| Scenario characteristic | Recommended strategy |
|---|---|
| Budget-sensitive, clearly bounded tasks | Use a cost-effective model for routine coding, and route only the hardest modules to a stronger model |
| High demands on frontend and interaction detail | Favor model tiers with stronger multimodal and UI understanding |
| Already running a mature strong model as the main workhorse | The marginal benefit of adding an expensive plan is usually not obvious |
| Very large repositories, cross-file refactoring | Prioritize long context and cache-hit pricing |
4. Cost Engineering Practice: Six Ways to Bring the Bill Down
- Stable prefix: keep system instructions, coding standards, and directory descriptions at the very front of the prompt with no dynamic concatenation.
- Layered context: inject only the file fragments relevant to the current task, using retrieval instead of pasting everything.
- Output constraints: require structured, minimal diffs to reduce wasted generation.
- Task splitting: break large refactors into small, independently verifiable steps to avoid consumption piling up in long loops.
- Observability: connect logging and monitoring/alerting, and build dashboards for token consumption, cache hit rate, and task success rate.
- Hybrid scheduling: use a message or task queue for tiered dispatch, routing requests to models whose cost tier matches.
5. Cloud Implementation: A Cost-Controlled Model Invocation Architecture
When building such a system on Baidu AI Cloud, you can combine general-purpose capabilities: use a container platform to host the inference proxy and scheduling layer, object storage to hold code snapshots and build artifacts, a message queue to smooth peak requests, and logging plus monitoring/alerting for usage attribution. The key is to abstract “model invocation” into a replaceable backend, using a unified gateway for routing, rate limiting, cache prefix management, and retry on failure, so that a model price increase or replacement does not affect the business layer above.
6. Conclusion
A several-fold increase in unit price is not itself a basis for judgment. What really needs comparing is the total cost per completed deliverable task, a metric determined jointly by cache hit rate, context strategy, task-splitting granularity, and plan quota structure. Treat API price as an industry yardstick, treat subscription quota as the real budget, and keep optimizing with an observability system: that is the most robust engineering path under a budget constraint.
