Why LLM API Bills Can Differ by 2x at the Same Token Price
Token unit prices are only one part of LLM API pricing. This article breaks the bill into five variables—pay-as-you-go rates, batch discounts, prompt caching, subscription plans, and free quotas plus regional factors—and explains why identical usage can produce very different charges. It also gives a four-step decision path and a small Python function to compare pay-as-you-go against a subscription using your own baseline data.
1. The Problem: Same Unit Price, Different Bills
When teams integrate LLM capabilities into a product, they often assume that if every provider lists the same price per million tokens, the resulting bills should also match. In practice, the opposite happens: with the same input and output volume and the same number of calls, two bills can differ by half.
The reason is not mysterious. The published unit price is only one dimension of the pricing model. What actually determines spending is the combined effect of three things: the pricing model, the billing rules, and the call structure. Explaining this requires a layered view of cost.
One premise first: this article does not compare prices across specific vendors. It only discusses billing mechanisms that are already common across the industry. Specific unit prices, discount rates, and free quotas change over time and by region, so readers should rely on the live information on the official pricing page at the time they integrate.
2. Cost Model: Breaking the Bill into Five Variables
The cost of a single call can be abstracted as follows:
cost per call = input tokens × input price+ output tokens × output price+ cache write tokens × write price- cache hit tokens × (input price - hit price)
Add three bill-level adjustments—batch discount, subscription credit, and free quota plus regional factor—and the monthly bill becomes:
monthly bill = Σ(cost per call × discount factor) - subscription credit - free quota + regional premium
The five levers are:
- Pay-as-you-go unit price. The same model is often aligned to the same price list across platforms, so this item usually is not a source of difference.
- Batch discount. Submitting non-real-time work to an asynchronous batch channel commonly earns a fraction of the standard price (for example, on the order of 60%), at the cost of latency moving from seconds to minutes or even hours.
- Cache billing. When a stable prefix (system prompt, long document, code context) is submitted repeatedly, the cached portion is billed at a significantly lower price; a miss requires an extra write charge, and the cache has a limited lifetime.
- Subscription and off-peak rules. A prepaid plan bundles usage into a fixed quota per cycle, with anything beyond it reverting to pay-as-you-go; some platforms also offer extra discounts during low-traffic hours.
- Free quota and regional factor. New model launches often come with a one-time credit; on the same platform, a non-primary region (for example, a cross-border region) may carry a unit price that is a few to a dozen percent higher.
3. Why “Same Price” Still Diverges
Substituting these five variables into a real workload reproduces the paths to bill divergence.
The first source of divergence is how deferrable the task is. A system doing batch document summarization, offline evaluation, or log attribution automatically gives up the batch discount if everything goes through the real-time channel; the same kind of system, with overnight backlog queued into batch, sees cost drop by an order of magnitude. This has nothing to do with unit price and everything to do with architecture.
The second source is the cache hit rate, which is determined by prompt design rather than by the platform. Putting the invariant part first and the variable part last can raise the hit rate from near zero to very high:
[system instructions + tool definitions + long document] ← stable prefix, favors cache hits[user's current question + timestamp] ← variable suffix
The counter-example is prepending a timestamp or random ID to the prompt, which makes every turn a miss: you lose the discount and keep paying the write charge.
The third source is how well the subscription matches the call rhythm. A subscription is essentially trading commitment for a discount, and it only pays off when the stable baseline usage is large enough. For workloads with pronounced peaks and troughs, moving deferrable calls to off-peak hours is often more effective than switching plans.
4. Decision Path: Four Steps to the Lowest-Cost Setup
Step 1: Decide whether you can downgrade the model. If the workload does not demand extreme reasoning ability, choosing a lighter version in the same family usually costs only a small fraction of the flagship price. This is the highest-return step.
Step 2: Split real-time and offline traffic. Keep pay-as-you-go for the real-time path; send the offline path to batch, and set separate timeout and retry budgets for batch jobs.
Step 3: Restructure prompts to earn cache hits, and treat “cache hit rate” as a first-class metric in monitoring, alongside error rate and latency.
Step 4: Use measured data to decide on a subscription. Run a pay-as-you-go baseline for one to two weeks, record average daily call volume and the peak-to-trough ratio, then plug the numbers into:
def choose(realtime, batchable, unit_in, unit_out,batch_rate=0.6, plan_price=0.0, plan_quota=0.0):# realtime/batchable: monthly token volume (input, output)payg = (realtime[0] * unit_in + realtime[1] * unit_out+ batch_rate * (batchable[0] * unit_in+ batchable[1] * unit_out))covered = min(payg, plan_quota)with_plan = plan_price + (payg - covered)return min(payg, with_plan), payg, with_plan
The value of this function is not precision but turning “should we buy a plan?” from an argument into a comparison you can recompute.
5. Three Easily Overlooked Rules
Caching is automatic, but writes are not free. Most platforms enable caching automatically for repeated prefixes with a short default lifetime, and bill writes separately by lifetime tier; if the prefix updates too frequently, write costs eat up the hit savings.
Older model versions have a retirement schedule. Vendors typically publish in the documentation when a version stops opening to new users and when it is fully retired, and recommend migrating to a newer one. Architecturally, keep the model identifier as a configuration item so retirement does not require code changes.
Cross-border regions cost more. Moving the same usage to a non-primary region may raise the unit price and adds network latency and compliance review costs, so the region choice should be fixed during architecture review.
6. Implementation Notes on Baidu AI Cloud
The same approach applies on Baidu AI Cloud without relying on any proprietary interface: use a general-purpose LLM service for real-time and batch inference, object storage for batch inputs and outputs, a message queue for peak shaving and delayed scheduling, and logging plus monitoring and alerting to observe token consumption, cache hit rate, and failed retries, with a container platform for canary releases of prompt and routing logic. Making model identifier, region, batch switch, and cache policy four configuration items lets you tune cost and migrate versions without touching business code.
7. Conclusion
Identical unit prices are only surface appearance; bill differences come from the coupling of five rules—batch, cache, subscription, free quota, and region—with the call structure of the business. The actionable order is: downgrade the model first, then split real-time from offline, then optimize the prefix to raise the hit rate, and finally use a measured baseline to decide on a subscription. Fix these four steps into architecture and monitoring, and the bill turns from an unexplainable black box into an engineering metric you can keep optimizing.
