LLM API Billing Breakdown: Multi-Platform Price Comparison and Cost Optimization
A practical walkthrough of how LLM API bills are really calculated and how to reduce costs across platforms. It breaks down the three-part token model (uncached input, cache hits, and output), the four dimensions that drive actual spend beyond list price, and how billing mechanisms — limited-time discounts, batch discounts, subscription plans with off-peak rates, and context caching — interact rather than simply stack. You'll find worked cost estimates for five common scenarios, a reusable Python script for comparing monthly costs across channels, and checklists for channel selection and engineering-side optimization. All prices are illustrative and intended to demonstrate the calculation logic.
Around LLM API billing and cost optimization, developers comparing platforms often run into one phenomenon: for the same model, official list prices look similar, yet limited-time discounts, batch processing, cache hits, subscription plans, and currency conversion can make the real bill differ by a multiple. This article breaks down the cost structure on a single, consistent basis and offers a reusable estimation method and a selection checklist, helping teams make more rational channel-selection and cost-optimization decisions in a multi-platform environment where prices look the same on the surface.
A note first: the prices, discounts, and exchange rates below are illustrative and are used to demonstrate the calculation logic. Billing documentation, discount periods, quota policies, and settlement methods vary by platform and change over time. Before any actual purchase, refer to the official billing pages and contractual quotes.
1. Why the same list price can still produce a bill that’s twice as high
LLM API billing usually isn’t determined by the input price or the output price alone; it is shaped by several variables working together. The common core variables include:
- Three-part token billing: input tokens, cache-hit tokens, and output tokens are priced separately.
- Differences in billing mechanisms: limited-time discounts, batch discounts, subscription plans, off-peak coefficients, and the like can make the effective unit price of the same model differ by up to 2x.
- Differences in usage structure: long inputs, long outputs, and high cache-hit rates all change the bill significantly.
- Settlement currency and exchange rates: a channel priced in USD, once converted to the local currency, may cost more than a local-currency channel.
- Add-on fees and tax factors: channel fees, exchange-rate fluctuations, invoice types, and input-VAT credits also affect total cost.
So choosing a platform based on the official list price alone can easily lead to the wrong conclusion. A more reliable approach is to first write out the billing formula clearly, then plug different channels and task types into the same estimation model.
2. Nail down the billing formula first: input, cache hits, output
Most mainstream LLM APIs use three-part metering:
- Input tokens: system instructions, conversation history, user input, and the tokenized consumption of non-text content such as images, video, and files.
- Cache-hit tokens: the portion where the request prefix matches already-cached content and the server can reuse the computed result directly.
- Output tokens: the model’s generated response, including the main answer and possibly chain-of-thought or reasoning intermediate content. Whether that intermediate content counts toward output cost depends on the specific platform’s documentation.
The cost of a single request can be abstracted as:
cost per request =(uncached input tokens × input unit price+ cache-hit tokens × cache-hit unit price+ output tokens × output unit price)/ 1,000,000
The key point: a cache hit isn’t a “discount” separate from the billing mechanism — it is a multiplier term. It applies to every request, converting tokens that would otherwise be billed at full input price into tokens billed at the cache-hit price. So beyond limited-time discounts, batch discounts, and off-peak offers, cache-hit rate is one of the highest-priority capabilities in long-term optimization.
3. Beyond list price: four dimensions that actually drive the bill
3.1 Output unit price usually carries the most weight
In real workloads, input tokens often outnumber output tokens. In scenarios like code review, document summarization, long-form Q&A, and contract review, input can be five to ten times the output. But the output unit price is usually noticeably higher than the input unit price — commonly around three times the input unit price. As a result, output cost often accounts for 60–70% of total spend.
So small differences in the output unit price get amplified by usage volume. For output-heavy tasks, pay special attention to both the output unit price and output-length control.
3.2 Cache-hit unit price comes second, but is worth investing in over the long run
The cache-hit unit price is usually only about a quarter to a third of the input unit price. It won’t directly drive the total bill to zero, but by raising the hit rate you can move a portion of input tokens from full price down to the cache price.
For scenarios with a fixed system prompt, fixed tool definitions, a stable knowledge-base prefix, or repeated questions over long documents, cache hits are often the most cost-effective optimization lever.
3.3 Hidden billing items are easy to overlook
Beyond the three-part unit prices, several items are easy to miss:
- Price tiers: some models use tiered pricing for very long context — the longer the context, the higher the unit price.
- Cache writes: the first write into the cache may be billed separately, or billed at a discounted input price.
- Quota constraints: TPM (tokens per minute) and RPM (requests per minute) directly affect concurrency.
- Minimums and free credits: some pay-as-you-go channels have a minimum top-up threshold or credits with an expiry.
- Chain-of-thought billing: if a platform counts the reasoning process as output, actual output cost may exceed expectations.
3.4 Billing mechanisms: where the real gaps open up
The same tokens can cost more than twice as much under different billing mechanisms. Common mechanisms include:
| Billing mechanism | Typical price impact | Applicable conditions |
|---|---|---|
| Limited-time discount | A markdown on list price, e.g., 50% off | Platform promotions, usually time-limited |
| Batch discount | Typically 50% of list price | Async submission, no real-time requirement |
| Subscription plan + off-peak offer | As low as ~0.3x the standard unit price during idle hours | Workloads that can be scheduled off-peak |
| Currency and exchange rate | USD channel may cost more once converted to local currency | Cross-border settlement, overseas business |
One important note: limited-time discounts, batch discounts, and off-peak coefficients are usually “pick one” — they can’t necessarily be stacked. Cache hits are a different kind of multiplier term and can be layered on top of the applicable billing channel.
4. Channel price structure at a glance
The table below shows illustrative prices in CNY per million tokens. For price changes after the snapshot date, refer to each platform’s billing documentation.
| Channel type | Input | Cache hit | Output | Key characteristics |
|---|---|---|---|---|
| Official platform, limited-time price | 0.40 | 0.115 | 1.40 | 50% off standard; discount period must be confirmed |
| Official platform, standard price | 0.80 | 0.23 | 2.80 | Batch usually 50% of standard price |
| Local cloud provider, standard price | 0.80 | 0.23 | 2.80 | Compatible with mainstream API protocols; sets concurrency quotas |
| Subscription plan + off-peak | scaled by time-slot coefficient | same | same | ~0.3x standard unit price during idle hours |
| USD-denominated international channel | ~1.04 | ~0.21 | ~3.45 | Priced in USD; illustrative rate 1 USD ≈ 6.9 CNY |
| Aggregator/routing platform | ~1.04 | ~0.21 | ~3.45 | Same as upstream; convenient for multi-model switching |
Several conclusions follow from the table:
- Local cloud providers and the regional nodes of aggregator platforms typically charge the official list price, so pay-as-you-go unit prices don’t differ much.
- A channel priced in USD, once converted back to local currency, may have higher input and output unit prices. The cache unit price may be slightly lower, but cache only applies to some requests, so overall it isn’t necessarily cheaper.
- Not every platform has listed the same model or the same version. When selecting, “is the model available” and “is the version pinned” should be the first screening criteria.
5. Five typical scenarios: how to choose for each?
All estimates below use a consistent basis for easy comparison. Standard prices are calculated as “0.80 / 0.23 / 2.80”; limited-time prices as 50% of standard; offline batch prices as 50% of standard; subscription-plan off-peak as 0.3x the standard unit price. Assume limited-time, batch, and off-peak coefficients don’t stack — only the best one applies. Actual costs may vary slightly due to factors like chain-of-thought, cache writes, and fees.
Scenario 1: Online Q&A (standard-price channel)
Assume monthly request volume of about 840,000, with each request consuming 2,000 input tokens and 500 output tokens. Of those, 500 tokens are fixed system instructions and examples that can hit the cache.
Monthly usage:
- Total input: 168,000,000 tokens
- Of which cache hit: 42,000,000 tokens
- Uncached input: 126,000,000 tokens
- Output: 42,000,000 tokens
Standard-price channel cost:
| Cost item | Calculation | Amount |
|---|---|---|
| Uncached input | 126,000,000 × 0.80 / 1,000,000 | CNY 100.80 |
| Cache hit | 42,000,000 × 0.23 / 1,000,000 | CNY 9.66 |
| Output | 42,000,000 × 2.80 / 1,000,000 | CNY 117.60 |
| Total | CNY 228.06 |
If switched to the official limited-time price:
| Cost item | Calculation | Amount |
|---|---|---|
| Uncached input | 126,000,000 × 0.40 / 1,000,000 | CNY 50.40 |
| Cache hit | 42,000,000 × 0.115 / 1,000,000 | CNY 4.83 |
| Output | 42,000,000 × 1.40 / 1,000,000 | CNY 58.80 |
| Total | CNY 114.03 |
Conclusion: Online Q&A demands high real-time performance, so if an official limited-time price is available, using it is usually the most direct win. But limited-time promotions aren’t necessarily permanent, so it’s worth building in a price-switching toggle before launch and configuring budget alerts to avoid a sudden bill spike once the discount ends.
Scenario 2: Long-document parsing and summarization (standard-price channel, high cache hit)
Assume the same series of long documents is queried repeatedly, with a long and essentially unchanged system prompt. Monthly input is 60 million tokens, of which 70% hit the cache — that is, 42 million tokens; output is 15 million tokens.
Without caching, all input is billed at full price:
input cost = 60,000,000 × 0.80 / 1,000,000 = CNY 48.00cache cost = 0output cost = 15,000,000 × 2.80 / 1,000,000 = CNY 42.00total = CNY 90.00
With caching:
| Billing mode | Input cost | Cache cost | Output cost | Total |
|---|---|---|---|---|
| No cache | CNY 48.00 | 0 | CNY 42.00 | CNY 90.00 |
| Cached, standard price | CNY 14.40 | CNY 9.66 | CNY 42.00 | CNY 66.06 |
| Cached, limited-time price | CNY 7.20 | CNY 4.83 | CNY 21.00 | CNY 33.03 |
Around a 70% cache-hit rate, each additional percentage point moves about 600,000 tokens from full input price to the cache price. Using the 0.80 vs 0.23 price gap, the input cost drops by about:
600,000 × (0.80 - 0.23) / 1,000,000 = CNY 0.342
The current input cost is about CNY 24.06, so that’s roughly a 1.4% reduction.
Conclusion: For long documents, codebases, and knowledge-base Q&A, put stable prefixes at the very front of the prompt as much as possible. Keep dynamic content — timestamps, random IDs, user IDs, temporarily concatenated content — out of the prefix head, or it will frequently invalidate the cache.
Scenario 3: Offline data labeling (batch channel)
Assume processing about 420,000 records per month, totaling 60 million input tokens and 15 million output tokens, and the tasks can run asynchronously. If this task resembles Scenario 2, with 70% of input hitting the cache, the monthly cost at standard price is about CNY 66.06; switching to a batch endpoint halves the price, bringing the monthly cost to about CNY 33.03.
The value of batch processing lies in asynchronous execution and discounted pricing, but its payoff depends on two conditions:
- Whether the task genuinely allows async execution and doesn’t require real-time responses.
- Whether output length is controllable, so output tokens don’t eat up the discount.
Looking only at the effect of output length, assuming an output unit price of CNY 2.80 per million tokens:
- 500 output tokens, output cost is about CNY 0.0014;
- 2,000 output tokens, output cost is about CNY 0.0056;
- the latter is 4x the former.
Even with the 50% batch discount:
- 500 output tokens, output cost is about CNY 0.0007;
- 2,000 output tokens, output cost is about CNY 0.0028;
- still 4x.
Conclusion: Batch processing suits async tasks, but that doesn’t mean output length can run wild. The longer the output, the less the batch discount can offset. For offline labeling, log summarization, and batch summarization, it’s worth constraining output length at the same time.
Scenario 4: Peak shaving (subscription plan + off-peak)
Some subscription plans use “credits + time-slot coefficient” billing. During idle hours — late night to early morning, for example — usage is billed at 0.3x the standard unit price; if the plan itself also carries a limited-time 30% off, the cost may drop further.
Using Scenario 1’s standard-price CNY 228.06/month as the baseline:
| Arrangement | Calculation | Monthly cost | vs. standard price |
|---|---|---|---|
| All usage on the off-peak coefficient | 228.06 × 0.3 | ~CNY 68.42 | ~30% |
| Off-peak coefficient plus a further 30% off | 228.06 × 0.3 × 0.7 | ~CNY 47.89 | ~21% |
| 80% daily + 20% off-peak | 228.06 × 0.8 + 68.42 × 0.2 | ~CNY 196.13 | ~86% |
Conclusion: The payoff of peak shaving comes from the “schedulable proportion,” not just the unit price. To fully use idle-hour capacity, the scheduling system should support routing by time slot and task priority to different billing channels.
Scenario 5: Cross-border calls (USD-denominated)
Assume a team serving overseas markets primarily, with monthly usage the same as Scenario 1, that is:
- Uncached input: 126,000,000 tokens
- Cache hit: 42,000,000 tokens
- Output: 42,000,000 tokens
The USD-denominated channel’s illustrative unit prices:
- Input: CNY 1.04 per million tokens
- Cache hit: CNY 0.21
- Output: CNY 3.45
- Channel fee: 0.2%
Calculation:
| Cost item | Calculation | Amount |
|---|---|---|
| Uncached input | 126,000,000 × 1.04 / 1,000,000 | CNY 131.04 |
| Cache hit | 42,000,000 × 0.21 / 1,000,000 | CNY 8.82 |
| Output | 42,000,000 × 3.45 / 1,000,000 | CNY 144.90 |
| Subtotal before fee | CNY 284.76 | |
| Plus 0.2% fee | 284.76 × 1.002 | ~CNY 285.33 |
Compared with other channels at the same usage:
| Channel | Monthly cost |
|---|---|
| Standard-price channel | ~CNY 228.06 |
| Official limited-time price channel | ~CNY 114.03 |
| USD-denominated channel | ~CNY 285.33 |
The USD channel costs about CNY 57.27 more than the standard-price channel and about CNY 171.30 more than the limited-time-price channel. If the exchange rate moves 3%, using 285.33 as the base, cost fluctuates by about:
285.33 × 3% ≈ CNY 8.56
Conclusion: Under this article’s basis, even if you raise the cache-hit rate, the USD channel won’t necessarily beat the local-currency standard-price channel. The USD channel is better suited to situations where the enterprise can claim input-VAT credits, where overseas settlement is required, where the exchange-rate environment is favorable, or where a local-currency channel can’t provide the required model version. If you must use a USD channel, focus on raising the cache-hit rate and confirm tax, invoicing, and exchange-rate risks.
6. How the three billing mechanisms stack
Looking at all the scenarios together, what really determines the bill isn’t “whose list price is lower” but “which billing mechanism matches the task structure.”
| Billing mechanism | Price impact | Preconditions | Common pitfall |
|---|---|---|---|
| Limited-time discount | 50% of standard price | Within the discount period; largely independent of task type | Assuming the discount is permanent; no budget or switchover plan |
| Batch | 50% of standard price | Can be async, no real-time requirement | Stacking it with a limited-time discount and underestimating actual spend |
| Subscription + off-peak | ~0.3x during idle hours | Stable, predictable daily usage | Using only ~20% of capacity yet paying for idle-hour capacity |
| Context caching | Hit portion ~1/4 of input price | Stable, reusable prefix | Putting dynamic content first, causing frequent cache invalidation |
Limited-time discounts, batch, and off-peak coefficients are usually “pick one,” while cache hits are a “multiplier.” So a recommended optimization order is:
- First raise the cache-hit rate so each request hits a stable prefix as much as possible.
- Then choose a billing channel by task type: real-time tasks on standard or limited-time price, offline tasks on batch, shiftable tasks on a subscription plan.
- Finally fill idle-hour capacity with batch or low-priority tasks.
7. A reusable cost-estimation script
The Python script below quickly compares monthly costs across channels and usage levels. The example monthly usage matches Scenario 1.
# Monthly usage: uncached input, cache hits, outputmiss, hit, out = 126_000_000, 42_000_000, 42_000_000# Channels: input unit price, cache-hit unit price, output unit price, add-on fee ratechannels = {"standard": (0.80, 0.23, 2.80, 0.0),"limited-time": (0.40, 0.115, 1.40, 0.0),"batch": (0.40, 0.115, 1.40, 0.0),"off-peak plan": (0.24, 0.069, 0.84, 0.0),"USD-denominated": (1.04, 0.21, 3.45, 0.002),}for name, (p_in, p_cache, p_out, fee) in channels.items():cost = (miss * p_in + hit * p_cache + out * p_out) / 1_000_000cost *= 1 + feeprint(name, round(cost, 2))
The output is approximately:
standard 228.06limited-time 114.03batch 114.03off-peak plan 68.42USD-denominated 285.33
Replace the prices and usage with your own real data to get a more accurate comparison.
8. Selection conclusions for the five scenarios
| Scenario | Usage characteristics | Recommended strategy | Rationale |
|---|---|---|---|
| Online Q&A | Many requests, high real-time demand | Prefer official limited-time price; keep a switchover toggle | Limited-time price gives ~50% off across all three token types without hurting latency |
| Long documents / code analysis | Long input, high prefix repetition | Standard-price channel + stable prefix + caching | At a 70% hit rate, input cost drops significantly |
| Offline batch | Async, longer outputs | Batch endpoint, control output length | The 50% discount offsets some cost, but overly long output still pushes up the bill |
| Batch peak shaving | Stable proportion of batch jobs | Subscription plan; schedule daily jobs into idle hours | Off-peak coefficient + plan discount can bring cost down to ~20% |
| Overseas business | Needs USD settlement | USD-denominated channel, but maximize cache-hit rate | Converted input and output are pricier; balance via caching, tax, or exchange rate |
9. Non-price factors in channel selection
Price is just one dimension of the decision. The following factors are also worth weighing during selection:
- Availability: some cloud providers haven’t listed the model yet, or only offer a standard version of the same series. Whether the model ID and version number are pinned directly affects whether you can upgrade smoothly.
- Stability and rate limits: TPM/RPM quotas determine concurrency. Peak-hour throttling policies, SLAs, and historical availability all affect business continuity.
- Compliance and data: multimodal input often contains sensitive content like images, audio/video, contracts, and logs. Confirm whether data is used for model training, log-retention periods, and cross-border data-transfer requirements.
- Portability: API-protocol compatibility, streaming-output support, and error-code conventions determine the cost of switching channels. It’s best to wrap model calls behind a unified abstraction layer and switch channels via configuration, rather than scattering one provider’s SDK throughout business code.
- Settlement and finance: billing granularity, minimum top-ups, invoice types, and support for corporate settlement all affect an enterprise’s actual procurement cost.
- Metering and monitoring: solid call-volume statistics, cost breakdowns, and budget alerts are prerequisites for cost control. Use the logging, monitoring, and alerting capabilities of major cloud providers to break down usage by business line and environment, and to catch abnormal calls promptly.
10. Engineering-side cost optimization checklist
No matter which channel you choose, all eight of the following apply:
- Stable prefix: put system instructions, tool definitions, and fixed examples at the very front of the prompt, with dynamic content after, so the cache prefix stays intact.
- Control output length: constrain answer length within what the business allows to keep output tokens from running away. Route long-output tasks to batch where possible.
- Tiered calls: handle simple tasks like classification, extraction, and rewriting with lightweight models or a rules engine; leave complex reasoning to the LLM.
- Context slimming: summarize and compress conversation history; in retrieval scenarios return only the most relevant snippets rather than stuffing the full context into every request.
- Multimodal preprocessing: compress images to the minimum resolution the business needs and extract key frames from video to reduce tokenized input size.
- Sensible retries: use exponential backoff on failed requests to avoid doubling consumption from repeated submissions after throttling.
- Usage observability: instrument token consumption by business line and endpoint, and set budget thresholds and anomaly alerts.
- Continuous recalculation: model prices, discount policies, and exchange rates change, so recompute once a month with a consistent script before deciding whether to switch channels.
11. Quick reference for common mistakes
During cost optimization, these mistakes come up most often:
- Mistake 1: Treating a limited-time discount as a long-term price. Limited-time discounts can end at any time, so configure a switchover toggle and budget alerts.
- Mistake 2: Assuming discounts stack. Limited-time, batch, and off-peak coefficients usually take only one; defer to platform rules.
- Mistake 3: Putting dynamic content first and breaking the cache. Timestamps, random IDs, and session info at the head of the prefix make the whole prefix miss.
- Mistake 4: Looking only at list price, not output share. Output cost often accounts for 60–70% of total spend, so evaluate output unit price and output length closely.
- Mistake 5: Ignoring exchange rates and taxes. A USD channel may cost more after conversion, but with tax credits or a favorable exchange rate, the total cost can change.
- Mistake 6: Looking only at model unit price, not quota and SLA. TPM, RPM, throttling policies, and availability directly affect business cost and stability.
12. Conclusion
Regarding the API pricing of this long-context multimodal model, it can be distilled into one line: when unit prices are the same, look at mechanisms; when mechanisms are the same, look at structure; when structure is the same, look at settlement.
- If list prices are the same, see which of limited-time discounts, batch discounts, and off-peak coefficients matches the task;
- If billing mechanisms are the same, look at cache-hit rate, input/output ratio, and context length;
- If billing mechanisms and usage structure are both the same, then compare currency, exchange rate, tax, and invoice factors.
For most teams, start with the official limited-time price, make stable prefixes and cache hits solid; move offline tasks to batch; and once usage stabilizes, consider subscription plans and peak-shaving scheduling. Keep recomputing with a consistent cost model to make rational, sustainable selection decisions across multiple platforms.
