Why LLM API Bills Can Double at the Same Token Price
A practical guide to why identical per-token pricing still produces very different monthly LLM API bills, covering cache read/write asymmetry, batch and off-peak discounts, subscription plans, free quotas, and a unified cost model you can run across platforms.
Start With the Conclusion: Same Unit Price, Different Bill
Many teams compare LLM APIs by asking one question: how much per million tokens? But what actually determines the month-end bill is a set of four easily overlooked rules: how caching is billed, discounts for batch and asynchronous jobs, subscription plans with off-peak compute windows, and free quotas during a new model’s launch period. Once the pay-as-you-go unit prices across platforms are pulled to the same level, the price table stops being the differentiating variable. Billing methodology and how you call the API become the real variables.
One premise first: every unit price below is illustrative, used only to demonstrate the calculation method. None of them represent any specific vendor’s actual pricing. For a real project, check the official pricing page of the platform you choose for the current period, and re-verify before the billing cycle begins.
Breaking the Bill Into Five Calculable Factors
A reproducible cost model should include at least the following five items:
monthly cost = input tokens × input price+ cache write tokens × cache write price+ (input tokens - cache hit tokens) × uncached input price+ cache hit tokens × cache hit price+ output tokens × output price- free quota deduction- batch/off-peak discount
Illustrative unit prices (CNY per million tokens, input / cache hit / output):
| Model tier | Unit price |
|---|---|
| Flagship | 20 / 2 / 100 |
| Mid-tier | 13 / 1.3 / 68 |
| Lightweight code | 6.5 / 1.3 / 27 |
Output prices differ by roughly 3.7x across the three tiers, and input prices by roughly 3x. This means an extraction task built on long context and short output may have a completely different optimal tier than a generation task with short input and long output. The first step in model selection is not comparing prices, but measuring your own workload’s input-to-output ratio.
The Real Reasons Four Bills Differ by 2x
Cache: The Asymmetry Between Hit Price and Write Price
The common approach across mainstream platforms is to automatically enable caching for repeated prefixes, with a short default lifetime (often on the order of minutes), while allowing writes for longer time windows. Writes are billed separately, and once a hit occurs, only the hit price applies. The hit price is typically around one tenth of the input price, so the hit rate has an order-of-magnitude effect on the bill.
But caching is not a free lunch. If the prefix is unstable (timestamps, random IDs, or user nicknames placed at the very front of the system prompt), the cache will invalidate frequently, and write costs will push the total up instead. Practical points:
- Put stable content (system instructions, tool descriptions, long documents) first, and volatile content last;
- Control the TTL on writes: short windows for short tasks, long windows for long sessions;
- Monitor the ratio of hit rate to write volume; when the hit rate falls below a threshold, fix the prompt structure first rather than switching models.
# Pseudocode: put the stable prefix first to improve cache hit rateSYSTEM_STABLE = load_tool_spec() + load_long_doc() # stable, good for cachingdef build_prompt(user_input, ts):return SYSTEM_STABLE + f"\n[req_ts={ts}]\nuser question:{user_input}" # volatile content last
Batch and Async: A Discount You Can Get but Often Leave Idle
Some platforms offer a batch API at a percentage of the standard price (for example, 60%), in exchange for response times that shift from seconds to minutes or even hours. For offline batch jobs, log labeling, bulk translation, and offline evaluation set generation, still using the synchronous API means voluntarily giving up a 30-40% discount. The test is simple: if the result does not need to return within the user’s waiting window, it should go through asynchronous batch processing.
Subscriptions and Off-Peak Windows: Moving Peak Load Into the Trough
When call volume is stable and predictable, a subscription-style token package is often more cost-effective than pay-as-you-go, but it usually comes with coverage limits (only some models are covered) and off-peak rules (quotas may be consumed faster or be more generous during specific periods). This requires the engineering side to have task deferability: put non-real-time tasks in a queue and consume them in bulk during off-peak windows.
real-time path -> synchronous API, preserving quality and latencyoffline path -> message queue -> off-peak/batch consumption -> write results back to object storage
Supporting general cloud capabilities include message queues, object storage, container platforms, log services, and monitoring and alerting. Use them for peak shaving and cost attribution, without relying on any proprietary interface.
Free Quotas and Model Retirement: A One-Time Bonus and a Migration Cost
The million-token free quota common in a new model’s early launch period applies only to the current new model on the current bill. It is a one-time bonus and cannot be counted as a long-term baseline. The risk on the other side is version retirement: an old version first stops opening to new users, then is taken fully offline at a later date. If a business ties prompts, fine-tuning artifacts, and evaluation baselines to the old version, the migration itself is a hidden cost. The recommendation is to make the model identifier a configuration item in the architecture and keep a regression evaluation set.
A Calculation Script With a Unified Basis
def monthly_cost(in_tok, out_tok, hit_ratio, price, batch_ratio=0.0, free_tok=0):pin, phit, pout = pricehit = in_tok * hit_ratiomiss = in_tok - hitcost = (miss * pin + hit * phit + out_tok * pout) / 1_000_000cost *= (1 - batch_ratio) # batch discountreturn max(0.0, cost - free_tok / 1_000_000 * pin)
Key usage point: only when all platforms and all models go through the same function with the same input distribution can you reach comparable conclusions. The input distribution must come from real sampling, not guesswork.
Implementation Checklist
- Sample one week of real traffic, and measure the input-to-output ratio and prefix repetition rate;
- Run cross-calculations on candidate tiers and billing methodologies with the unified script, and output a range rather than a single point;
- Migrate all offline tasks to batch processing or off-peak windows;
- Set up three dashboard metrics (hit rate, write volume, cost per request) and configure budget alerts;
- Make the model identifier configurable, maintain a regression evaluation set, and reserve a buffer period for version migration.
Converging unit prices are a sign of a maturing industry, and the focus of competition has shifted from the listed price to billing structure and scheduling capability. Treat cost as an engineering variable you can design, rather than a fait accompli at month-end, and the bill becomes controllable.
