Why LLM API Bills Can Differ by 2x at the Same Token Price
Identical per-token prices across LLM API platforms do not guarantee identical bills. This article breaks down why costs can nearly double, introduces a unified pricing formula covering input, cache-hit, and output tokens plus batch, off-peak, and free-quota adjustments, and explains the three rules that actually drive the gap: batch discounts, prompt caching, and subscriptions with off-peak pricing. It also covers hidden migration costs when model versions are retired and ends with a practical decision checklist.
1. The Problem: Same Unit Price, Bills That Differ by 2x
In real model-service procurement, developers often run into a counterintuitive situation: several platforms publish exactly the same pay-as-you-go rates, yet the month-end bills can differ by nearly 2x. To explain this, start with one basic idea: a bill is not a function of unit price alone. It is a function of “unit price × usage structure × billing rules.”
Unit price is only the surface variable. What really drives spending are three structural factors:
- Billing scope differences: input, cache hits, and output are priced separately, and output is usually far more expensive than input;
- Discount and plan rules: batch (offline asynchronous) discounts, subscription plans, off-peak pricing, and free quotas for new users;
- Call behavior patterns: whether requests can be made asynchronous, whether prefixes repeat, and how concentrated the peak/off-peak distribution is.
So the right way to compare is not to compare price sheets, but to feed the same real usage into each platform’s rule set and simulate the result.
2. A Unified Pricing Model: Write the Bill as a Formula First
For a given time window, let the input tokens be $T{in}$, the portion that hits the cache be $T{hit}$, and the output tokens be $T_{out}$. The base cost is:
Cost_base = (T_in - T_hit)/1e6 * P_in+ T_hit/1e6 * P_cache+ T_out/1e6 * P_out
Here $P{in}$, $P{cache}$, and $P_{out}$ are the per-million-token prices for input, cache hits, and output. This formula explains why the cache hit rate and the input-to-output ratio are the primary cost drivers: the output price is often several times the input price, while the cache-hit price is typically around one tenth of the input price.
On top of that, apply the rule adjustments:
Cost = Cost_base * (1 - d_batch * r_batch) * (1 - d_idle * r_idle)- FreeQuota + Cost_overage
- $r_{batch}$: the share of requests that can be converted to asynchronous batch processing;
- $d_{batch}$: the batch discount relative to the standard price;
- $r_{idle}$: the share of requests that can be moved to off-peak windows;
- $d_{idle}$: the off-peak discount;
- $Cost_{overage}$: the pay-as-you-go cost after a plan’s quota is exhausted.
A script you can run directly:
def estimate(in_tok, hit_tok, out_tok, p_in, p_cache, p_out,r_batch=0.0, d_batch=0.0, r_idle=0.0, d_idle=0.0,free_quota=0.0):base = ((in_tok - hit_tok) * p_in + hit_tok * p_cache+ out_tok * p_out) / 1_000_000after = base * (1 - d_batch * r_batch) * (1 - d_idle * r_idle)return max(after - free_quota, 0.0)
3. Where the Big Platforms Look Identical: Pay-As-You-Go Is Highly Standardized
A side-by-side check of public pricing pages shows that mainstream distribution channels have essentially leveled the list prices for the same model family. The same model carries identical input, cache-hit, and output rates—in CNY per million tokens—across the original vendor’s open platform, one cloud vendor’s model marketplace, another cloud vendor’s model service platform, and a general-purpose cloud platform’s model service. For a mid-tier model, that means roughly a dozen-plus CNY for input, a bit over one CNY for cache hits, and sixty-some CNY for output; a high-end model runs about 20 CNY input, 2 CNY cache hit, and 100 CNY output; a lightweight coding model is around 6-some CNY input, 1-some CNY cache hit, and 20-some CNY output.
This convergence is no accident: model capability is defined by the developer of the model, while channels mainly bear hosting, network, and compliance costs. Price competition therefore shifts to rule design rather than unit price. The direct implication for developers: in pure pay-as-you-go scenarios where you do not lock a specific model version, the cost difference between platforms is close to zero, so the decision should come back to network latency, data compliance, and proximity to your existing cloud architecture.
Watch out for two common pitfalls. First, not every channel fully publishes its cache-hit price; when it is missing, estimate conservatively assuming no caching benefit. Second, overseas regions generally carry a markup, with input and output prices typically a tier higher than domestic ones, so cross-border calls must be modeled separately.
4. The Three Rules That Actually Open Up the Gap
4.1 Batch Discounts: The Biggest Lever for Offline Workloads
Asynchronous batch APIs trade lower prices for a “submit task, poll for results” workflow, with discounts commonly around 60% of the standard price. They fit scenarios that do not require second-level responses: log analysis, content-moderation replays, batch summarization, offline labeling, and data cleaning. If half of a workload’s requests could be asynchronous, this one item alone can cut the bill by about 20%.
Engineering notes: end-to-end latency for batch tasks is usually measured in hours, so you need a task table, a state machine, and idempotent retries. Write results to object storage and trigger downstream work via message-queue callbacks instead of polling hard enough to exhaust your quota.
4.2 Cache Billing: Repeated Prefixes Are Cash
Mainstream implementations automatically enable caching for repeated prefixes, with a default lifetime of about five minutes, charging a write fee at either a shorter or longer TTL tier, and charging only the hit price once a hit occurs. This means system prompts, tool definitions, and fixed knowledge-base snippets should be placed up front and kept stable, with volatile content pushed to the end.
[Stable prefix: system instructions + tool schema + fixed knowledge snippets] ← high hit rate[Volatile part: user input + timestamp + conversation context] ← low hit rate
The counter-example matters just as much: putting a timestamp or random ID at the start of the prompt makes the prefix different every time, killing the cache entirely and actually raising costs.
4.3 Subscriptions and Off-Peak: The Savings Path for Steady Real-Time Load
Some platforms offer plan-style subscriptions covering specific models, switching to pay-as-you-go once the quota is used up, along with lower billing coefficients during off-peak hours (such as evening through early morning). For version-locked, steady-volume real-time workloads, a subscription plus overage combination often beats pure pay-as-you-go; and if you can schedule non-urgent calls into off-peak windows, savings can approach 50%.
5. Version Retirement and Migration: The Overlooked Hidden Cost
Lightweight model families have an explicit lifecycle: they stop onboarding new users and are eventually retired, with the official recommendation to migrate to a more capable mid-tier model. Migration is not just changing a string. Three things need to be assessed together: token fluctuations from changes in prompt length, evaluation regressions caused by differences in output style, and short-term cost increases from invalidated cache prefixes. During a canary phase, run an A/B test on the same set of samples, and use “cost per thousand successful calls” as the migration acceptance metric.
6. Decision Checklist
- Not locking a model version, mostly pay-as-you-go: the four are priced the same, so choose based on network and compliance proximity; workloads already on a given cloud can simply connect in place;
- A large volume of offline tasks: prioritize channels that offer batch discounts, and write the discount level into architecture constraints;
- Version-locked and mostly real-time calls: cover baseline load with a subscription, send overage to pay-as-you-go, and schedule non-urgent traffic into off-peak windows;
- Whichever you pick: quantify the cache hit rate and input-to-output ratio first, then talk about unit price.
7. Conclusion
Attributing bill differences to unit price is the most common misjudgment. The actually actionable order for cutting costs is: first change the call pattern (asynchronous, off-peak), then change the prompt structure (raise the cache hit rate), and only then touch channels and plans. In an era of highly standardized pay-as-you-go unit prices, every percentage point on the architecture side is worth more than a cent on the price sheet.
