How to Cut LLM API Costs When Token Prices Stay Flat
As newer general-purpose LLM APIs ship with higher benchmark scores but unchanged token prices, many teams still see their bills go up. This guide breaks down where the extra cost actually comes from, how to measure cost-effectiveness instead of leaderboard scores alone, and practical ways to control per-task spend with prompt caching, context layering, output constraints, unified evaluation, and tiered routing.
1. The Setup: The Price Didn’t Change, but the Bill Did
A pattern has become common across the industry: a new generation of general-purpose LLM posts clearly higher scores on capability evaluations, while the officially published token price stays exactly the same as the previous generation. On the surface this looks like pure upside, yet once teams actually add up the bill, many find that real spending has gone up.
The reason is not mysterious. The real cost of a single task can be approximated as:
cost per task ≈ input tokens × input price+ output tokens × output price+ (input tokens - cached tokens) × cache discount gap+ extra consumption from retries and failed requests
Unit price is only a coefficient in this formula. What actually determines the result is the number of tokens, the cache hit rate, and the number of retries. When a model “thinks longer and writes more,” a roughly 20% rise in output tokens is enough to cancel out the benefit of an unchanged unit price. That is the core technical problem this article addresses: how to keep per-task cost under control while capabilities keep improving.
2. Treat “Intelligence” and “Cost” as Two Separate Dimensions
The composite intelligence index from evaluation leaderboards is essentially a weighted roll-up of many capabilities. It answers “can the model get it right?” Per-task cost answers a different question: “how much does it cost to get it right once?” The two have to be looked at separately, or it is easy to draw the wrong conclusion.
In practice, it helps to introduce an internal metric:
cost-effectiveness = task success rate / average cost per task
Model selection only has a real basis when both the numerator (success rate) and the denominator (cost) are measured. Many teams compare leaderboard scores only, then discover after launch that two models with close scores can differ by tens of percent in per-task cost, while the gap in success rate is not significant within the range the business can accept.
3. Four Real Sources of Rising Cost
- Longer outputs. Stronger reasoning and more complete code completion naturally produce longer output, and the output price is usually significantly higher than the input price.
- Context bloat. In multi-turn agent tasks, historical messages, tool return values, and log fragments keep accumulating, so input tokens grow linearly or even faster.
- Retry amplification. Retries caused by failed requests, timeouts, or malformed output multiply a single call’s consumption by a factor greater than 1.
- Cache misses. Cache discounts are the highest-leverage optimization item, but they only take effect when the request prefix stays stable.
4. Practical Ways to Cut Cost
4.1 Turn Repeated Prefixes into a Discount with Caching
Cache-based billing usually requires the request prefix to be exactly identical, so stable content should go first and volatile content should go last:
[system prompt + tool definitions + long-term knowledge] <- stable prefix, aim for a cache hit[summary of conversation history][current user input + volatile fields such as timestamps] <- keep at the end
A common mistake is putting timestamps or random IDs at the beginning of the prompt, which makes the prefix different on every request so the cache can never hit.
4.2 Layer and Trim the Context
Split the context into three layers: a resident layer (system constraints), a session layer (rolling summary), and a retrieval layer (recall on demand). Replace original text with summaries in the session layer, and set item and character limits in the retrieval layer so that large blocks of raw data returned by tools do not go straight into the prompt.
4.3 Constrain Output Length
For structured output, use an explicit schema to constrain fields and length, reducing “free improvisation”:
{"max_items": 5,"max_chars_per_item": 200,"format": "json"}
At the same time, keep the “think first, then output” process within a necessary scope, and avoid unbounded reasoning chains that push output tokens up.
4.4 Standardize the Evaluation Setup
Internal evaluation must fix the same task set, the same temperature setting, and the same maximum output length, and must record four data points: success rate, average tokens, cache hit rate, and cost per task. When the setup is not consistent, any cost comparison is meaningless.
4.5 Tiered Routing
Send simple requests to smaller-parameter or lightweight models, and escalate only complex requests to higher-capability models. A routing layer that decides based on task type, input length, and historical success rate is one of the most effective engineering means of reducing average cost.
5. Selection Checklist
- Does capability clear the business threshold (look at success rate first, not a single leaderboard)?
- Is per-task cost predictable (watch the variance in output length)?
- Is cache-based billing supported, along with a stable prefix structure?
- Is there the context management needed for long-running tasks?
- Is there observability: logging services, monitoring and alerting, and cost attribution by task?
6. Conclusion
Capability upgrades plus an unchanged unit price do not automatically mean lower cost. What really determines the bill is the token structure, the cache hit rate, and the retry strategy. Keep measuring intelligence level and per-task cost as two separate dimensions, and combine caching, trimming, output constraints, and tiered routing to flatten the cost curve during the period of capability gains. The next stage of competition is likely not about who is smarter, but about who can make the cost of each call lower and more predictable at the same level of intelligence.
