LLM Token Pricing Explained: Chat Usage, Prompt Caching, and Off-Peak Rates

    A per-turn usage display can show what an LLM chat costs to run without charging the user. This article explains how APIs price cached input, uncached input, and output tokens; how prompt caching and off-peak scheduling can reduce costs; and how usage reporting and rate limits help platforms manage free access.

    As large language models become more widely used, inference costs are a growing concern for developers and businesses. One platform recently began testing a per-turn usage display with a subset of its web and mobile users. After each exchange, the interface shows a token breakdown and an estimated cost based on the platform’s official API rates. The estimate is informational: consumer chat remains free during the test, and the platform has not introduced a way to purchase credits.

    The display makes several aspects of LLM pricing visible that are otherwise easy to overlook: whether input tokens were served from cache, how generated tokens are priced, and whether rates vary by time of day. Each has implications for how developers design prompts and schedule workloads.

    1. How LLM APIs Price Input and Output Tokens

    Early LLM billing models commonly distinguished between input and output tokens without accounting for whether the input had been processed before. As context windows grew and inference engines began reusing more of that work, many APIs moved toward three pricing categories:

    1. Uncached input: Tokens whose key and value representations cannot be reused from an existing cache. The model must process them during the prefill stage, running embeddings and Transformer layers to build the corresponding key-value (KV) cache. These tokens typically cost more than cached input.
    2. Cached input: Tokens in a previously processed prompt prefix whose KV state can be reused. This saves the inference engine from recomputing that state, although new tokens still need to attend to the cached context. Providers typically charge a lower rate for cached input.
    3. Output: Tokens generated autoregressively, one step at a time. The KV cache lets the model reuse the state of earlier tokens, but each decoding step still performs attention over the available context. Output rates are often comparable to or higher than uncached input rates.

    With all rates expressed per token, the calculation is:

    1. Total cost = (uncached input tokens × uncached input rate)
    2. + (cached input tokens × cached input rate)
    3. + (output tokens × output rate)

    A long conversation can still become more expensive as its history grows. The difference is that when more of the prompt is served from cache, fewer input tokens are billed at the full uncached rate.

    2. How Prompt Caching Reduces Inference Costs

    In a multi-turn chat, each request can include much of the same conversation history. Processing that history from scratch on every turn adds latency and consumes GPU capacity. With standard full self-attention, the work required to process a sequence from scratch grows quadratically with its length, making repeated prefill especially costly for long prompts.

    Inference engines store the key and value tensors for processed tokens in a KV cache. Techniques such as PagedAttention help manage the memory used by that cache. When a new request has an identical token prefix and the corresponding cache entries are still available, the engine can reuse the prefix’s KV state and process only the new portion of the prompt rather than recomputing the entire history.

    Two practices help developers make better use of caching:

    • Keep the prompt prefix stable. Put fixed system instructions and few-shot examples first. Place changing content, such as the current user question, after the stable portion so it does not break a reusable prefix.
    • Keep the context window focused. Even when a model supports very long inputs, retain only the history the task needs. A smaller working context reduces unnecessary processing and can ease cache pressure, though trimming a prompt can also alter its reusable prefix.

    3. Peak and Off-Peak Pricing

    Some platforms use time-based pricing alongside cached-input discounts. When many businesses and individuals call an API at the same time, requests compete for GPU compute, memory bandwidth, and network I/O. Heavy load can lead to queuing and longer response times. During quieter periods, the same infrastructure may have spare capacity.

    Lower off-peak rates give developers an incentive to move work that does not require an immediate response. Batch data cleaning, offline document summarization, and text corpus generation are examples of tasks that can be scheduled for discounted periods. Where time-based pricing is available, shifting these workloads can reduce API costs while helping providers make better use of their infrastructure.

    4. How Per-Turn Cost Reporting Works

    A per-turn display depends on consistent usage data from the inference engine through the API to the user interface. An API response can expose token counts in a usage object and provide an estimate based on the applicable rates. The following is an illustrative response, not a provider-specific schema or price quote:

    1. {
    2. "usage": {
    3. "prompt_tokens": 1500,
    4. "completion_tokens": 300,
    5. "prompt_cache_hit_tokens": 1200,
    6. "prompt_cache_miss_tokens": 300,
    7. "total_tokens": 1800
    8. },
    9. "estimated_cost": {
    10. "hit_input_cost": 0.0024,
    11. "miss_input_cost": 0.009,
    12. "output_cost": 0.009,
    13. "total_cost": 0.0204,
    14. "period": "peak"
    15. }
    16. }

    The interface can present the estimate returned by the API or calculate it from the usage counts and the rates for the applicable pricing period. In this example, 1,200 of the 1,500 input tokens were cache hits. Showing that split alongside the output count gives developers more useful feedback than a total token count alone: they can see whether editing a prompt reduced input length or improved cache reuse. For consumer users, the same display makes clear that a free conversation still consumes computing resources.

    5. How Usage Limits Support Free Access

    Showing an estimated cost is not the same as billing for it. During the test, the platform kept consumer chat free and did not add a credit purchase option. Usage limits are one way to preserve free access while controlling aggregate inference costs and protecting the service from high-frequency automated traffic.

    Gateways commonly enforce rate limits with algorithms such as token buckets or leaky buckets. Limits can apply at several levels:

    • Requests per minute (RPM): Caps request rates to protect inference clusters from traffic spikes.
    • Tokens per day (TPD): Caps daily token consumption per user, including usage from long conversations.
    • Per-request timeouts and token limits: Prevent an individual request from occupying inference resources for too long.

    Together, these controls help keep the service available without charging users directly. Per-turn estimates can also familiarize users with token consumption if the platform later introduces usage-based billing or subscriptions, but the display itself does not mean a paid plan is coming.

    Conclusion

    Per-turn usage reporting reflects a broader shift in LLM engineering: model capability matters, but so does the cost of serving each request. Three-part token pricing makes cache reuse visible, off-peak rates can make flexible workloads less expensive, and usage limits help platforms manage free access. For developers, the practical lesson is to account for cost when structuring prompts, managing conversation history, and deciding when non-urgent jobs should run.