LLM API Pricing: How Much Does 1 Million Tokens Cost?

    The cost of 1 million tokens depends on whether they’re uncached input, cached input, or output. This guide explains how LLM API pricing works, calculates the daily and monthly cost of a document Q&A assistant, and shows how to reduce spending and compare models by cost per task.

    1. Why There’s No Single Price for 1 Million Tokens

    When comparing large language models, developers often ask, “How much does this model cost per million tokens?” The answer depends on what kind of tokens make up that million. LLM APIs typically distinguish between three billing categories:

    1. Uncached input tokens: The parts of your request that are billed at the standard input rate, such as system instructions, context, and the user’s question.
    2. Output tokens: The tokens the model generates in its response.
    3. Cached input tokens: Tokens in a request prefix that matches a previous request, such as a long system prompt or fixed knowledge base context. Some providers bill eligible cache hits at a discounted rate.

    Output tokens often cost five to ten times as much as uncached input tokens, while cached input may cost just 10% to 20% of the standard input rate. Two models with similar input prices can therefore produce very different bills if their output rates differ. Prices can also vary by tens of times across providers and model tiers.

    Start by measuring how much input and output your workload uses, and how much of that input can be cached. Then apply each model’s rates to that mix instead of comparing a single price per million tokens.

    2. How Token-Based Billing Works

    What Is a Token?

    A token is a unit of text that a language model processes. As a rough estimate, one token corresponds to about 0.75 English words. For Chinese text, a token can represent one or two characters, although the exact count varies by tokenizer and text. Use these figures as a starting point for estimating your workload.

    If prices are quoted per million tokens, estimate the cost of a request as follows:

    1. Request cost ≈ (
    2. uncached input tokens × input rate
    3. + cached input tokens × cached input rate
    4. + output tokens × output rate
    5. ) / 1,000,000

    Count cached input separately so it isn’t also billed at the standard input rate in your estimate.

    Example Prices by Model Tier

    The following rates are illustrative, not current quotes from any provider. Check the provider’s official pricing page before budgeting.

    Model tier Uncached input per 1M tokens Cached input per 1M tokens Output per 1M tokens
    Flagship $5.00 $0.50 $30.00
    Mid-tier $2.00 $0.20 $12.00
    Lightweight $0.20 $0.02 $1.20

    In this example, output costs six times as much as uncached input. One reason output is often priced higher is that the model generates tokens sequentially, one at a time. Cached input costs one-tenth of the standard input rate here, making caching particularly valuable for workloads that repeatedly send long, fixed prefixes. The flagship tier also costs 25 times as much as the lightweight tier at these rates, so it pays to test how much capability the task actually requires.

    3. Worked Example: A Document Q&A Assistant

    Suppose you run an enterprise document Q&A assistant that handles 10,000 requests per day. A typical request uses:

    • 8,000 cached input tokens for a fixed prefix containing the system prompt and retrieved document excerpts. This estimate assumes the prefix hits the cache on every request.
    • 200 uncached input tokens for the user’s question.
    • 600 output tokens for the model’s answer.

    Using the illustrative mid-tier rates above:

    1. Daily cached input cost = 10,000 × 8,000 / 1,000,000 × $0.20 = $16
    2. Daily uncached input cost = 10,000 × 200 / 1,000,000 × $2.00 = $4
    3. Daily output cost = 10,000 × 600 / 1,000,000 × $12.00 = $72
    4. Total: $92 per day, or about $2,760 per 30-day month

    Three takeaways stand out:

    1. Output accounts for nearly 80% of the bill. The document prefix contains far more tokens than the answer, but the answer costs more to generate than the cached prefix costs to send.
    2. Without caching, the daily bill more than doubles. The same prefix would cost $160 per day at the standard input rate instead of $16, bringing the total to $236 per day.
    3. A lightweight model could cut the bill to one-tenth of the mid-tier cost at the example rates, provided it meets the same quality requirements.

    The best-value model depends on the mix of input and output tokens, the length of the context, request volume, and how demanding the task is.

    4. Practical Ways to Reduce LLM API Costs

    Keep Responses Concise

    When output is the largest cost, start by reducing unnecessary generation:

    • Ask for a concise answer and specify a length limit.
    • Use a table or bullet points when a structured response can replace lengthy prose.
    • For long-document summarization, consider several short summaries instead of one long response.

    Reuse Identical Prefixes for Caching

    If your application repeatedly sends the same system instructions, knowledge base excerpts, or few-shot examples, keep the reusable prefix identical across requests. Assemble its components in the same order so the prefix can qualify for a cache hit. This can reduce input costs without changing what the model is asked to do.

    Route Simple Tasks to Cheaper Models

    A routing layer can send straightforward tasks such as intent classification, format conversion, and keyword extraction to a lightweight model. Use a mid-tier model for tasks that require deeper understanding of long documents, and reserve the flagship model for complex reasoning or critical decisions.

    1. def route(question):
    2. if is_simple_task(question): # Classification, extraction, format checks
    3. return cheap_model
    4. elif needs_long_context(question): # In-depth analysis of long documents
    5. return balanced_model
    6. else: # Complex reasoning or critical decisions
    7. return flagship_model

    Depending on the workload, routing can reduce overall costs by 50% to 80%.

    Compress Context and Conversation History

    In multi-turn conversations, avoid sending the full transcript with every request. Summarize earlier turns and keep only the most recent ones verbatim. This can cut input token usage by more than half.

    Monitor Usage and Set Budget Alerts

    Log token usage for each call and set alerts when spending crosses budget thresholds. This helps catch costly issues such as requests stuck in a loop or unexpectedly long responses. If you use a managed cloud service, combine your own monitoring with the provider’s usage reporting and quota controls where available.

    5. Choose a Model by Cost per Task

    Use this process to compare models:

    1. Measure your input-to-output token ratio. The more output your workload generates, the more weight you should give the output rate.
    2. Run a small benchmark with real samples. Test whether models from different tiers meet your quality requirements on the tasks you actually run.
    3. Calculate cost per task, not just cost per token. For a Q&A assistant, compare what it costs to answer one user question.
    4. Choose the least expensive model that meets your quality requirements. Don’t default to the most capable model if a cheaper one does the job.

    API prices change. A workload-specific cost estimate and a routing strategy are more useful over time than a snapshot of which model has the lowest price per million tokens.