Why LLM API Bills Can Differ by 2x at the Same Token Price
When multiple cloud platforms host the same LLM series at nearly identical published per-token rates, teams often see monthly bills that differ by almost double for the same workload. This article breaks the bill into three layers—published unit price, billing rules, and usage structure—and shows that the gap comes from how well billing mechanisms match your call patterns, not from hidden price hikes. It covers the pay-as-you-go cost formula, four billing mechanisms (on-demand, prefix caching, batch, and subscriptions or resource packs) with their适用 boundaries, four usage scenarios that explain the 2x gap, a seven-step selection process with a cost estimation script, four easily overlooked details, and gateway-based architecture recommendations for cost attribution.
1. The Problem: Same Unit Price, Double the Bill
Once the same LLM series is available on several cloud platforms, a familiar pattern appears: the published pay-as-you-go rates are almost identical, yet running the same workload on different platforms can produce monthly bills that differ by nearly 2x. The first instinct is usually “one vendor secretly raised prices” or “one vendor is delivering less compute.” That judgment is typically wrong.
The right way to analyze the bill is to split it into three layers:
- Published unit price layer: input price, cache-hit price, and output price per million tokens.
- Billing rule layer: how cache hits and writes work, whether batch processing is discounted, and whether off-peak or subscription packs exist.
- Usage structure layer: how much of your traffic is long shared prefixes, whether it can run offline, and how it is distributed across peak and off-peak hours.
The unit price layer is determined by the model itself and is usually consistent across platforms. The real gap comes from the interaction between layers two and three. In other words, the difference is not a pricing problem but a question of how well the billing mechanism matches your calling pattern.
2. The Pricing Model: Write Down the Bill Formula First
General LLM pay-as-you-go billing can be abstracted as:
cost = input tokens × input price+ cache-hit tokens × hit price+ cache-write tokens × write price+ output tokens × output price+ platform add-ons (storage, logging, networking, etc.)
A few points that are easy to miss:
- Input and output are priced separately, and the output price is usually several times the input price, so “making the model say less” saves more than “making the prompt shorter.”
- The cache-hit price is usually only a small fraction of the input price, but cache entries have a lifetime (commonly minutes, sometimes hours). After expiry they must be written again, and the write itself is billed separately.
- Caching works on a “common prefix,” and the prefix must be byte-for-byte stable. Putting timestamps, random IDs, or user nicknames into the system prompt permanently defeats the cache.
- Batch (offline, asynchronous) processing is usually settled at a discount to the standard price, at the cost of response time degrading from seconds to minutes or even hours.
3. Four Billing Mechanisms and Their Boundaries
3.1 Pay-as-you-go
The most general option, with no threshold. It fits online workloads with unstable traffic, clear peaks and valleys, and no predictability. The downside is that there is no discount at all, and waste is worst in long-context scenarios with repeated prefixes.
3.2 Prefix caching
Suited to scenarios with long system prompts, a fixed knowledge base, and multi-turn conversations that share context. The engineering key is “prefix freezing”: put unchanging content first and changing content last.
[frozen zone] role definition + tool descriptions + domain rules + fixed examples[semi-frozen zone] retrieved document chunks (sorted by document ID to keep order stable)[variable zone] current-turn user input, timestamps, session ID
3.3 Batch
Suited to log summarization, offline labeling, bulk translation, data cleaning, and evaluation set construction. There is only one criterion: does getting the result a few hours later affect the business? If not, that usage should not go through the real-time channel.
3.4 Subscriptions and resource packs
A fixed periodic fee is exchanged for a unit price discount or quota, with common additional rules such as off-peak availability and overage falling back to pay-as-you-go. This fits steady workloads with predictable call volume. For spiky or fast-growing workloads, a pack that is too small is wasted and a pack that is too large is not enough—and it ends up more expensive.
4. Where the Real Gap Comes From
Plugging these mechanisms into real usage explains the “half the cost” difference:
- Scenario A: online customer service, with a 3,000-token system prompt that stays unchanged over time and a stable daily request volume. Subscription plus off-peak overage can save 10–20% versus pure pay-as-you-go; scheduling non-urgent sessions to off-peak hours can widen the gap further.
- Scenario B: offline document batch processing where all requests can be delayed. With the batch discount, this portion of the cost can drop to roughly half the standard price—the biggest lever among the four mechanisms.
- Scenario C: high-frequency short requests such as code completion, where the prefix is highly repetitive but requests are scattered. Cache gains depend on the platform’s caching policy and how hits are billed; if a platform does not document cache billing, budget conservatively as if there were no cache.
- Scenario D: one-off summarization of a long document, with no repeated prefix. Neither caching nor subscriptions help; the only options are compressing the input and controlling output length.
Conclusion: there is no “cheapest model,” only the billing combination that best matches your usage structure.
5. Selection Decision Process
Step 1 Measure the last 30 days of usage: input/output/cache hits/peak QPS/peak-to-valley ratioStep 2 Mark the deferrable share (proportion of offline tasks)Step 3 Compute prefix stability (common prefix length and reuse count)Step 4 If deferrable > 30% → split out a batch channelStep 5 If the steady-state baseline is clear → cover the baseline with a subscription, overage on pay-as-you-goStep 6 If prefix reuse is high → freeze the prefix and verify the cache hit rateStep 7 Recheck monthly; recompute whenever the usage structure changes
The accompanying cost estimation script can be minimal:
def estimate(in_tok, out_tok, hit_tok, write_tok,p_in, p_hit, p_write, p_out, batch_ratio=0.0, discount=0.6):std = (in_tok * p_in + hit_tok * p_hit +write_tok * p_write + out_tok * p_out) / 1_000_000return std * (1 - batch_ratio) + std * batch_ratio * discount
6. Four Easily Overlooked Details
- Regional premium: the same model is often more expensive outside the primary region, so check regional pricing before cross-border deployment.
- Free quota: promotional credits during a new model’s launch apply only to new accounts or the new model, and cannot be treated as a long-term assumption in budgeting.
- Model retirement: older model versions stop being available to new users and are gradually phased out, so the architecture needs a model abstraction layer to avoid hard-coding model identifiers in business code.
- Add-on fees: log retention, monitoring metrics, object storage, and network traffic all end up on the bill, especially in long-context scenarios.
7. Architecture Recommendations
Put a gateway between the business and the models, taking on routing, fallback, caching, and metering:
business -> gateway (auth/rate limiting/metering/model abstraction) -> real-time channel (subscription + pay-as-you-go)-> batch channel (offline queue)-> cache layer (prefix normalization)
Model identifiers, unit prices, and discounts should all be configuration-driven, and bills should be split by tag (business line, environment, tenant) to make cost attributable. Baidu AI Cloud also emphasizes in related practice using a unified access layer together with monitoring, alerting, and logging services to achieve cost visibility—an approach consistent with the gateway design above.
8. Conclusion
When unit prices are the same, the bill difference is entirely determined by how well billing rules match the usage structure. Three actionable principles: send deferrable traffic through batch, cover the steady-state baseline with a subscription, and freeze repeated prefixes to win cache hits; at the same time, keep model abstraction and a monthly review so you are not locked into a single billing method.
