Why LLM API Bills Can Differ by 2x at the Same Unit Price
Identical per-token prices across cloud platforms do not guarantee identical bills. This article breaks LLM API billing into a computable model, compares on-demand, batch, and subscription pricing, highlights three commonly overlooked cost factors, and provides a reusable estimation workflow with sensitivity analysis to keep spending under control.
1. The Phenomenon: Same Unit Price, Bills That Differ by 2x
On the pricing pages of major cloud platforms, the pay-as-you-go rates for the same tier of model capability are often nearly identical. Input, cache-hit, and output prices per million tokens can match down to the last digit. Yet when you compare actual bills, two workloads with similar usage can end up with monthly spending that differs by almost 2x.
The reason is not the unit price but the billing rules. On-demand, batch, and subscription modes define completely different answers to three questions: when usage is charged, what discount applies, and how idle periods are billed.
So the first step in selecting a service is not comparing unit prices. It is decomposing the bill into a computable model. Comparing prices while ignoring rule differences is the most common starting point for cost overruns.
2. Write Down the Pricing Model First
Any model service’s monthly bill can be abstracted into four token categories and two discount factors:
monthly cost = input tokens × input price × d_in+ cache-hit tokens × hit price × d_cache+ cache-write tokens × write price+ output tokens × output price × d_outwhere d is the discount factor: on-demand = 1.0, batch ≈ 0.6, subscription prorated by quota coverage
Three conclusions follow. First, the output price is typically around 5x the input price, so the output share is the most sensitive item in the bill. Second, the cache-hit price is often one-tenth of the input price, so a stable prefix can create an order-of-magnitude difference. Third, the discount factor is determined by whether a task can be delayed, not by the vendor.
3. Where Each Billing Mode Fits
On-demand billing suits real-time paths such as online Q&A, code completion, and risk-control assistance. The advantages are zero upfront commitment and scaling with traffic. The drawback is that there is no discount at all, so a traffic peak translates directly into a bill peak.
Batch mode submits requests as offline jobs, usually with a separate completion deadline, and charges a set percentage of the standard price (commonly 60%). It fits deferrable scenarios such as log summarization, bulk labeling, offline evaluation, and historical data cleaning.
Subscription or resource-package mode charges a fixed upfront fee for a token quota. The quota covers part of the calls, and anything beyond it reverts to on-demand pricing. This mode also introduces an “idle-time rule”: scheduling deferrable calls into off-peak windows lowers unit cost further. Whether it pays off depends on two ratios: quota coverage and the share of deferrable calls.
4. Three Commonly Overlooked Cost Items
Cache billing details. Repeated prefixes usually enable caching automatically, with a very short default lifetime (often 5 minutes); after expiry the cache must be written again. Some model families bill cache writes separately by lifetime, and a hit is charged only the hit price. If the prefix is unstable or the interval between requests exceeds the lifetime, caching yields almost no benefit and only adds write overhead.
Version retirement and migration. Older model versions go through a cycle of “closed to new users, scheduled for retirement, migration recommended.” Hard-coding a version number in configuration means scheduling a forced rework in the future.
Regional differences. The same model may cost 5%–10% more outside the primary region, and cross-border calls add latency and compliance costs. Any multi-region disaster-recovery plan must budget for this premium.
5. A Reusable Estimation Workflow
Step 1, sampling: measure the real ratio of input, output, and cache-hit tokens over the past 7 days.
Step 2, classification: mark calls as real-time or deferrable to obtain the deferrable share p.
Step 3, compute three options: pure on-demand, batch, and subscription plus on-demand overage.
Step 4, sensitivity analysis: vary the output share and p by ±20% each and check whether the conclusion flips.
Sample implementation:
def estimate(inp, hit, out, p, mode, price=(20, 2, 100)):base = inp*price[0] + hit*price[1] + out*price[2]if mode == "on_demand":return baseif mode == "batch":return base * 0.6 # applies only to the deferrable portionquota = base * 0.8 # subscription quota coverage ratioidle = base * p * 0.5 # off-peak discountreturn quota + (base - quota) * 1.0 - idle
6. Optimization Checklist
Stabilize the prefix and control the interval between calls so the cache actually hits; place system prompts, tool definitions, and few-shot examples at the front and version them; summarize long documents before inference to compress input; use a smaller model for simple tasks such as classification and extraction, and reserve the high-tier model for complex reasoning; set output length limits and budget alerts; route deferrable tasks uniformly through batch or off-peak queues.
If a workload already runs on a cloud platform, connecting to a model service on the same platform can eliminate cross-network transfer and data-movement costs, with fees matching the vendor’s on-demand rates. Baidu AI Cloud likewise offers model services along with general capabilities such as container platforms, message queues, log services, and monitoring and alerting, making it easier to fit batch and off-peak scheduling into an existing architecture.
7. Conclusion
The same unit price does not mean the same cost. Build the pricing model first, then allocate traffic by the rule “real-time to on-demand, offline to batch, predictable load to subscription plus off-peak,” and finally validate with real sampling and sensitivity analysis. Bill differences usually come from whether these three steps are executed, not from which vendor you choose.
