Understanding LLM Tiered Pricing: Cost Optimization and Model Routing Practices
This article breaks down how tiered LLM pricing actually works and why per-token price alone is a poor selection criterion. It introduces a cost model separating non-cached input, cached input, and output tokens, then shows how a 20x cache price gap and a 5x output price gap reshape optimization priorities. You will find a practical routing framework across entry, mid, and high capability tiers, caching strategies for stable prefixes, output length controls, budget guardrails, observability metrics, and common pitfalls to avoid.
1. Background: Why Unit Price Alone Cannot Drive Model Selection
When building LLM-based business systems, teams most often make the mistake of treating the “price per million tokens” as the only decision factor. A real bill consists of three parts: non-cached input, cached input, and output. The tiered price structure given in the source material is very typical: the entry tier charges $1 per million input tokens, $0.05 for cached input, and $5 for output; the mid tier charges $2 for input and $10 for output; the high-capability tier charges $10 for input and $50 for output. The entry tier’s unit price is exactly one-half of the mid tier and one-tenth of the high-capability tier.
The key takeaway from these numbers is not “cheap,” but that there is a 20x price gap between cached and non-cached input, while output is always five times the input price. This means the first lever for cost optimization is cache hit rate, the second is output length control, and only the third is model tier selection.
2. Cost Model: Breaking the Bill into Optimizable Variables
Let the number of non-cached input tokens be I, cached input tokens be C, and output tokens be O. The cost of a single call can be abstracted as:
Cost = I * p_in + C * p_cache + O * p_outwhere p_cache ≈ 0.05 * p_in, p_out ≈ 5 * p_in
After substitution and simplification, an approximate relationship emerges: when the proportion of cacheable, reusable content in the input exceeds 80%, input-side cost drops by an order of magnitude, and output cost becomes the main expense instead. This explains a common phenomenon: for extraction tasks with long context and short answers, the bill is mainly determined by input; for generative writing and code generation tasks, the bill is mainly determined by output.
In engineering practice, each call should be recorded as structured log fields for later attribution:
record = {"task_id": task_id,"tier": "entry", # model tier label, not a specific model"input_tokens": I,"cached_tokens": C,"output_tokens": O,"cache_hit": C / max(I + C, 1),"cost": I * p_in + C * p_cache + O * p_out,}
3. A Decision Framework for Tier Selection
The three-tier price structure corresponds to a capability-cost gradient, not a simple “good vs. bad.” Routing is recommended across three dimensions:
- Task fault tolerance: closed tasks such as classification, format conversion, and field extraction have low fault tolerance and short outputs, making them suitable for the entry tier.
- Reasoning depth: multi-step reasoning, complex rewriting, and long-document understanding require the mid tier.
- Scarce capabilities: only high-difficulty code, complex math, and cross-modal understanding should use the high-capability tier, with strictly limited call ratios.
A practical routing sketch:
def route(task):if task.kind in ("extract", "classify", "format"):return "entry"if task.kind in ("reason", "rewrite"):return "mid"return "high" # requires human review + quota limits
It is important to emphasize that routing rules should be derived from an offline evaluation set, not subjective judgment. Maintain a regression set with standard answers, measure each tier’s accuracy and average output length, then compute “cost per correct result” and use it instead of unit price for decisions.
4. Caching Strategy: Using the 20x Price Gap Correctly
Cached input is cheaper because it reuses a stable, unchanged prefix. Cacheable content typically includes system instructions, tool definitions, domain knowledge snippets, a few examples, and long document bodies. Content that cannot be cached or yields very low benefit includes real-time user input, timestamps, random IDs, and retrieval results that change every time.
Practical points:
- Prefix stability: place variable parts at the end of the prompt to avoid prefix drift that invalidates the cache.
- Fixed order: the concatenation order of examples and knowledge snippets must remain stable; a change in order is equivalent to a change in content.
- Explicit labeling: clearly distinguish reusable context from newly added content in the request to make hit rate measurable.
- Hit rate monitoring: turn
cache_hitinto a monitored metric with an alert threshold; a sudden drop in hit rate usually means the template was modified.
5. Output Governance: Constraints for the 5x Price Gap
Since the output unit price is five times the input, output length must be explicitly constrained:
max_output_tokens = min(business-required length, budget cap / p_out)
Combined with structured output (fixed fields, enum values, limited item counts), redundant phrasing can be significantly compressed. For long-text generation, segmented generation plus paragraph-level review is more controllable than a single long output, and it is easier to abort before exceeding budget.
6. Budget Guardrails and Observability
Three layers of guardrails are recommended: estimate tokens and validate quotas before the call; set timeouts and output caps during the call; attribute cost to business lines, scenarios, and user segments after the call. Supporting metrics include cost per request, cache hit rate, average output length, fallback rate, and human review rate. Automatically falling back from the high-capability tier to the mid tier when its call share exceeds the threshold for a sustained period is the most effective automated way to control the bill.
7. Common Pitfalls
- Looking only at unit price while ignoring caching: in long-context scenarios, cost may be over- or underestimated by an order of magnitude.
- Using the high-capability tier for everything: cost increases tenfold, while the benefit is often concentrated in a few difficult samples.
- Switching tiers without regression evaluation: quality fluctuations are hard to localize, and rollback is costly.
- Lacking cost attribution: the bill cannot be assigned to teams, so there is little motivation to optimize.
8. Conclusion
The essence of tiered pricing is turning “capability” into an adjustable cost knob. The correct approach is to first build a reusable stable prefix to capture the caching benefit, then use output constraints to control the 5x price gap, and finally use evaluation-driven routing to limit the high-capability tier to the samples that truly need it. If an enterprise wants to solidify this method in its own environment, it can build cost attribution and quota guardrails on top of general capabilities such as container platforms, logging services, and monitoring alerts offered by Baidu AI Cloud, achieving a balance among quality, latency, and cost.
