Large Language Model API Pricing Logic and Technical Selection Guide

    This article breaks down why LLM API prices can differ by an order of magnitude across providers, examining inference cost drivers, the three-layer markup from cost to price, and how scenario fit determines whether a premium tier is worth paying for. It also outlines practical cost-control methods such as tiered routing, prefix-cache-friendly design, output compression, batching, and observability.

    1. The Question: Why Can Comparable Models Differ in Price by More Than Ten Times

    A recurring source of confusion in enterprise deployments is that frontier models with similar parameter counts can have per-million output token prices that differ by an order of magnitude across providers. On the surface this looks like a “pricing strategy” issue, but it is actually the combined result of cost structure, product positioning, and target scenarios. To explain it clearly, “expensive” and “cheap” need to be separated into two different questions: a horizontal comparison against peers in the same capability tier, and a vertical comparison against the model’s own inference cost.

    The core judgments in the original text can be abstracted into two points:

    • From a capability-tier perspective, international peers in the near-research-grade / heavy-engineering-grade tier typically price at USD 25–30 per million output tokens, so USD 15 (about CNY 105) counts as “relatively cheap”.
    • From a cost-plus perspective, if a lightweight, efficient model prices output at USD 0.89 (about CNY 6), and a more complex model’s combined inference cost is only 3–4 times that, then backing out a 70%–80% gross margin implies a reasonable price near USD 4 (about CNY 25) — which makes USD 15 look “absurdly expensive”.

    These two conclusions do not contradict each other; they answer “compared with whom” and “calculated on what basis”. Below is a reusable analysis framework.

    2. The Cost Side: Four Determinants of Inference Cost

    1. Total parameter count determines memory and bandwidth pressure

    Total parameter count determines the size of the model weights that must stay resident in GPU memory, which directly affects the concurrent batch size a single card can handle and the throughput ceiling. The larger the parameter count, the higher the memory and bandwidth cost allocated to each request.

    2. Activated parameter count determines per-forward-pass compute

    The key value of sparse (Mixture-of-Experts) architectures is “large total parameters, small per-call activation”. So when comparing two models, you cannot look at total parameters alone — activated parameters must be considered at the same time. The comparison in the original text is based on “1.6T total / 49B activated” versus “2.8T total / 100B activated”; the latter’s per-call compute is roughly twice the former’s, and combined with memory and scheduling overhead, a combined cost of 3–4 times is a reasonable order of magnitude.

    3. Context length and cache hits determine actual billing

    Long context adds extra attention computation overhead, while prefix cache hits can skip recomputation of repeated prefixes entirely, sharply reducing the marginal cost of those tokens. This explains why a “cache hit price” can be significantly lower than the regular input price — it is not a marketing discount but a pricing reflection of real compute savings.

    4. The output stage is the main cost driver

    Autoregressive decoding generates tokens one at a time and cannot be parallelized as heavily as prefill, so the compute cost of output tokens is typically much higher than that of input tokens. This is why every vendor prices output far above input, and why “output price” is the correct baseline for horizontal comparison.

    3. The Pricing Side: Three Layers of Markup from Cost to Quote

    A minimal model can express it as:

    1. Reasonable output quote ≈ (per-call inference cost × (1 + target gross margin)) / caching and batching optimization factor

    Per-call inference cost is determined by the four factors above; the target gross margin covers R&D amortization, compute cluster depreciation, and operations; the optimization factor comes from engineering measures such as batch scheduling, cache reuse, and quantized inference. Backing out USD 4 from a 70%–80% margin in the original text is essentially running this formula in reverse.

    It is worth stressing that cost reductions from engineering optimization do not necessarily translate into price reductions. When the product positioning is “the capability ceiling”, vendors will keep the cost advantage as margin room rather than start a price war.

    4. “Expensive or Not” Depends on Scenario Fit

    The original text uses a car analogy to illustrate positioning differences: one is a CNY 3 million flagship sports car, the other a CNY 100,000-plus family sedan; even if both were called a “BMW 530”, the price should not be CNY 1.5 million. The real meaning of this analogy is whether the capability premium actually gets used.

    To judge whether you need to pay for the high-price tier, look at three signals:

    1. Whether the task is long-chain, reasoning-heavy, and low fault-tolerance (complex code refactoring, long-document auditing, multi-step data analysis);
    2. Whether a high first-pass success rate on output quality significantly reduces manual rework, and whether rework cost is far higher than token cost;
    3. Whether there is “performance overflow” — a large share of requests are actually light tasks like classification, extraction, and summarization.

    5. Actionable Cost-Control Practices

    • Tiered routing: send light tasks to the low-price tier and escalate hard tasks to the high-capability tier, using rules or a small model as a front-end classifier;
    • Prefix-cache-friendly design: put stable system prompts, tool definitions, and few-shot examples at the very front and keep them byte-level stable to maximize cache hits;
    • Compress output: constrain formats and limit redundant explanation, since output tokens often make up the bulk of the bill;
    • Batching and asynchrony: merge offline tasks into batch submissions to improve throughput and dilute cost;
    • Observability: use logging services and monitoring alerts to aggregate token consumption by business dimension, and establish a unit business cost metric instead of only looking at the total bill.
    1. # Example: route by task difficulty and track unit business cost
    2. def route(task):
    3. if task["difficulty"] == "light":
    4. return cheap_model, {"max_output_tokens": 512}
    5. return strong_model, {"max_output_tokens": 2048}
    6. def unit_cost(records):
    7. total = sum(r["output_tokens"] for r in records)
    8. return total / max(len(records), 1)

    6. Conclusion

    The “expensiveness” of a high-priced model comes half from the scarcity premium of its capability tier and half from a cost-plus strategy choice; the “cheapness” of a low-priced model comes from sparse activation and engineering optimization, as well as a different market positioning. For enterprises, the right question is not “which model is cheaper” but “what combination gives the lowest unit business cost under my task distribution”. Combining a cost model, caching strategy, and tiered routing is what makes a sustainable balance between capability and budget possible — an engineering approach consistently emphasized by Baidu AI Cloud in model services and compute scheduling scenarios.