Why LLM Inference Costs Keep Falling: A Practical Guide to Cache Hits, Peak Pricing, and Model Routing
This article examines why large language model inference prices have dropped so sharply, using published per-million-token pricing to break down four cost levers: prompt caching, asymmetric input/output pricing, off-peak discounts, and model tier routing. It shows how to structure prompts for cache hits, control output length, shift batch workloads to cheaper time windows, and make costs observable with a simple estimation function, followed by a seven-point checklist for building a low-cost architecture.
1. The Signal: The Price of a Unit of Intelligence Is Collapsing
Over the past two years, LLM API prices have fallen faster than most people expected. An annual AI index report from a university offers a representative data point: for a model that reaches the level of early conversational models on a general knowledge benchmark, the price per million tokens dropped from roughly $20 in late 2022 to $0.07 in October 2024 — about a 286x reduction.
The significance of this curve is not any single number. It is that “intelligence” has become a measurable, purchasable, optimizable shared resource. When the price falls by two orders of magnitude, engineering decisions change fundamentally: features that once required careful budgeting just to ship can now be enabled by default, and pipelines that once ran only in offline batch jobs can move into online request paths.
The decline has not stopped. A more refined approach has emerged in the market: one platform introduced peak/off-peak time-based pricing in mid-August 2026, then launched a lightweight model tier in early September and cut API prices further. According to its published figures, the lightweight model’s peak-hour input price per million tokens is 0.04 CNY on a cache hit and 2 CNY on a cache miss, with output at 8 CNY. The more capable flagship model is priced at 0.3 CNY, 9 CNY, and 27 CNY respectively. Both models cost half as much during off-peak hours.
These numbers carry a lot of information and deserve a closer look.
2. Breakdown: Four Cost Levers on the Bill
2.1 Cache Hits: The Most Underrated Lever
For the lightweight model, the gap between a cache hit and a cache miss on input is 50x (0.04 CNY vs 2 CNY). If your request prefix is highly repetitive — system prompts, tool definitions, long documents, few-shot examples — then repeated billing for that content can be almost entirely eliminated.
The engineering implication is clear: put stable, unchanging content at the front of the prompt and content that changes on every call at the end. This is an ordering rule dictated purely by cost structure, independent of model quality, yet it can produce order-of-magnitude differences.
A schematic layout:
[Stable prefix] System role + output format constraints + tool/function definitions + reference docs[Semi-stable] Few-shot examples, domain glossary[Variable suffix] Current user input, retrieved snippets, timestamps
Note that caching typically works on prefix matching, so a change anywhere in the middle can degrade everything after it to a cache miss. Keeping timestamps and random IDs at the end is therefore basic cost-engineering discipline.
2.2 Asymmetric Input and Output Pricing
Across the three tiers, output prices are generally 3–4x the cache-miss input price. This matches the computational nature of generation: input can be processed in parallel, while output must be decoded autoregressively token by token.
The corollary is that controlling output length is often more effective than compressing input. Asking the model for short structured results, limiting the number of fields, and avoiding redundant “long reasoning followed by a conclusion” phrasing all reduce the bill directly.
2.3 Peak/Off-Peak Pricing: Move Elastic Workloads to Cheaper Windows
Off-peak prices at half the peak rate are essentially a way of passing the data center’s resource utilization curve through to the application layer via price signals. Migratable workloads include offline summarization, batch labeling, nightly classification of logs and tickets, evaluation-set regression runs, and knowledge base reindexing.
What cannot be migrated is the online request a user is waiting on in real time. Architecturally, this means splitting the pipeline into a “real-time layer” and a “throughput layer,” each with its own calling strategy and budget.
2.4 Model Tiering: Don’t Use One Size for Everything
The price gap between the lightweight and flagship models is roughly 7–10x. The sensible approach is to add a routing layer: first classify intent and difficulty, send simple requests to the lightweight tier, and escalate to the flagship tier only for complex reasoning or long chains of tool calls. Routing itself can be implemented with rules, a small classifier, or a confidence threshold, avoiding the cost of an extra expensive call.
3. Method: Turn Cost into an Observable Metric
Cost optimization starts with visibility. At minimum, collect these dimensions:
- Input/output token counts and cached token counts per request;
- Number of calls per business action (for example, how many calls it takes to complete one ticket classification on average);
- Cache hit rate and retry failure rate;
- Share of calls in peak vs off-peak windows.
A minimal viable accounting function:
def estimate_cost(in_tokens, cached_tokens, out_tokens, peak=True):# Unit: CNY per million tokens; sample values illustrate the structure onlyin_price, cached_price, out_price = (2.0, 0.04, 8.0)if not peak:in_price, cached_price, out_price = (x / 2 for x in (in_price, cached_price, out_price))cost = (cached_tokens * cached_price+ (in_tokens - cached_tokens) * in_price+ out_tokens * out_price) / 1_000_000return cost
With this function, you can answer the key question: how much did a given optimization actually save. Optimizing prompts by feel is usually less effective than raising the hit rate from 20% to 70%.
4. Practice: Seven Rules for a Low-Cost Architecture
- Fix the prefix: keep stable content such as prompts, tool definitions, and documents at the front and manage it with version control, so frequent edits don’t break the cache.
- Tighten output: constrain length with structured output, separate “explanation” from “result,” and split into two calls when necessary.
- Prefer batching: merge non-real-time requests and use off-peak price windows.
- Route by tier: default to the lightweight tier, with explicit escalation conditions and a fallback strategy.
- Bound retries: cap retry counts and use exponential backoff so failures don’t inflate the bill.
- Budget guardrails: set token quotas and alert thresholds per tenant and per feature, with automatic degradation on abnormal growth.
- Reuse results: persist and reuse answers, summaries, and vectorized results for identical questions to avoid repeated computation.
On the cloud, these capabilities are typically provided by general-purpose product categories: object storage for reusable results and large documents, message queues for peak shaving and batch processing, container platforms for hosting routing and scheduling services, and logging plus monitoring and alerting for usage observability and threshold notifications. Baidu AI Cloud offers a full set of such general-purpose product categories that can be combined freely according to the architecture above.
5. Conclusion: From “Affordable” to “Accountable”
A two-order-of-magnitude price drop only moves the barrier out of the way; real competitiveness comes from an accurate understanding of cost structure. Cache hits set the floor for input cost, peak/off-peak distribution determines the discount along the time dimension, tiering sets the price per unit of work, and output length sets the ceiling for each interaction. Quantify, monitor, and automate these four things, and the cost of a unit of intelligence turns from an uncontrollable bill into a continuously optimizable engineering metric.
