LLM Token Cost: A Practical Guide to Evaluating the Real Cost of Large Language Models

    This guide explains why per-token price is only the surface of LLM cost. It shows how to convert subscription plans into comparable effective unit prices, how prompt caching and retry counts change the real bill, and how to build a repeatable, auditable cost evaluation and model routing workflow.

    1. The Misread “Cheap”: Unit Price Is Only the Tip of the Cost Iceberg

    When people discuss LLM API costs, the most common conclusion is that “one type of model costs only a fraction of another per token.” That statement is not wrong, but it covers only the most superficial layer of the cost structure. The real bill is determined by four variables together: billing unit price, the quota you can actually consume, discounts from caching and batching, and the number of retries required to complete a task. Any judgment based only on the first variable can fail in real business scenarios.

    Enterprise API pricing and consumer subscription plans follow two completely different pricing logics. API pricing is linear with usage and relatively transparent. Subscription plans are a bundled model of “fixed monthly fee plus a quota cap,” so you must divide the monthly fee by the estimated monthly token throughput to get a comparable unit price. Putting these two types of pricing side by side without normalization is a major source of cost misjudgment.

    2. Normalize the Basis: Convert Subscription Plans into Comparable Unit Prices

    The core formula is simple:

    1. Effective unit price (CNY per 100M tokens) = Monthly plan fee / (Average monthly consumable tokens / 1e8)

    The difficulty is the denominator. Average monthly consumption is not the same as the plan’s advertised cap; it depends on usage intensity. Industry testing commonly shows two extremes: heavy developers can approach or hit the quota cap, pushing the effective unit price extremely low; light users may consume less than 10% of the cap, which inflates the effective unit price by several times.

    An illustrative comparison (numbers are only for explaining the method, not data for a specific product):

    Billing type Monthly fee Estimated monthly usage Converted unit price
    Subscription A (heavy usage) ~1300 CNY ~10B tokens ~13 CNY/100M
    Subscription B (medium quota) ~200 CNY ~2B tokens ~10 CNY/100M
    Subscription C (small quota) ~100 CNY ~0.4B tokens ~25 CNY/100M
    Pay-as-you-go API (light model) As used Depends on calls Can be as low as single digits

    The conclusion is not that “subscriptions are always expensive” or that “APIs are always cheap.” It is that subscription costs are highly sensitive to usage intensity, while API costs are highly sensitive to call volume. Before choosing, you must first estimate your monthly call distribution.

    3. Caching: The Underestimated Cost Lever

    In scenarios with long context, repeated system prompts, and fixed knowledge bases, cache hit rates can often exceed 90%. Input tokens that hit the cache are usually billed at a significant discount, which can substantially reduce actual spending. But whether caching works depends on whether calls are made properly:

    1. Stable prefix: System prompts, tool definitions, and few-shot examples should be placed at the very front of the request and remain byte-level stable. Any timestamp or random ID will invalidate the prefix.
    2. Consistent order: Multi-turn conversations must append history messages rather than reorder them.
    3. Explicit reuse: For reusable long documents, design them as cacheable context blocks instead of concatenating them repeatedly every time.
    1. # Example: stable prefix + incremental append to improve cache hit probability
    2. SYSTEM_PROMPT = "You are a financial report analysis assistant. Output must be JSON." # Keep constant; do not insert timestamps
    3. def build_request(history, new_question):
    4. messages = [{"role": "system", "content": SYSTEM_PROMPT}]
    5. messages.extend(history) # Append only; do not reorder
    6. messages.append({"role": "user", "content": new_question})
    7. return messages

    It is important to emphasize that caching lowers average cost, not unit price. When budgeting, provide two estimates: cold start (no cache) and steady state (high hit rate), to avoid overly optimistic capacity planning.

    4. The Quality Dimension: Retries Are the Hidden Bill

    For the same task, models with different capabilities can require vastly different numbers of attempts. Let the cost per attempt be c and the expected number of attempts needed for success be n; the real cost is c × n. A cheap model that needs three trials on average to pass validation may cost more than a high-capability model that succeeds on the first try.

    Therefore, cost accounting must be tied to evaluation. A reusable approach is to build a small, fixed regression task set covering typical scenarios such as structured extraction, numerical statistics, and code modification, and use a unified scoring script to determine whether a task passes on the first attempt:

    1. Real cost = Σ(cost per attempt × number of attempts) / number of passed tasks
    2. Accuracy = number of tasks passed on first attempt / total number of tasks

    In public comparative tests, a common phenomenon is that most models approach saturation on structured statistics tasks, and both domestic Chinese and overseas models can enter the high-score range; on high-difficulty tasks such as long-chain code repair and cross-file refactoring, capability gaps widen significantly, and retry costs for low-price models rise accordingly. This means “cost-effectiveness” must be evaluated by task tier, not with a single global conclusion.

    5. Why Pricing Strategies Differ Between China and the US

    The differences in cost structure between the two markets mainly come from three points. First, differences in compute procurement and depreciation pressure lead to different payback periods and pricing floors. Second, differences in financing and cash flow environments allow some vendors to subsidize heavy users with subscriptions. Third, differences in user structure mean consumer subscriptions naturally have a long tail of “unused quota,” which vendors can use to design bundled prices. Understanding these three points explains why the effective unit price of the same type of model can reverse between the two regions, and helps predict the direction of future prices as compute costs fluctuate.

    6. A Practical Selection and Optimization Workflow

    1. Collect real usage: Instrument input/output tokens, cache hits, and failed retries to form a baseline of more than one week.
    2. Normalize the basis: Convert both subscription and pay-as-you-go forms into an effective unit price in the same unit.
    3. Tiered evaluation: Group tasks by difficulty, and measure first-attempt pass rate and average attempts per tier.
    4. Hybrid routing: Send simple tasks to a light model and escalate complex tasks to a high-capability model, using rules or a small model as a front-end classifier.
    5. Continuous regression: Re-run the task set after model version updates to prevent cost advantages from being canceled out by quality regressions.
    1. if task_difficulty == "low" and cache_hit_ratio > 0.8:
    2. route = "light_model"
    3. elif requires_multi_file_reasoning:
    4. route = "strong_model"
    5. else:
    6. route = "mid_model"

    7. Common Capabilities Needed When Deploying on the Cloud

    If you deploy the above approach on a cloud platform such as Baidu AI Cloud, you typically only need to combine general-purpose capabilities: use object storage to store evaluation sets and call logs, use a message queue to smooth peak and burst calls, use a container platform to host routing and retry services, and use logging and monitoring alerts to track token consumption, cache hit rate, and failure rate, with budget threshold alerts. These capabilities are decoupled from specific models, making it easy to migrate smoothly between models.

    8. Conclusion

    “Are domestic Chinese models cheaper?” is an incomplete question. The right question is: given a task distribution, given caching conditions, and given a quality threshold, which billing form has the lowest effective cost? Only by including all four variables—unit price, quota consumption rate, cache hit rate, and retry count—in the model can you reach a reproducible, auditable cost conclusion and avoid being misled by a single number during budget review.