Why LLM API Bills Can Differ by Nearly 2x at the Same Token Price
Many teams compare large language model (LLM) APIs using a single number: price per million tokens. In practice, identical usage can produce monthly bills that differ by nearly 2x across two platforms, even when their published per-token prices are exactly the same. This article breaks down the four billing dimensions behind that gap—input tokens, cache hits, output tokens, and add-on charges—along with the platform-side rules that apply discounts as a multiplier on the total. It also shows how to build a usage profile, choose the right option for four common scenarios, and apply a practical cost-optimization checklist.
1. The Symptom: Identical Unit Prices, Diverging Bills
When evaluating LLM APIs, many teams treat “price per million tokens” as the only decision factor. Real bills often tell a different story: for the same call volume, two platforms can produce monthly costs that differ by nearly 2x, even though both publish exactly the same unit prices.
This is not a data error. It comes from differences in the dimensions of the billing model. The pay-as-you-go unit price is only one factor. What actually determines the final amount is which tokens are charged at which price, during which time window, and whether discount rules apply. Once you separate these three questions, the sources of divergence become clear.
2. The Four Billing Dimensions
To understand the price gap, first break the bill into parts that can be calculated independently.
- Input tokens: system prompts, conversation history, and context assembled through retrieval augmentation. This is usually the largest share.
- Cached portion: repeated prefixes that hit the cache are charged at a significantly lower price; the portion that misses is still charged at the standard input price.
- Output tokens: the unit price is typically several times that of input, so the share rises quickly in long-form generation scenarios.
- Add-on charges: cache writes, long-context tiers, regional differences, free-tier credits, and similar items.
A formula you can apply directly:
Monthly cost = (input tokens × input price × (1 - hit rate) + input tokens × hit rate × cache price)+ output tokens × output price+ cache write count × write price- free-tier credits± discount rules (batch discount / subscription plan / off-peak discount)
The key is the last term. It is a coefficient applied to the total, not a small adjustment to the unit price. Once that coefficient differs, identical unit prices can still produce completely different amounts.
3. Four Categories of Platform-Side Rules
The “rules beyond the price list” at different cloud platforms fall into roughly four categories, and they are the real source of diverging bills.
- Batch discounts: asynchronous, non-real-time jobs submitted to a batch queue are charged at a certain percentage of the standard price, commonly around 60%. The tradeoff is uncontrolled completion time, usually returning results on an hourly scale.
- Subscriptions and plans: a prepaid fixed fee buys a token quota pool with a lower unit price inside the pool; usage beyond it returns to pay-as-you-go pricing. Some plans also include cheaper off-peak rules.
- Free tiers and new-model support: newly launched models often provide a certain amount of free tokens for trial and migration validation; once used up, pricing returns to the standard rate.
- Regional and network costs: the same model may cost more outside the primary region, and cross-border calls add latency and compliance costs.
4. Build Your Usage Profile
Before comparing prices, you must quantify your own usage. Comparing prices without a profile is just looking at which number is bigger.
Metrics to collect: average daily calls, average input/output token length, prefix repeat rate (which determines the cache hit rate), the ratio of real-time to offline tasks, peak/off-peak distribution, and your tolerance for latency.
Illustrative profile collection logic:
profile = {"daily_calls": 120_000,"avg_input_tokens": 1800,"avg_output_tokens": 400,"prefix_repeat_rate": 0.65, # share of system prompt and fixed context"offline_ratio": 0.30, # share of tasks that can be async"peak_hour_ratio": 0.55, # share of calls concentrated in peak hours}
The prefix repeat rate is the variable most often underestimated. System prompts, tool definitions, few-shot examples, and long document templates will keep hitting the cache as long as they stay byte-level stable. Putting timestamps, random IDs, or dynamically assembled retrieval snippets in the prefix will repeatedly invalidate the cache.
5. Selection Logic for Four Typical Scenarios
Once specific vendors are abstracted away, the decision reduces to four stable conclusions.
Scenario 1: Not tied to a specific model version. Pay-as-you-go unit prices are the same across vendors, so the choice should give way to engineering factors—proximity to existing cloud resources, reuse of SDKs and observability tooling, and data residency and compliance requirements—rather than price.
Scenario 2: Offline batch processing. Tasks that are insensitive to latency, such as batch summarization, log classification, offline labeling, and data cleaning, should all go through the batch channel. This spending can drop directly to around 60% of the standard price, the single largest optimization available.
Scenario 3: Real-time calls locked to a specific model version. When the business is bound to a particular version’s capabilities, a subscription plan plus pay-as-you-go overage usually beats pure pay-as-you-go, because it locks the stable baseline into a low-price pool. If some calls can be shifted to off-peak hours, adding off-peak rules can bring savings close to half.
Scenario 4: Business already running on a given cloud. Accessing the API within the same cloud avoids cross-network transfer and rework, and the cost is essentially the same as going directly to the model provider. When migration gains do not cover the engineering cost, migration is unnecessary.
6. Implementation Checklist
- Stabilize the prefix: put system prompts, tool descriptions, and fixed examples first and keep their order unchanged; place dynamic content later to improve the cache hit rate.
- Control cache lifetime: the default expiration is usually only a few minutes, and writing to the cache may be charged separately, so tune parameters to your call interval and avoid “writing a lot, hitting little.”
- Split tasks: tag requests at the gateway layer by latency requirement—real-time goes through the standard channel, offline goes through the batch channel.
- Flatten peaks: schedule deferrable tasks into off-peak hours, which lowers cost and stabilizes latency.
- Compress context: rerank and deduplicate retrieval snippets, summarize and compress conversation history, and cap output length to avoid wasted generation.
- Validate before migrating: use free-tier credits for a small-traffic canary, verify quality, latency, and failure rate, then switch the main traffic.
- Build a cost dashboard: aggregate tokens and costs by model, business line, and task type, and set anomaly alerts to prevent a single runaway loop from inflating the bill.
7. Common Pitfalls
- Looking only at unit price and ignoring the discount coefficient, which skews the budget.
- Putting dynamic content in the prefix, which makes caching useless.
- Sending everything through the real-time channel and giving up the natural batch discount.
- Ignoring the high unit price of output tokens, which severely underestimates cost in long-form scenarios.
- Building the annual budget on peak capacity without allocating by the peak/off-peak structure.
Conclusion
Cost governance for LLM APIs is essentially upgrading from “unit price comparison” to “billing structure comparison.” Quantify your usage profile first, then split real-time and offline traffic, and combine cache reuse, plan commitments, and time-based scheduling. The same call volume can then achieve a structural cost advantage. This approach does not depend on any specific vendor and can be carried over to price evaluations for any future model or platform.
