LLM API Pricing: Understanding Inference Costs and Choosing the Right Model

    Higher LLM API prices do not necessarily mean higher costs per completed task. This article examines input, output, and cached-token pricing; explains how reasoning volume and success rates affect real spending; compares subscriptions with pay-as-you-go billing; and outlines engineering practices for controlling inference costs.

    A recent model release from a Chinese LLM provider sparked debate after its API prices rose to roughly five times those of its predecessor. Output pricing reached around RMB 100 per million tokens, compared with about RMB 20 for input tokens and as little as RMB 1 for cached input.

    The price increase is only part of the story. For developers, the more useful questions concern the structure of inference costs, how different billing models compare, and whether strong benchmark results translate into affordable production use.

    Rather than focusing on a particular product, this article examines those questions from a general technical perspective.

    1. Understanding the Three Layers of LLM API Pricing

    Many LLM inference services distinguish between three types of usage:

    1. Input tokens: The context sent to the model, including prompts, conversation history, and retrieved passages. Processing this input during the prefill stage generally has a lower per-token cost than generating output.
    2. Output tokens: The content generated by the model. Autoregressive decoding proceeds token by token and is highly sensitive to memory bandwidth. Output tokens therefore commonly cost several times more than input tokens; a ratio of around five to one is not unusual.
    3. Cached input tokens: When a request shares a context prefix with an eligible recent request, the service can reuse previously computed key-value, or KV, cache entries. This avoids much of the prefill computation, allowing cached-token prices to fall to one-tenth of the standard input rate or less.

    The key takeaway is that the cache-hit ratio is a hidden lever in actual API spending.

    In coding assistants and AI agents, system prompts and tool definitions can make up most of the input and remain highly repetitive. Cache-hit ratios may exceed 80% in such workloads. Under those conditions, the advertised uncached input price becomes much less informative: output usage and cache design have a greater influence on the bill.

    2. Is a Fivefold Price Increase Necessarily Expensive?

    An absolute price tells you little without a reference point. Two comparisons matter.

    Capability tier

    If a model reaches the leading tier on recognized benchmarks, comparing its pricing with similarly capable models can be reasonable.

    Inference costs are influenced by model size, active parameter count, and context length. Improvements in capability can come with higher serving costs. A previous generation’s low price may also have reflected a customer-acquisition strategy rather than a sustainable cost baseline.

    Cost per successful task

    This is easier to overlook and often more important. Two models with identical token prices can incur very different costs for the same task.

    • Reasoning volume: Models that perform extended reasoning may generate substantial intermediate reasoning tokens, which can be billed at output rates. For demanding workloads, a task can consume hundreds of thousands of output tokens.
    • Task success rate: A weaker model may need repeated attempts or human intervention. Every retry adds token consumption.
    • Context efficiency: Models with smaller context windows or weaker long-context performance may require more elaborate chunking and retrieval workflows, increasing engineering overhead.

    The right comparison is therefore not simply token price, but average cost per successful task:

    Average cost per successful task = Average token cost per attempt ÷ Task success rate

    The token cost per attempt should account for input, cached input, and output at their respective rates.

    Some third-party evaluations have reported that certain newer models consume nearly as many tokens per task as leading international models. When that happens, lower token prices may provide much less end-to-end savings than expected.

    3. The Subscription “Nominal Allowance” Trap

    Some subscriptions advertise usage allowances whose value, calculated at published API rates, is many times the monthly fee.

    For example, a subscription costing around $20 per month may offer an allowance nominally equivalent to several hundred dollars of API usage. Higher tiers may advertise a ratio approaching 50 times the subscription fee.

    The business logic rests on uneven usage. Most subscribers use far less than their full allowance, so providers can price around average consumption. It resembles a gym membership: customers buy access, but not everyone uses it heavily.

    Some comparable offerings in the Chinese market have much smaller ratios. A subscription costing roughly RMB 200 per month may provide an allowance valued at around RMB 1,000–3,000 at API list prices—approximately six to fourteen times the subscription fee, depending on the plan.

    This creates a seemingly contradictory outcome: a provider can offer lower API list prices yet be more expensive for heavy users comparing subscription plans.

    Developers should draw three practical lessons:

    1. Light and moderate users should evaluate subscriptions first. If monthly consumption consistently stays below about 30% of a plan’s allowance, a subscription with a high allowance-to-fee ratio may offer substantially lower effective unit costs than pay-as-you-go billing.
    2. Heavy users need an end-to-end calculation. Estimate monthly task volume, tokens per task, and the applicable token rates, then compare the result with available subscription tiers.
    3. Treat API-equivalent allowance claims cautiously. A statement such as “includes $X worth of usage” is only meaningful when checked against your actual workload and consumption pattern.

    4. Engineering Practices for Reducing Inference Costs

    Regardless of the provider, several engineering practices can help control spending.

    Maximize cache reuse

    Place stable content, such as system prompts and tool definitions, at the beginning of the context. Put changing content later so the reusable prefix stays consistent.

    Avoid inserting timestamps or other frequently changing fields into that prefix.

    Control output length

    Use prompts to specify the required format and level of detail. Structured responses can reduce unnecessary prose and, in suitable workloads, cut output-token usage by 30% or more compared with unconstrained responses.

    The goal is to remove unnecessary generation without sacrificing the information needed to complete the task.

    Route tasks by model capability

    Use lower-cost models for simpler operations, such as classification and rewriting, and reserve flagship models for complex reasoning.

    Depending on the workload, cheaper models may be able to handle 70–80% of requests. The relevant measure is whether they complete those requests successfully, not merely whether they can produce an answer.

    Use asynchronous and batch processing

    For tasks that do not require immediate responses, consider batch processing. Many providers offer significant discounts for asynchronous batch inference.

    Monitor usage and configure alerts

    Instrument the request pipeline to track token consumption by business function. Combine usage logs with monitoring and alerts to detect abnormal spending, including runaway retry loops and expanding conversation contexts.

    5. Conclusion: Measure the Cost of Useful Intelligence

    Benchmark performance is an entry requirement, not a complete measure of production value. What matters is the cost of useful intelligence: how much it takes to complete a real task successfully.

    Even a model with a top-three benchmark result may be difficult to justify if its end-to-end task cost is several times that of an alternative.

    For developers, a price increase is not automatically a reason to switch providers. It is a reason to establish a workload-specific cost framework:

    • Measure cost per successful task.
    • Make effective use of caching.
    • Route tasks to appropriately capable models.
    • Reassess subscriptions against pay-as-you-go billing as usage changes.

    As prices evolve alongside model capabilities, teams that understand their own cost structure will be better positioned to spend their inference budgets effectively.