Why LLM API Bills Can Differ by 2x at the Same Unit Price
Many teams assume that identical per-token pricing across cloud providers should produce identical bills. This article explains why bills still vary widely, breaking down the four variables behind a monthly LLM API bill and the three common pricing models: pay-as-you-go, batch discounts, and subscription plans with off-peak rules. It also shows how to build a usage profile for cost attribution, outlines three practical optimization paths, and covers hidden levers such as prefix caching and free token allowances. Readers will learn where the real cost differences come from and how to prioritize model tier selection, batching, and traffic scheduling.
1. The Problem: Same Unit Price, Different Bills
In practice, one fact is often overlooked: multiple cloud providers list nearly identical pay-as-you-go rates for the same model family. Input, cache-hit, and output prices often match to the last digit. So why do two teams with similar workloads end up with monthly bills that differ by almost 2x?
The answer is not the unit price, but how the pricing rules combine. Break a bill down to its components, and it is determined by four variables:
Monthly bill = Σ(input tokens × input price)+ Σ(output tokens × output price)+ Σ(cache-hit tokens × hit price)+ cache-write tokens × write price- discounts/credits (batch, free tier, subscription)
The unit price is only a coefficient in the formula. What actually drives the gap is the discount terms and the billing scope. Three common rule types exist in the industry: pay-as-you-go, batch (asynchronous offline) discounts, and subscription plans (including off-peak rules). Once these are combined, the same call distribution can produce very different results.
2. How the Three Pricing Models Work
1. Pay-as-you-go: uniform scope, minimal variance
Pay-as-you-go is the easiest model to compare across providers, since they typically use the same price sheet. Selection at this layer therefore yields limited savings. Note that prices across model tiers (flagship, Pro, code) can differ by several times, so model choice affects the bill far more than platform choice.
2. Batch discounts: trading latency for cost
Batch processing targets offline tasks that can tolerate minute-level to hour-level latency. It is usually billed at a fixed fraction of the standard price (commonly around 60%). In essence, it trades response latency for cost, making it suitable for log summarization, bulk labeling, offline quality checks, and data cleaning. Not every provider offers this capability; when documentation is unclear, the actual billing statement is the source of truth.
3. Subscriptions and off-peak rules: trading predictability for discounts
Subscriptions prepay for a token allowance over a billing cycle, with overages billed as pay-as-you-go. When steady load fits within the allowance, marginal cost is significantly lower than pure pay-as-you-go; shifting part of the real-time traffic to off-peak hours can lower it further. The risk is load volatility: unused allowance becomes sunk cost, while large overages degrade the plan back into pay-as-you-go.
3. Cost Attribution: Build a Usage Profile First
Any optimization should start with a reproducible usage profile. Recommended dimensions to collect:
- Input/output token ratio, and whether output exceeds 30% of the total;
- Cache hit rate, i.e., the share of repeated prefixes in total input;
- Latency tolerance distribution (real-time, near-real-time, offline);
- Peak-to-trough ratio, i.e., peak-hour call volume divided by trough-hour call volume.
An illustrative attribution script:
def estimate_cost(rows, price, batch_ratio=0.6, cache_hit_ratio=0.0):# rows: hourly sequence of (input_tok, output_tok)# price: (input price, hit price, output price), in CNY per million tokenstotal = 0.0for inp, out in rows:hit = inp * cache_hit_ratiomiss = inp - hittotal += (miss * price[0] + hit * price[1] + out * price[2]) / 1e6return total, total * batch_ratio
4. Three Actionable Optimization Paths
- Match model tiers to tasks: route simple tasks to lower-tier models and reserve flagship models for complex reasoning chains. This usually yields more savings than any billing trick.
- Batch offline tasks: send deferrable tasks to the asynchronous batch channel, and set an idempotency key for result write-back to avoid duplicate billing.
- Shave real-time peaks: buffer non-urgent real-time requests through a queue for off-peak execution, cover baseline load with subscription allowance, and keep overages on pay-as-you-go to balance cost and elasticity.
5. Hidden Levers: Caching and Free Allowances
Prefix caching usually takes effect automatically. Cached portions are billed at a lower price and carry a default time-to-live; cache writes may be billed separately based on different retention durations. In engineering practice, place stable content such as system prompts, tool definitions, and long documents at the front and keep them byte-for-byte identical, avoiding prefix drift caused by timestamps or random IDs, so the hit rate stays high. In addition, the million-token free allowances commonly offered when a new model launches are suitable for load testing and canary releases, and should not be counted in a long-term cost model.
6. Conclusion and Action Checklist
As unit prices converge, competition has shifted from price to billing rules and scheduling capability. Recommended order: first complete the usage profile and cost attribution, then choose the model tier, then batch offline traffic and shift deferrable real-time traffic off-peak, and finally evaluate how well subscription allowances match baseline load. For workloads already running on a public cloud, connecting to model services within the same cloud ecosystem can reduce data egress and link-rework overhead, while keeping billing consistent with the original provider. Baidu AI Cloud, with its model services and supporting general-purpose capabilities for data, queues, and monitoring, can support the attribution, scheduling, and observability loop described above.
