Rising LLM Pricing: Why Output Tokens Are Becoming the Core Cost

    As large language model (LLM) services adjust their pricing, developers must look beyond the surface-level per-million-token rates. This article explores the underlying billing structures of LLMs, breaking down input, output, and cache hit tokens. It highlights why the rise of reasoning models shifts the cost burden to the output side and provides a practical per-task cost estimation method to help engineers better manage budgets and model selection.

    1. Background: Look at the Billing Structure When Unit Prices Rise

    When LLM service unit prices are adjusted, a direct question arises: how much will the bill increase for the same API calls? Looking only at the per-million-token price often leads to one-sided conclusions. The listed price is just one facet of billing. The actual bill depends on three factors: the unit price of each token type, the number of tokens consumed per task, and the ratio of different token types.

    This article does not evaluate specific products but analyzes the engineering impact of such pricing changes from a general perspective, covering billing structures, cost accounting methods, budget control measures, and model selection strategies.

    2. Breaking Down the Billing Structure: Three Token Types, Three Prices

    Most LLM services bill by token, and common billing items fall into the following three categories.

    2.1 Input Tokens

    Input tokens refer to all content sent to the model in a request, including system instructions, conversation history, retrieved document fragments (RAG), and the user’s current question. The longer the input, the higher the input cost per call. Therefore, removing irrelevant context is the most direct way to control input costs.

    2.2 Output Tokens

    Output tokens refer to all content generated by the model. On most platforms, the output unit price is higher than the input unit price. The exact multiplier depends on the platform’s published pricing. The billing scope on the output side also needs separate verification. For instance, whether the model’s internal reasoning process is counted as output depends on the platform’s billing rules. Ignoring this will lead to underestimated budgets.

    2.3 Cache Hit Tokens

    When the prefix of a request matches a recent one, the server can reuse the previously calculated intermediate results. This portion is typically billed at a significantly lower unit price than standard input tokens. The pricing advantage of caching relies on stable request prefixes. If every request begins with dynamic content, such as a timestamp or a random session ID, cache hits become difficult to achieve.

    3. The Reasoning Model Era: Cost Gravity Shifts to Output

    In early conversational models, outputs were mostly direct answers, keeping the cost ratio between input and output relatively balanced. Reasoning models, however, generate longer intermediate thought processes before providing an answer. Most platforms count this content as output tokens.

    This brings two changes:

    First, output length is no longer determined solely by the answer content but also by the model’s depth of thought. For the same question, a higher thinking tier results in more output tokens and higher costs.

    Second, the correlation between cost and task difficulty strengthens. The cost difference between simple and complex tasks may far exceed the difference in listed token prices.

    Therefore, looking solely at the per-million-token price makes it difficult to gauge the true usage cost of a model.

    4. From Per-Token to Per-Task Pricing

    For scenarios involving machine calls—such as automated code modifications, batch document processing, or automatic ticket classification—it is more appropriate to use a single task as the accounting unit.

    The per-task cost can be estimated using the following formula:

    Task Cost = (Uncached Input Tokens × Input Price + Cached Tokens × Cache Price + Output Tokens × Output Price) / 1,000,000

    Where Uncached Input Tokens equals Total Input Tokens minus Cache Hit Tokens.

    4.1 Calculation Example

    The following example uses hypothetical prices solely to demonstrate the calculation method and does not represent any platform’s actual quotation.

    1. def task_cost(input_tokens, cached_tokens, output_tokens, price):
    2. """
    3. Calculate the cost of a single task.
    4. The unit of price is yuan per million tokens, containing input, cache_hit, and output fields.
    5. """
    6. if cached_tokens > input_tokens:
    7. raise ValueError("Cached tokens cannot exceed total input tokens")
    8. uncached = input_tokens - cached_tokens
    9. total = (
    10. uncached * price["input"]
    11. + cached_tokens * price["cache_hit"]
    12. + output_tokens * price["output"]
    13. )
    14. return total / 1_000_000
    15. PRICE = {"input": 4.0, "cache_hit": 0.4, "output": 16.0}
    16. # Scenario 1: Reasoning output of 35,000 tokens
    17. cost_a = task_cost(input_tokens=120_000, cached_tokens=90_000,
    18. output_tokens=35_000, price=PRICE)
    19. # Scenario 2: Reasoning output increases to 80,000 tokens
    20. cost_b = task_cost(input_tokens=120_000, cached_tokens=90_000,
    21. output_tokens=80_000, price=PRICE)
    22. print(f"Scenario 1 task cost: {cost_a:.3f} yuan")
    23. print(f"Scenario 2 task cost: {cost_b:.3f} yuan")

    The running results are as follows:

    1. Scenario 1 task cost: 0.716 yuan
    2. Scenario 2 task cost: 1.436 yuan

    4.2 Insights from the Results

    • In Scenario 1, output costs account for about 78% of the total cost. Even with a high cache hit rate on the input side, the cost structure is still dominated by output.
    • When the reasoning output increases from 35,000 tokens to 80,000 tokens, the output volume grows by about 1.3 times, but the per-task cost roughly doubles. Output length is the variable that needs the most control. The cost growth ratio brought by increased output depends on the proportion of output in the total cost. In Scenario 2, output costs already account for about 89%.
    • Without caching, the cost of Scenario 1 would be 1.040 yuan. Caching reduces the cost to 0.716 yuan, a decrease of about 31%. While the benefit of caching is substantial, it cannot offset the cost increase caused by extended output length.