LLM API Price Hikes: How to Break Down Costs and Choose the Right Model

    As large language model API prices rise, developers must understand how costs are generated and how to select the appropriate model. This article breaks down the API pricing structure, including input, output, and cache-hit costs. It explains the cost calculation for a single API call, how parameter scale, inference bottlenecks, and training costs affect pricing, and why caching can significantly reduce expenses. Finally, it provides actionable steps for developers to estimate costs and for enterprises to implement model tiering to balance efficiency and accuracy.

    Where Do the Price Hikes Come From? Check the Pricing Table

    Let’s take the public pricing of a certain vendor’s flagship model as an example: input is 20 units per million tokens, output is 100 units per million tokens, and cache-hit input is 1 unit per million tokens. (This is the public price excluding taxes; please refer to the official announcement for accuracy.)

    It has been reported that this price is about 5 times that of the previous generation’s model of the same tier. Since the specific pricing of the previous generation and the official announcement link were not provided, the analysis in this article is based on the current pricing. Readers should verify the price increase against official announcements themselves.

    When analyzing pricing, the proportional relationship between billing items is more informative than the absolute numbers.

    Billing Item Unit Price (units/million tokens) Relative to Regular Input Relative to Output
    Regular Input 20 100% 20%
    Cache-Hit Input 1 5% 1%
    Output 100 500% 100%

    The output unit price is 5 times the regular input price and 100 times the cache-hit price. In a single API call, output tokens are often the primary source of cost.

    Note: Prices may change with official policy adjustments. The calculation methods below do not rely on a fixed unit price; you can simply substitute the latest pricing.

    How to Calculate the Cost of a Single Call

    The formula for the cost of a single call is as follows:

    Single Cost = (Uncached Input tokens × 20 / 1,000,000) + (Cache-Hit tokens × 1 / 1,000,000) + (Output tokens × 100 / 1,000,000)

    Here, “uncached input” refers to the input tokens not present in the cache. The cache-hit portion is calculated separately at the cache price. The sum of both parts constitutes the total input.

    Let’s look at an example. Assume a request has a total input of 10,000 tokens, of which 8,000 hit the cache and 2,000 do not. The model outputs 1,000 tokens.

    • Uncached input: 2,000 × 20 / 1,000,000 = 0.040 units
    • Cache hit: 8,000 × 1 / 1,000,000 = 0.008 units
    • Output: 1,000 × 100 / 1,000,000 = 0.100 units
    • Total: 0.148 units

    If the same request had no cache, all 10,000 tokens would be billed as regular input, resulting in an input cost of 0.200 units and a total cost of 0.300 units. Caching reduced the cost of this request by approximately 50.7%. The output portion accounted for about 67.6% of the total cost, remaining the largest component.

    When estimating, you must use actual data rather than just looking at unit prices. It is recommended to track three metrics from your logs: average input tokens, cache hit rate, and average output tokens. The cache hit rate determines the lower bound of your input costs, while the output length determines the upper bound of your total costs.

    How Parameter Scale Affects Inference Costs

    The more parameters a model has, the more computation and VRAM are required during inference. In terms of VRAM, the footprint of the model weights is roughly equal to the number of parameters multiplied by the number of bytes per parameter. For a 70-billion parameter model: under FP16 precision, weights take about 140 GB; under INT8, about 70 GB; under INT4, about 35 GB. This does not include the KV cache during inference, which grows with context length and concurrency.

    Regarding throughput, the generation phase requires reading the entire model weights to generate each token, a speed often limited by memory bandwidth. On the same hardware, more parameters mean fewer tokens generated per second per card. Consequently, the hardware cost amortized per token is higher. This is a common justification for vendors raising unit prices.

    However, sparse architectures change this dynamic. Mixture of Experts (MoE) models have a large total parameter count but only activate a subset of experts per token, meaning the actual computation per inference is closer to that of a smaller dense model. Therefore, total parameters and actual inference computation are two different metrics; focus on the latter when comparing prices.

    Applicable boundaries: The impact of parameter scale has limits. Quantization methods, batching strategies, hardware models, and the vendor’s scheduling efficiency also play significant roles. Models with identical parameter scales can have noticeably different unit prices across different platforms.

    The Impact of Training Costs on Pricing

    Training a large language model requires massive computational power and data, typically representing a significant one-time upfront investment. The computation required for training can be roughly estimated as 6 × number of parameters × number of training tokens, measured in FLOPs.

    Training costs and single-call costs are distinct concepts. During inference, the model weights are fixed, and training expenses do not recur with each request. Vendors must recoup their training investments through the pricing of massive API calls. If a model has low call volume, the training cost is spread across fewer calls, naturally leading to a higher unit price.

    Applicable boundaries: Training costs are difficult to observe externally. Vendors might raise prices due to increased training investments, or lower them due to competitive pressure. Looking solely at training costs cannot explain price changes; it must be evaluated alongside call volume, competitor pricing, and official statements.

    Why the Caching Mechanism Saves Money

    When an LLM processes input, it first computes the entire context to generate intermediate results, known as the KV cache. If the prefix of a subsequent request matches a previous one, the server can directly reuse these intermediate results, skipping redundant calculations. This is the principle behind cache hits.

    For developers, caching is valuable in scenarios with long, fixed prefixes. For instance, when system prompts are long, knowledge base content is static, or multi-turn dialogue history continuously accumulates. In these scenarios, most of the prefix can hit the cache, significantly reducing costs.

    Caching comes with usage conditions. Common limitations include:

    • Only identical prefixes can hit the cache; changing the prefix content invalidates it.
    • Caches typically have a Time-To-Live (TTL); they must be rewritten after timing out.
    • There may be minimum length requirements, preventing short texts from utilizing the cache.
    • Some platforms charge separately for writing to the cache.

    These rules vary by vendor; always refer to the official documentation. If you are unsure about caching rules, set the hit rate to 0% during your estimation to see the cost ceiling, then gradually increase it.

    Applicable boundaries: Caching only saves input-side costs. Output tokens cannot be saved through caching, so in the example above, caching only reduces the input portion, while output remains the primary cost.

    How Developers Should Estimate Costs

    Step 1: Gather three metrics from your API call logs: average input tokens, average output tokens, and cache-hit token ratio.

    Step 2: Plug these numbers into the formula above to calculate the single-call cost. Multiply this by your daily call volume to get daily and monthly costs.

    Step 3: Perform two sets of comparisons: with cache vs. without cache, and a 20% reduction in output length vs. no reduction. Observe which factor impacts the total cost the most, and decide on your optimization direction accordingly.

    There are three common mistakes to avoid during estimation:

    1. Estimating based only on input prices and ignoring output.
    2. Assuming the cache will always hit, when in reality prefixes often change.
    3. Using parameter count as a proxy for actual performance to determine cost-effectiveness.

    How Enterprises Should Choose Model Tiers

    The concept of model tiering involves allocating models based on task difficulty. Most business requests do not require the most powerful model. Enterprises can categorize tasks into three tiers:

    • Simple tasks: Classification, information extraction, format conversion, short text rewriting. These tasks can usually be handled by smaller, cheaper models.
    • Medium tasks: Routine Q&A, summarization, general code modifications. Mid-tier models can be used, and prompt optimization can improve stability.
    • Complex tasks: Multi-step reasoning, long document analysis, high-stakes decisions. These tasks warrant the use of flagship models.

    After tiering, you must evaluate using real-world samples. Take a batch of historical requests, run them through different models, and compare accuracy, latency, and single-call cost. If a mid-tier model already meets your business accuracy requirements, there is no need to use a flagship model.

    Enterprises should also set budget caps and fallback strategies. For example, if daily costs exceed a threshold, automatically switch to a lower-tier model, or reserve flagship models only for key users.

    Summary and Actionable Recommendations

    While the specific price increase percentage cannot be independently verified from the source material, one thing is clear: output is the primary cost driver, caching can significantly reduce input costs, and the impact of parameter scale and training costs on pricing must be evaluated alongside actual call data.

    It is recommended to take action in three steps: First, calculate your current costs using the formula and real logs. Second, optimize through caching and output length control. Finally, implement model tiering based on task difficulty and validate quality using real samples. Always rely on official announcements for price information and double-check the latest pricing table before performing calculations.