A Practical Guide to Evaluating the Real Cost of LLM Tokens

    List prices per million tokens are only the starting point for LLM cost evaluation. This guide breaks total cost into four layers—unit price, subscription conversion, prompt caching, and task-level pass rate—and explains why the cheapest API is not always the cheapest way to finish a task. It includes a cost estimation function, a practical optimization checklist, and guidance on choosing between pay-as-you-go and subscription pricing.

    1. The “Cheap” Illusion: List Price vs. Your Actual Bill

    The most common mistake in evaluating LLM API costs is treating the published price per million tokens as the final expense. That number describes the price of a unit of resources, not the total resources a task requires. Your real bill equals unit price multiplied by actual consumption, and actual consumption varies with context length, retry count, cache reuse rate, and output length strategy. That variance is often far larger than the price gap between models.

    A quick comparison of public pricing shows that API list prices for leading domestic models are typically only 30% to 60% of comparable flagship models overseas. The gap is even wider for lightweight models—some are priced at less than 3% of a mid-tier overseas model. On this layer alone, domestic models look overwhelmingly cheaper.

    Switch to the individual subscription market and the ranking nearly inverts. Some monthly coding subscription plans work out to roughly a dozen yuan per 100 million tokens in effective cost, while comparable plans from several domestic vendors range from just over 20 yuan to more than 100 yuan. Only a few lightweight plans come in below the overseas option.

    This is not a data error. Two different cost perspectives are being mixed together. To untangle them, break cost into four layers.

    2. The Four-Layer Cost Model: From Unit Price to Total Cost

    Layer 1: Unit Price Reflects Resource Pricing Only

    Unit price is determined by model tier: flagship models cost more, lightweight models cost less. Input and output are usually priced separately, with output priced higher than input. This layer is useful for comparing models within the same tier, but not for budgeting.

    Layer 2: Subscription Conversion—Quota Ceiling Is Not Actual Usage

    The key variables in a subscription are the monthly quota ceiling and the real utilization rate. Vendors can advertise extremely low effective unit prices because they assume most users will not exhaust their quota—a common industry rule of thumb is that actual consumption stays below 10% of the ceiling. Heavy developers may consume several times the quota of an average user, so the effective unit price of the same plan can differ by an order of magnitude across user groups. Whenever you see a claim like “only X yuan per 100 million tokens,” the first question should be: is X calculated against the quota ceiling or against my actual usage?

    Layer 3: Caching—The Most Overlooked Discount

    Mainstream inference services generally offer context caching: when a request prefix (system prompt, tool definitions, long documents, conversation history) overlaps with previous requests, the repeated portion is billed at a significantly lower price. In practice, cache hit rates in coding scenarios often exceed 90%, and some long-context scenarios approach 97%. Moving the cache hit rate from 30% to 90% can cut input costs several times over on the same bill. A cost model that ignores caching can be wrong enough to overturn the entire selection decision.

    A schematic cost estimation logic can be written as:

    1. def estimate_cost(input_tokens, output_tokens,
    2. price_in, price_out,
    3. cache_hit_ratio=0.0, cache_discount=0.1,
    4. retry_factor=1.0, pass_rate=1.0):
    5. cached = input_tokens * cache_hit_ratio
    6. fresh = input_tokens - cached
    7. cost = (fresh * price_in
    8. + cached * price_in * cache_discount
    9. + output_tokens * price_out)
    10. return cost * retry_factor / pass_rate

    Here retry_factor is the average number of retries and pass_rate is the first-attempt success rate; together they capture task-level cost.

    Layer 4: The Task Layer—First-Attempt Pass Rate Decides the Total

    This is the layer most often skipped and the most important. When the same financial-report analysis task was given to 20 models and run 60 times, 9 models achieved 100% accuracy, 6 of them domestic. One lightweight model cost only 0.25 yuan per run, less than 3% of the most expensive model. But on high-difficulty tasks such as complex code refactoring or long-standing bugs, cheaper models may need several times more attempts, while a more expensive, more capable model that gets it right on the first try can end up with a lower total cost.

    Formalizing this layer gives the decision formula:

    Total cost = (input cost + output cost − cache discount) × retry count ÷ first-attempt pass rate

    The real question in model selection is not “how much per million tokens,” but “how much to complete my task.”

    3. Why Cost Structures Differ Between China and the US

    The difference is not purely a technology gap; it comes from different business models. Leading overseas vendors, backed by large-scale funding, use low-price subscriptions to subsidize heavy developers while betting that most users will not exhaust their quota. Domestic vendors face greater pressure on compute procurement and payback, so they lean toward low-price APIs to compete for enterprise call volume, and position their subscription plans more conservatively. This explains the inversion: domestic options are cheaper on the API side but more expensive on a converted subscription basis.

    The takeaway for enterprises: the purchasing model affects your bill more than the model tier does. Teams with concentrated, predictable call volume usually save the most with pay-as-you-go plus caching optimization. Teams with volatile usage that centers on interactive development get more control from subscriptions plus quota monitoring.

    4. An Actionable Optimization Checklist

    • Stabilize prefixes: place system prompts, tool schemas, and reference documents at the very front of the request and avoid randomizing them to maximize cache hits.
    • Slim down context: inject retrieved snippets on demand and summarize or compress conversation history instead of resending everything every turn.
    • Tiered routing: send simple classification and extraction to lightweight models and complex reasoning and code generation to flagship models, using rules or a small model as a front-end discriminator.
    • Constrain output: set explicit max_tokens and structured output requirements to reduce wasted generation.
    • Observability: log input, cache hits, output tokens, and task success or failure per request; build a cost dashboard by business dimension and configure budget alerts.
    • Evaluation-driven selection: benchmark with the pass rate and retry count of your own tasks rather than relying on general leaderboards.

    5. Conclusion

    The token unit price is only the entry ticket. Real cost is determined by cache hit rate, first-attempt pass rate, and retry count. Build a four-layer cost model, upgrade the question from “how much per million tokens” to “how much per completed task,” and layer a cost observability system on top of general capabilities such as monitoring and alerting, logging, and object storage on platforms like Baidu AI Cloud. Only then can you make selection decisions that hold up against the bill while balancing budget, quality, and stability.