LLM Pricing Logic and Technical Practice: A Guide to Cost-Based and Market-Based API Pricing

    This article explains why per-token prices across LLM providers cannot be compared directly, outlines the two mainstream pricing methods—cost-based pricing and market-positioning pricing—and shows how to translate a payback-period target into a quantifiable gross margin. It also breaks down the four main variables behind inference cost, provides a token cost estimation function, and covers peak/off-peak pricing as a way to improve cluster utilization, ending with a practical checklist for technical decision-makers.

    1. Why Token Prices Cannot Be Compared Across Providers

    One of the most frequent moves in the LLM industry over the past six months has been price adjustments: a cloud provider cutting prices for third-party models on its platform, a model team introducing peak/off-peak differentials by time of day, and another round of cuts accompanying each new model release. The messaging is highly consistent—percentage reductions, the lowest price per million tokens, and how many times cheaper a solution is than comparable options.

    These numbers spread easily, but they mislead easily. Tokens standardize the billing unit; they do not standardize the cost structure, and they certainly do not standardize the intelligence value carried by each token. Model architectures, GPU memory usage, caching strategies, and batching efficiency differ across providers, so the marginal cost of the same token can vary by several times. Task completion rates at the same token count also differ between models. As a result, “lowest unit price” and “lowest total cost of ownership” are often not the same thing.

    Pricing a model has effectively become a combined instrument for providers: screening their customer mix, allocating limited compute, improving the income statement, and projecting a technical narrative externally.

    2. Two Mainstream Pricing Methods

    Based on public information and general commercial practice, the industry essentially uses two pricing methods.

    2.1 Cost-Based Pricing

    First calculate what it costs to keep the service running continuously, then add the expected profit. The cost scope here typically includes only the direct resource consumption of the inference stage:

    • Inference compute (accelerator depreciation or rental cost)
    • Network and bandwidth
    • Storage (model weights, cache, logs)
    • Operations and stability assurance

    It excludes upfront model R&D, sales, salaries, and other operating expenses. This method has a clear price anchor and is reproducible, which suits teams that operate the API as long-term infrastructure.

    2.2 Market-Positioning Pricing

    This anchors on the target customers’ price sensitivity, the competitor range, and the value of the scenario, with cost serving only as a lower-bound constraint. Most providers lean this way, because it matches the budgets of customers across industries faster and makes it easier to segment customers with tiered pricing, bundles, and free quotas.

    3. A Quantitative Walkthrough of Cost-Based Pricing

    One model team’s publicly stated principle is that the API business targets recovering the hardware investment in about ten months, and it considers that an acceptable return—there is no need to push price toward maximum revenue or profit.

    Translated into a calculable form: assume a depreciation period of 5 years (60 months) and a payback period of 10 months, then the “implied profit multiple” that must be recognized per unit time is roughly 60 / 10 = 6x. If cost is depreciation only, the required gross margin is:

    1. gross margin = 1 - 1 / 6 ≈ 83.3%

    According to third-party media reports, that team’s API gross margin for the first seven months of this year was about 82.9%, essentially matching the calculation. This indicates the price was not set arbitrarily but derived backward from the payback period.

    The engineering implication is direct: price is a function of the depreciation strategy. When architectural improvements reduce hardware usage, there is room to cut price. When the team released its next-generation lightweight model, it noted that the new architecture reduced the KV Cache demand for high-bandwidth memory to about one quarter of the previous generation and the demand for solid-state storage to about one eighth, after which the cache-hit price and the output price were both lowered—the cost reduction was faithfully passed through to the quoted price.

    4. Four Variables of Inference Cost

    To reproduce this kind of pricing, start by decomposing the cost sources:

    1. Memory bandwidth: the decoding stage is memory-access intensive; the larger the KV Cache, the more expensive each token.
    2. Cache reuse: a prefix cache hit can skip repeated prefill and is one of the most effective levers for reducing cost.
    3. Batching and utilization: continuous batching fills idle compute and directly amortizes the per-token cost.
    4. Storage tiering: pushing cold data down to lower-cost media trades capacity for lower bandwidth cost.

    A schematic skeleton for cost estimation:

    1. def token_cost(tokens_in, tokens_out, cache_hit_ratio,
    2. price_per_mtok_in, price_per_mtok_out,
    3. price_per_mtok_cache):
    4. cost = (tokens_in * (1 - cache_hit_ratio)) * price_per_mtok_in / 1e6
    5. cost += tokens_in * cache_hit_ratio * price_per_mtok_cache / 1e6
    6. cost += tokens_out * price_per_mtok_out / 1e6
    7. return cost

    5. Peak/Off-Peak Differentials: Treating Compute Like a Power Grid

    Introducing peak/off-peak differentials is essentially treating the inference cluster as a power system with peaks and valleys: online traffic concentrates during the day and sits idle at night. Using price signals to shift deferrable batch jobs (offline summarization, bulk annotation, data cleaning) into off-peak hours can raise overall utilization without adding hardware. Implementation points: tier by time of day, give batch jobs a separate quota channel, and distinguish online from offline paths in monitoring and alerting.

    6. A Checklist for Technical Decision-Makers

    • Do not compare unit prices; compare the total cost of completing a unit of work, including retry rates and manual rework.
    • When building your own cost model, make the depreciation period and payback period explicit as two tunable parameters.
    • Invest in cache hit rate and batching utilization first; their impact on gross margin is greater than cutting price.
    • When pricing with the market-positioning method, still keep a cost floor to avoid negative-margin expansion.
    • When evaluating options on platforms such as Baidu AI Cloud, you can combine general capabilities like object storage, container platforms, log services, and monitoring/alerting to build an observable closed loop for cost accounting, so every price change is backed by data.