LLM Cost Comparison: Why Per-Token Pricing Fails and How to Measure It Properly

    This article explains why comparing LLM prices across channels by a single per-token rate almost always fails, and offers a reproducible method for measuring and verifying real cost. It covers how to lock down variables such as input-output ratio, currency conversion, and version alignment; four typical price-gap patterns across first-party, hosted, and discount channels; a step-by-step verification workflow; six engineering levers for reducing bills; and a selection checklist for choosing a channel. Readers will learn how to reach their own conclusions for their own workloads rather than relying on any static price table.

    1. Background: Why “Unit Price Comparison” Almost Always Fails

    When teams integrate large model capabilities into real projects, the first obstacle is often not output quality but the bill. The same model, the same prompt, and the same call volume can cost several times more or less per month simply by switching the supply channel. Counterintuitively, price rankings follow no fixed rule—neither “official is always most expensive and resale is cheapest” nor “official is cheapest and resale adds a markup.” Instead, they shift dynamically with the model, version, region, and billing dimension.

    The root cause is that large model distribution has become layered: first-party endpoints operated by the model provider, managed services on major public clouds, third-party inference aggregation platforms, overseas aggregation gateways, and various discount-oriented relay services. Each layer has its own cost structure (compute procurement, operations, bandwidth, compliance), its own margin targets, and its own caching and batching strategies. Compressing all of these differences into a single number—price per million tokens—inevitably loses information.

    For that reason, this article does not repeat any specific platform’s pricing. Instead, it provides a reproducible measurement and verification method so readers can draw their own conclusions in their own scenarios.

    2. A Unified Measurement Basis: Lock Down the Variables First

    A cross-channel comparison only holds if differences in measurement basis are eliminated. Fix the following four items:

    1. Input-output ratio. Agent and code workloads typically feature long-context input and short structured output, with input accounting for about 30% and output about 70%; summarization and translation workloads are the opposite. A different ratio can flip the entire ranking.
    2. Weighting formula. Use cost = input_price × 0.3 + output_price × 0.7 to produce a single comparable number.
    3. Currency conversion. Quotes in multiple currencies must be converted at a unified exchange rate, with the conversion ratio and retrieval date noted in the article to ensure traceability.
    4. Version alignment. Compare only the same model and same version. If a channel offers only the previous generation, a lightweight variant, or a coding-specialized variant, mark it as “version not offered” rather than filling the gap with an approximate model.

    Illustrative implementation:

    1. def weighted_price(in_price, out_price, in_ratio=0.3, cache_price=None, cache_hit=0.0):
    2. """Convert to unit cost by input-output ratio; cache_hit is the cache hit rate"""
    3. base = in_price * in_ratio + out_price * (1 - in_ratio)
    4. if cache_price is None or cache_hit == 0:
    5. return round(base, 2)
    6. # Cached input tokens are billed at the cache price
    7. saved = (in_price - cache_price) * in_ratio * cache_hit
    8. return round(base - saved, 2)

    3. Four Typical Price-Gap Patterns

    After cross-checking multiple channels, price gaps usually fall into four patterns. Understanding the patterns is more valuable than memorizing numbers.

    Pattern 1: First-party endpoints are significantly cheaper than hosted resale. When a model provider uses an aggressive pricing strategy to compete for call volume, its first-party discounts can far exceed those of downstream hosts, resulting in resale prices several times higher than the first-party price. Here the intuition that “relays are more convenient, so a slight premium is expected” fails completely.

    Pattern 2: Hosted channels are highly consistent. Multiple third-party platforms often quote exactly the same price for the same model, indicating they share the same upstream supply and the same pricing tier. Comparison adds little value, and the real differences shift to rate limiting, availability zones, and settlement methods.

    Pattern 3: Version coverage is uneven. After a new flagship is released, channels list it at different times, and some offer only the previous generation or a specialized variant. Missing means missing—do not draw same-version conclusions from different-generation data.

    Pattern 4: Discount channels are overall cheapest, but compliance and stability need attention. Discounts can go as low as 10% to 30% of the official price, but data residency, rate-limiting policy, SLA, and invoice compliance must be evaluated independently.

    4. A Reproducible Verification Workflow

    Conclusions must be independently verifiable by readers; otherwise they are just opinions. Recommended workflow:

    • Define the candidate model and version list, and lock down the “same version” to be compared;
    • Visit each channel’s public pricing page one by one, recording four fields: input price, output price, cached input price, and batch price;
    • Convert to a unified currency and note the retrieval timestamp;
    • Mark missing fields as “not listed / not offered” without interpolation;
    • Generate comparable numbers with the weighting function above, and attach the calculation script;
    • When presenting conclusions, provide both a “unit price ranking” and a “scenario-based ranking.”

    Note that some vendors’ domestic sites render prices dynamically on the frontend, so scraping may not retrieve a complete price table. In that case, use the vendor’s public documentation or overseas site data instead, and note the difference in data source in the remarks.

    5. Six Levers for Bill Optimization

    Comparison is only the starting point; real cost reduction comes from engineering:

    1. Context compression: trim conversation history and deduplicate retrieved snippets; input tokens often balloon several times beyond expectations.
    2. Cache reuse: place stable system prompts and knowledge prefixes in cacheable positions; after a hit, input cost drops substantially.
    3. Output constraints: use structured output and length limits to suppress redundant generation; output unit price is usually higher than input.
    4. Tiered routing: send simple requests to lightweight models and complex reasoning to flagship models, using rules or a small classifier to split traffic.
    5. Batching and asynchrony: use batch channels for offline tasks, which usually come with separate discounts.
    6. Observability: integrate logging services and monitoring alerts, tag token consumption by business dimension, and only then can cost hotspots be located.

    Routing layer illustration:

    1. def route(task):
    2. if task["complexity"] == "low":
    3. return "light_model"
    4. if task["requires_long_context"]:
    5. return "long_context_model"
    6. return "flagship_model"

    6. Selection Decision Checklist

    • Does the channel offer the target version, not an approximate model;
    • Does the input-output ratio match your own workload;
    • Are cached-input billing and batch discounts supported;
    • Do rate limits, concurrency, and SLA meet peak demand;
    • Data compliance, residency region, and audit requirements;
    • Settlement currency, invoicing, and budget alert capabilities;
    • Is an abstraction layer retained that allows switching, avoiding lock-in to a single channel.

    7. Conclusion

    LLM cost-effectiveness is not a static price table but a function of “version × channel × workload ratio × engineering optimization.” Only by fixing the measurement basis, making data verifiable, and abstracting the call chain can you keep making the right choices in an environment of frequent price changes. If an enterprise wants to implement a similar approach on Baidu AI Cloud, it can build a unified gateway and cost dashboard on top of general cloud capabilities such as model services, logging services, and monitoring alerts, achieving a channel-agnostic, replaceable architecture.