LLM API Pricing Comparison: How to Calculate the True Cost of Model Calls

    The per-million-token list price is not the real cost of an LLM API. This article explains why cross-platform comparisons go wrong, breaks down the full billing dimensions (cache hits, cache storage, multimodal inputs, retries), and shows how to compare discounts, off-peak rates, and overseas nodes on one basis. It includes illustrative cost estimates for five usage scenarios, pseudocode for a cost model, non-price selection criteria, a cost-reduction checklist, and a pre-purchase checklist.

    1. First, the conclusion: three common reasons price comparisons fail

    Procurement and architecture reviews often compare several platforms that serve the same model. The most common mistake is to treat the per-million-token unit price as the final cost. Real bills often deviate from expectations because of three types of problems:

    1. Incomplete pricing dimensions. Teams compare only input and output prices. They ignore cache hit prices, cache storage fees based on how long cached data stays resident, token conversion for multimodal inputs, minimum billing units, and token consumption from failed retries.
    2. Discount mechanisms that are not comparable. Limited-time discounts, offline batch discounts, subscription credits, and off-peak multipliers apply under very different conditions. Placing a 50%-off price and a 0.3× off-peak price on the same line is a measurement error.
    3. Ignored currency and region effects. A USD-denominated overseas node can be more expensive per token than a CNY list price once converted at the exchange rate. Different regions of the same provider can also differ in price, and they can add data-egress and compliance costs.

    The first principle of price comparison is therefore: quantify your traffic profile, match it to the available billing mechanisms, and only then compare unit prices.

    2. Breaking down the full set of billing dimensions

    A rigorous cost model should include at least the following components:

    1. Monthly cost = Σ(cache hits × cache hit price
    2. + cache misses × input price
    3. + output tokens × output price) × mechanism factor
    4. + cached tokens × cache storage price × residency time
    5. + multimodal input (token equivalent) × input price
    6. + extra token charges from failed retries and stream interruptions

    A few points that are easy to overlook:

    • Cache hit pricing is usually a fraction of the input price (commonly 0.2–0.3× across the industry). Its benefit is amplified by (input volume × hit rate), so for high-hit-rate workloads, the bill is determined almost entirely by the cache price.
    • Cache storage is charged by residency time, often with a TTL and a minimum billing granularity. For workloads with a stable prefix but sparse calls, storage fees can consume all of the savings from the cache discount.
    • Providers use different tokenizers, so the same text produces a different token count in different models. When comparing models, count tokens under each model’s own rules first. Otherwise, the unit-price comparison is meaningless.
    • Offline batch processing usually requires tolerance for delays of several hours. In exchange, you get a price reduction. Real-time interactive workloads generally cannot use it.

    3. Comparing discount mechanisms on the same scale

    Assume a model has the following standard prices: CNY 0.8 for input, CNY 0.23 for cache hits, and CNY 2.8 for output, per million tokens. The figures below are illustrative assumptions that demonstrate the calculation method, not actual vendor pricing:

    Channel type Input Cache hit Output Billing mechanism
    Official platform, standard price 0.8 0.23 2.8 Offline batch processing available, priced from the standard rate
    Official platform, limited-time price 0.4 0.115 1.4 50% off across the board; confirm the promotion period and end date yourself
    Third-party aggregator 0.8 0.23 2.8 Compatible with mainstream open API protocols, pay as you go
    Subscription-credits platform ≈ standard after conversion ≈0.23 ≈2.8 Prepaid credits plus a low off-peak multiplier (e.g., 0.3×)
    Overseas node USD 0.15 USD 0.03 USD 0.50 ≈ CNY 1.04 / 0.21 / 3.45 at an exchange rate of 6.9

    These extra “hidden items” also need to be noted:

    • Cache storage fees.
    • Quotas and rate limits (tokens per minute, concurrency caps).
    • Version availability. Model variants offered by different channels are often inconsistent. One channel may carry only the base version and not the lightweight variant. Comparing them directly then means comparing different things.

    4. Cost estimates for five typical monthly usage profiles

    Scenario 1: Real-time customer support (low cache hit rate, latency-sensitive)

    Input: 60M tokens (15% hit rate). Output: 6M tokens.

    Standard price: about CNY 59.7. Limited-time price: about CNY 29.8. Overseas node: about CNY 75.4. If this workload has clear off-peak troughs that can be scheduled, a 0.3× off-peak rate brings it down to about CNY 17.9.

    Conclusion: For real-time traffic, prioritize discount depth. Use off-peak multipliers only when you can shift traffic away from peak hours.

    Scenario 2: Offline document batch processing (high latency tolerance)

    Input: 500M tokens (40% hit rate). Output: 30M tokens.

    Standard price: about CNY 370. With offline batch conversion: about CNY 185. With the off-peak multiplier: about CNY 111.

    Conclusion: Asynchronous jobs should be matched first to off-peak/batch mechanisms. The savings far outweigh what you get by comparing channels of the same type against each other.

    Scenario 3: Assistant with a long system prompt (very high cache hit rate)

    Input: 800M tokens (92% hit rate, i.e., 736M hits and 64M misses). Output: 40M tokens.

    Standard price: about CNY 332.5. Limited-time price: about CNY 166.2. Suppose another channel offers a lower base price but charges the same for cache hits and misses (e.g., 0.4 / 1.4). Its cost is about CNY 376, more than double the limited-time option.

    Conclusion: The cache hit price matters more than the discount depth. This is the item most often miscalculated.

    Scenario 4: Multimodal image and text understanding (input-dominated)

    Input: 300M tokens (about 70% converted from images), 10% hit rate. Output: 15M tokens.

    Standard price: about CNY 266.6.

    Conclusion: For input-dominated workloads, the cache hit rate is low and there is limited room for optimization. Negotiate input prices and volume-based discounts first, not output prices.

    Scenario 5: Trial and small-scale validation

    Monthly input: 3M tokens. Output: 0.3M tokens. Total cost: about CNY 3.2.

    Conclusion: At this scale, switching channels yields far less than the integration and migration costs. Base the decision on API stability, quotas, and documentation quality rather than price.

    5. Illustrative cost calculation script (pseudocode)

    1. function monthly_cost(usage, price, options):
    2. hit = usage.input * usage.cache_hit_ratio
    3. miss = usage.input - hit
    4. base = hit * price.cache + miss * price.input + usage.output * price.output
    5. base *= options.mechanism_factor // 1.0 / 0.5 (offline) / 0.3 (off-peak)
    6. storage = usage.cache_tokens * price.cache_storage
    7. * usage.cache_hours * options.storage_factor
    8. retry = usage.input * options.retry_rate * price.input
    9. return base + storage + retry
    10. // Run the same usage through every channel and mechanism combination, take
    11. // the minimum, and record the assumptions used for each calculation

    The key point is to make the pricing assumptions explicit function parameters. Promotion end dates, cache TTLs, and rate-limit thresholds should be stored as auditable fields. They should not be scattered across documentation comments.

    6. Four non-price dimensions of platform selection

    1. API compatibility and migration cost. Compatibility with mainstream open API protocols determines whether switching means changing a few lines of configuration or rewriting the entire calling layer.
    2. Quotas and stability. The per-minute token limit, concurrency cap, and the meaning of rate-limit response codes directly affect whether a platform can handle peak traffic.
    3. Compliance and data flow. Multimodal inputs often contain images, audio, video, and business attachments. Overseas nodes can bring data-egress assessments and additional review costs. These rarely appear in a price table, yet they can drive the final decision.
    4. Version and quality consistency. Different variants of the same model are not interchangeable in quality or price. Build an offline evaluation set and make the final decision on a quality-per-cost score, not on price per million tokens.

    7. Cost-reduction engineering checklist (actionable now)

    • Stable prompt prefixes. Keep system instructions, tool definitions, and examples at the front to maximize the cacheable prefix. Move volatile content such as timestamps and random IDs to the end.
    • Cache-warmth management. Set sensible TTLs and pre-warming strategies for high-frequency prefixes. Otherwise, you improve the hit rate but pay more in storage fees.
    • Context compression. Replace long conversation history with summaries and retrieved snippets. This can significantly reduce the input share in long-context workloads.
    • Model tier routing. Send simple intents to lightweight variants and reserve larger models for complex reasoning. Fall back to the larger model when a confidence threshold is not met.
    • Off-peak scheduling and batching. Send non-real-time tasks through a queue so they fall into off-peak windows or qualify for offline batch discounts.
    • Observability and governance. Connect unified call logs and cost monitoring with alerts, tag costs by business line, and set budget thresholds. Drive optimization with unit-economics metrics, such as cost per thousand sessions or cost per document processed, rather than the absolute total on the bill.
    • Abstraction layer. Place a protocol-adaptation and routing layer between your own services and multiple upstream providers. It keeps you free to switch providers and renegotiate at any time, so you are not locked in by a single channel’s pricing strategy.

    8. Price-comparison checklist

    Item Must confirm?
    Input / cache hit / output unit prices Required
    Cache storage price and TTL rules Required
    Available discount mechanisms and their prerequisites (real-time / offline / time window) Required
    Promotion end date and whether it renews automatically Required
    Billing currency, exchange-rate source, regional price differences Required
    Rate-limit quotas and behavior when limits are exceeded Required
    Available model variants and their evaluation results Required
    Data flow and compliance requirements Required
    API protocol compatibility and migration effort Recommended

    9. Conclusion

    The right way to compare prices across platforms is not to find the cheapest row. First, characterize your traffic profile: cache hit rate, input-to-output ratio, latency tolerance, and peak/off-peak distribution. Then match discount mechanisms to that profile, and only use unit price to decide between the remaining options.

    Across mainstream public clouds such as Baidu AI Cloud, LLM services generally use similar pricing dimensions and discount forms. If you plug the calculation script above into your own cost accounting pipeline, you can recompute the best channel in seconds under the same assumptions. This holds whenever prices or promotions change, turning price comparison from a one-off research task into a repeatable engineering capability.