LLM Tiered Pricing and Prompt Caching Cost Guide

    This guide explains how tiered LLM pricing and cached input billing work, and how engineering teams can control API costs. It breaks the bill into four variables, clarifies that cached input is pre-warmed stable context rather than a discount coupon, and shows how to route tasks between a high-capability tier and an economy tier based on difficulty and call frequency. It also covers capacity planning, observability, and a practical rollout checklist.

    1. Background: Two Tiers for the Same Model Generation

    A common pattern has emerged in the industry: the same generation of a foundation model is offered in two tiers. One tier targets complex reasoning and long-chain tasks; the other targets high-concurrency, low-latency routine work. The high-capability tier cuts input and output prices by roughly 20% compared with the previous generation, and offers about a 40% discount on cached input. The economy tier keeps the previous generation’s economy-level pricing: $2 per million input tokens, $0.10 for cached input, and $10 for output. The high-capability tier is priced at $8 for input, $0.40 for cached input, and $40 for output.

    This structure is not simply a price cut. It turns model capability into composable layers: the capability ceiling and the cost per call are decoupled, so workloads can be split by task difficulty.

    2. Cost Model: Breaking the Bill into Four Variables

    The cost of any single call can be abstracted as:

    1. Cost = Pin * Xin + Pcache * Xcache + Pout * Xout

    Here Pin is the standard input price, Pcache is the cached input price, and Pout is the output price; X is the corresponding token volume. For the high-capability tier, cached input is priced at about 5% of standard input, which means a cache hit saves close to 95%.

    In practice, teams should break cost into four observable variables: standard input volume, cache hit volume, output volume, and number of calls. Most teams watch only the output price, but in long-context scenarios the input side is the main cost driver.

    3. Understanding Cached Input Billing Correctly

    Cached input is not a discount coupon; it is pre-warmed context. It only works when the prefix is stable: unchanged parts such as system prompts, tool definitions, few-shot examples, and long document fragments are reused. If any byte-level change occurs in the prefix, the hit is invalidated and billing falls back to standard input.

    Illustrative pseudocode:

    1. def build_prompt(system, tools, history, user_input):
    2. # Stable prefix: version it and avoid casual edits
    3. prefix = stable_prefix(system, tools) # key to cache hits
    4. return prefix + history + user_input

    Key practices: version the prefix, keep volatile fields such as timestamps out of it, and place volatile content at the end.

    4. Choosing Between the Two Tiers

    A practical approach is a two-dimensional matrix of task difficulty × call frequency: route high-difficulty, low-frequency work to the high-capability tier, and low-difficulty, high-frequency work to the economy tier. A rules engine or a lightweight classifier can handle front-end routing, with a manual override switch kept available.

    1. route(task):
    2. if task.difficulty >= 0.7 or task.freq < 100/day: return "high"
    3. return "economy"

    Also establish a quality baseline: traffic served by the economy tier should be sampled for regression testing to prevent quality degradation caused by misjudged difficulty.

    5. Capacity and Performance Planning

    The high-capability tier has a higher unit price, so concurrency and queuing policies should be controlled. The economy tier has a lower unit price and is suitable for absorbing burst traffic. Set tiered quotas, timeouts, and retry budgets to avoid retries inflating the bill. For long-context requests, compress history and summarize earlier turns first to reduce standard input volume.

    6. Observability and Cost Governance

    Build a cost dashboard segmented by business line, scenario, and model tier. Metrics should include at least: cache hit rate, average input length, output length distribution, cost per request, and failed retry rate. Set budget alerts and circuit-breaker thresholds, and treat “cache hit rate drop” as a top-priority alert.

    7. Rollout Checklist

    1. Build model routing and difficulty labeling; 2. Version prefixes and pre-warm caches; 3. Build a four-variable cost dashboard with budget alerts; 4. Run sampled regression on the economy tier; 5. Set retry and timeout budgets; 6. Apply history compression. Following these steps makes the cost structure predictable and optimizable without sacrificing capability.