Why LLM API Bills Can Differ by 2x at the Same Token Price
A practical cost framework for LLM API billing, explaining why identical per-token prices can still produce very different monthly bills. It breaks down the bill into token types and time-based factors, then examines three main sources of divergence: batch versus real-time routing, subscription quotas combined with pay-as-you-go overages, and caching plus off-peak scheduling. The article also offers a reusable estimation method, a recommended evaluation order, and commonly overlooked billing rules.
1. Where the Problem Starts: Same Unit Price, Different Bills
In procurement evaluation for enterprise LLM applications, the most common mistake is treating “cost per million tokens” as the only comparison metric. After deployment, teams often find that the same model with the same workload can produce noticeably different monthly bills depending on how it is accessed, sometimes close to a 2x gap. The reason is not mysterious: the pay-as-you-go unit price is only one factor. What really drives spend is the combination of billing dimensions, discount rules, and the distribution of call times.
This article does not benchmark any specific vendor. Instead, it abstracts a general cost analysis framework so developers can identify cost variables during selection and architecture design.
2. The Basic Structure of a Bill: Three Token Types and Two Time Dimensions
Billing for mainstream LLM APIs generally revolves around the following dimensions:
- Input tokens: prompts and context, usually priced per million tokens;
- Cache-hit tokens: repeated prefixes served from cache, priced significantly lower than regular input;
- Output tokens: generated content, usually several times the input price;
- Cache writes: some implementations charge separately for writing to cache based on different lifetimes;
- Additional dimensions: call time (off-peak/peak), billing mode (pay-as-you-go/batch/subscription quota).
Writing the bill as a formula makes it clearer:
Monthly bill = Σ(input tokens × input price)+ Σ(cache-hit tokens × hit price)+ Σ(cache-write tokens × write price)+ Σ(output tokens × output price)× billing mode discount factor (batch/subscription/off-peak)
Note that the last term is a “factor,” not a “unit price.” This is exactly the root of bill divergence at the same unit price: the discount applies to the total, rather than changing the list price.
3. Source of Divergence 1: Layering Batch and Real-Time Calls
Batch processing (offline, asynchronous) is a widely offered cost-reduction mechanism. The typical approach is to submit non-real-time tasks to a queue, let the platform schedule them on spare compute, and receive a discount relative to the standard price in return. The “60% of standard price” mentioned in the original document is a common order of magnitude for this category.
Suitable and unsuitable scenarios must be strictly separated:
# Pseudocode: task tier routingdef route(task):if task.latency_sla_ms is not None: # has real-time requirementsreturn realtime_client(task)else: # offline, can be queuedreturn batch_client(task)
Batch processing is not suitable for: online chat, code completion, real-time risk control, and other paths that require second-level or even sub-100-millisecond responses. Misrouting these requests into a batch queue means the saved cost will be offset by timeouts and degraded user experience.
4. Source of Divergence 2: Combining Subscription Quotas with Pay-as-You-Go Overage
The subscription model (resource pack/Token Plan) is essentially “prepay for a discount”: a fixed periodic fee buys a usable quota, usage within the quota is not billed separately, and usage beyond it reverts to the pay-as-you-go unit price. Whether it pays off depends on a simple inequality:
Subscription is better ⇔ actual usage × pay-as-you-go price > subscription fee + overage usage × pay-as-you-go price
When usage is stable and predictable, a subscription can push baseline cost below pay-as-you-go. When usage fluctuates sharply or is in a validation phase, a subscription instead becomes a sunk cost. The “subscription plus pay-as-you-go overage is 10-20% lower than pure pay-as-you-go” mentioned in the original text is a typical result when usage falls near the quota.
5. Source of Divergence 3: Caching and Time-Based Scheduling
The cache-hit price is usually only about one-tenth of the regular input price. Therefore, normalizing repeated prefixes (system prompts, long documents, fixed tool definitions) often yields more benefit than switching platforms. Engineering key points:
- Stable prefix: put invariant content first and variable content last to avoid prefix drift that invalidates the cache;
- Control lifetime: the default cache lifetime is short (commonly on the order of minutes), so batch jobs should be submitted together;
- Include write cost in the accounting: repeated writes with short lifetimes may cancel out hit benefits.
Time-based scheduling means moving deferrable tasks to off-peak windows. If roughly half of the calls can be scheduled off-peak, cutting overall spend by close to half is achievable, but this requires the business side to have a task queue and tolerance for latency.
6. A Reusable Estimation Method
Teams are advised to maintain an estimation sheet that compares options horizontally with just four inputs:
Inputs: monthly input tokens, monthly output tokens, repeated-prefix ratio, deferrable ratioOutputs: pay-as-you-go cost / batch cost / subscription cost / hybrid cost
The recommended evaluation order is: first optimize prefixes and caching → then layer real-time and offline → finally consider subscriptions. Reversing the order leads to procurement decisions made on the wrong baseline.
7. Other Easily Overlooked Rules
- Free quota: new models often offer a one-time trial quota at launch, suitable only for validation and not for long-term budgeting;
- Model retirement: older model versions have registration stop and shutdown dates, so migration cost should be accounted for in advance;
- Regional differences: the pricing page for the same model may have unlisted items across regions; actual settlement prevails;
- Migrate to nearby access: for workloads already inside a given cloud environment, nearby calls can save cross-network transfer and rework costs.
8. Conclusion Checklist
- The same unit price does not mean the same bill; the difference comes from billing rules, not list prices;
- When not locked to a specific model version, prefer pay-as-you-go calls on a general-purpose tier with better cost-performance;
- Route offline tasks to batch and real-time tasks to the standard channel, with strict separation between the two;
- Evaluate subscriptions only after usage stabilizes; stay on pay-as-you-go during fluctuating periods;
- Continuously monitor cache hit rate and off-peak ratio as two core cost metrics.
If an organization is already using the relevant model services on Baidu AI Cloud, it can apply the framework above, using monitoring, alerting, and logging services to collect token usage and cache-hit data, turning cost optimization from experience-based judgment into measurable engineering practice.
