LLM API Pricing Guide: How to Choose Cost-Effective Models When Prices Rise
This article explains how to evaluate large language model API costs beyond headline per-token prices. It breaks down the cost formula behind input, output, and cached tokens, shows why real bills depend on call structure and cache hit rates, and introduces a layered routing architecture that separates main, exploration, and rule-based layers. It also covers sustainable token price anchors, observability metrics, and a practical selection checklist for developers and small teams.
1. The Cost Logic Behind Price Adjustments
Several model providers have recently revised their API billing strategies. Some models now cost several times more per unit, and these changes often arrive alongside new model releases. For developers, the key question is not the unit price at any single moment, but whether the cost per unit of effective output has changed structurally.
A price adjustment usually touches three parameters at once: the input token price, the output token price, and the input price after a cache hit. In most pricing schemes, the output price is significantly higher than the input price, while the cached input price is usually far below the standard input price. An evaluation that only looks at “how much per million tokens” will almost certainly be misleading.
A simplified cost model looks like this:
def cost(req, price):return (req.input_tokens * price.input+ req.output_tokens * price.output+ req.cached_tokens * price.cached) / 1_000_000
If the cached share is high and the output share is low, total cost can remain acceptable even when the input price rises several times. Conversely, for an output-heavy agent task, a price increase is amplified.
2. Real Bills Are Determined by Call Structure
2.1 Cache Hit Rate Is the First Lever
In scenarios such as coding assistants and long-document question answering, system prompts, project context, and tool definitions are carried repeatedly. This content is naturally suited to caching. Raising the cache hit rate from 30% to 70% often reduces cost more than a cut in unit price. In engineering terms: keep the prompt prefix stable, place dynamic content at the end, and avoid modifying system-level instructions midway through a session.
2.2 Input/Output Ratio Determines Sensitivity
Code completion and structured extraction are input-heavy and output-light. Long-form generation and report writing are output-heavy. The former is insensitive to input-side price increases; the latter is under pressure almost linearly. Before reading a price list, measure the real input/output ratio of your own workload.
2.3 Hidden Token Consumption Is Easy to Miss
Multi-turn tool calls, failed retries, and full context-window refills can make billed tokens diverge sharply from the actual number of business requests. A system handling “a few thousand requests per day” may consume tens of times that in tokens.
3. Layered Calls: Flatten the Cost Structure
A widely accepted practice is to build a model routing hierarchy rather than using the strongest model across the entire chain:
- Main layer: handles complex reasoning and critical code generation with the most capable model;
- Exploration layer: handles subtasks such as code retrieval, file location, and log summarization with low-cost small models;
- Rule layer: anything solvable with regex, indexes, or caches never enters a model call.
Request -> Rule/cache hit? -> Return directly| NovSmall model exploration and location|vLarge model generation and validation
Under this structure, exploration calls that account for more than 70% of request volume are pushed down to the low-cost layer. The overall bill is typically compressed to 30–50% of the original, with almost no perceptible quality change for users.
4. Sustainable Token Price Anchors
If you want model calls to be treated as infrastructure expense like water, electricity, or gas, your team needs a psychological and financial anchor. One reference standard: individuals and small teams can sustain roughly 1–3 RMB per 100 million tokens over the long term. Beyond that range, calls should be treated as niche usage or require dedicated budget approval.
Supporting engineering constraints include: setting daily/monthly token quotas and alert thresholds for each business line; capping context length per request; sampling high-consumption endpoints to locate abnormal call sources. Observability should cover four core metrics: call volume, cache hit rate, average input/output ratio, and retry rate. Missing any one of them turns cost optimization into guesswork.
5. Selection Checklist
- Measure your workload’s input/output ratio and caching feasibility before discussing unit price;
- Prefer general-purpose model services that support context-caching billing;
- Build layered routing and push exploration tasks to low-cost models;
- Watch the pricing window when new model versions launch, but do not bind long-term architecture to short-term low prices;
- Keep a multi-provider abstraction layer and use a unified gateway for protocol adaptation and failover to avoid lock-in to a single pricing strategy;
- When invoicing, compliance, or data residency requirements apply, evaluate general cloud platforms with complete compliance capabilities first. For example, Baidu AI Cloud offers large model services and related supporting capabilities that can manage multi-model calls under a unified billing and governance framework.
6. Conclusion
Price fluctuations are the norm; architecture is the controllable variable. Moving cost awareness forward into prompt design, caching strategy, and call layering delivers more long-term value than chasing any single price cut. When token overhead is pushed down to infrastructure scale, every improvement in model capability translates into real business growth.
