Cost Optimization for LLM Architectures: Pricing, Routing, and Procurement Strategies After Price Changes

    Rising LLM costs are often caused by pricing rule changes rather than increased traffic. This article explains how to calculate cache-hit billing accurately, design a two-tier model routing architecture with lightweight and flagship models, and evaluate subscription plans against pay-as-you-go options for long-term cost efficiency.

    When the cost of large language models (LLMs) rises, the cause is often not a change in business volume but a repricing of the same request structure under new billing rules. Before adjusting model division of labor or procurement strategies, teams must first clarify the financial impact.

    1. Understanding Cache-Hit Billing

    Most cloud providers apply tiered pricing to input tokens. Tokens that hit the cache—referred to as cache-hit input tokens—are priced lower than regular input tokens. Output tokens typically carry the highest unit price. When system prompts, code repository context, or long documents are consistently placed in the request prefix, they repeatedly hit the cache, thereby enjoying discounted pricing.

    This discount depends on prefix stability. If a provider raises the unit price for cache-hit tokens, the cost of the cached portion rises even under an identical request structure. When calculating the impact, two metrics should be tracked separately:

    • Token volume has not changed; what changed is the monetary amount.
    • If the platform converts quotas based on monetary value, the number of tokens purchasable under the same budget decreases.

    These two are often conflated and should be computed independently.

    Monthly cost can be estimated using the following formula:

    1. Monthly Cost = (Regular Input Tokens × Regular Input Unit Price)
    2. + (Cache-Hit Tokens × Cache-Hit Unit Price)
    3. + (Output Tokens × Output Unit Price)

    All unit prices should use the same currency and billing period, based on the provider’s current price sheet. The cache-hit rate is the most influential variable and can be derived from billing logs or application telemetry.

    Illustrative example: Suppose a provider originally prices cache-hit tokens at 10% of the regular input price. Assume 80% of input tokens hit the cache and 20% are regular input. After a price adjustment, the cache-hit unit price is raised by 5×, becoming 50% of the regular input price. Using the formula above, total input-side cost rises from 0.28 units to 0.60 units—roughly 2.1× the original. If the budget is fixed, the usable input token volume drops to roughly half. This example only illustrates the calculation method; the actual multiplier depends on specific prices and hit rates.

    2. Reducing Total Cost with a Two-Tier Routing Strategy

    Complex tasks often include a significant portion of low-intellectual-density work—such as retrieval matching, syntax validation, format conversion, and preliminary code exploration. These operations are invoked frequently and deliver low per-call value. Assigning all of them to a flagship model drives costs disproportionately high.

    A more efficient approach is to split the architecture into two tiers:

    • Sub-agents execute low-density tasks using lightweight models that offer fast response times and low unit prices.
    • A main orchestrator agent aggregates results from sub-agents, performs core reasoning, architectural design, and produces the final output using a stronger flagship model.

    Lightweight models handle the exploration; the flagship model handles the final synthesis.

    Within a subscription plan’s quota, lightweight models have near-zero marginal cost. However, subscriptions typically impose quota caps, rate limits, and overage pricing. Once these thresholds are exceeded, costs rise again—so continuous monitoring is required.

    Routing rules must be explicitly defined and validated. The following checklist serves as a starting point:

    • Task type: List application tasks, e.g., retrieval, validation, code generation, architecture review.
    • Default model: Assign a default model to each task type.
    • Quality threshold: Define acceptable output criteria, e.g., passes compilation, passes unit tests, or passes format validation.
    • Failure fallback: When lightweight model output falls below the threshold, automatically escalate to the flagship model and log the escalation reason.
    • Cost and latency metrics: Track token consumption, cost, and response time per task type.
    • Sampling evaluation frequency: Periodically run manual or scripted reviews to confirm output quality has not degraded.

    After setting quality thresholds and validating them through A/B testing and manual sampling, certain scenarios may see significant cost reductions. The exact reduction depends on routing ratios, cache-hit rates, and the weighted unit prices of each model—no fixed multiplier applies universally. If the escalation rate remains persistently high, the routing rules are poorly designed. The solution is to adjust task boundaries or thresholds rather than simply increasing the budget.

    3. Procurement Models: When Do Subscription Plans Make Sense?

    Pay-as-you-go pricing scales with traffic but makes budget forecasting difficult. Subscription plans or prepaid resource packs fix unit costs and facilitate capacity planning. However, subscriptions are only economical when actual usage consistently covers the quota and does not exceed rate limits or model specification constraints.

    When evaluating a subscription, check the following dimensions item by item:

    • Quota calculation basis: Is the quota measured in token counts or monetary value? Are cache-hit tokens counted toward the quota, and at what coefficient?
    • Model specification ratio: Does the quota ratio of general models to lightweight models match your routing ratio? A mismatch may leave lightweight quota idle while flagship quota is exhausted first.
    • Overage rules: What is the unit price after exceeding the quota? Is automatic billing triggered?
    • Rate limits: What are the per-minute request and token caps? Rate limiting during peak hours can cause task failures or retries, increasing actual consumption.
    • Compliance documentation: Is invoicing available? Do contract terms define service levels and breach liability?
    • Audit capability: Does the provider offer billing export, call logs, and access management for internal reconciliation and tracing?

    For enterprise users, a provider’s compliance capabilities have long-term cost implications. An API that cannot issue proper invoices, lacks account management, or does not support billing export is difficult to integrate into formal financial and audit workflows, regardless of its unit price. Platforms with enterprise-grade credentials typically also provide supporting infrastructure—object storage, logging services, and container platforms—reducing the team’s operational overhead. These benefits should be weighed against actual engineering time and risk, not reduced to unit price comparisons alone.

    4. Common Questions and an Action Checklist

    What to do when LLM cache-hit prices rise?

    First, calculate current monthly impact using the formula, based on actual cache-hit token counts and unit prices. Then verify whether system prompts and context prefixes remain stable. Frequently changing prefixes degrade cache-hit rates. Fix the static portions of prompts and place variable content at the end of the request.

    How to select models for multi-model coordination?

    Break down work by task type first, then assign a default model to each type, defining quality thresholds and fallback rules. Do not compare unit prices in isolation—evaluate pass rates, latency, and cost for the specific task at hand.

    How to evaluate a subscription plan?

    Collect actual usage over the past several months, segmented by model type. A subscription is economical only when actual usage consistently covers the quota and overage/rate-limit risks are manageable. Otherwise, pay-as-you-go or a hybrid approach is likely more prudent.

    Action Items

    1. Track cost separately in monetary amount and token volume; compute the current monthly spend using the formula.
    2. Fix system prompts and context prefixes to improve cache-hit rates; monitor hit-rate changes continuously.
    3. Split routing by task type; define quality thresholds and failure fallback rules for each.
    4. Use A/B testing and sampling evaluations to confirm cost reductions do not compromise output quality.
    5. When comparing plans, verify quota calculation basis, overage pricing, rate limits, invoicing, and audit capabilities before making a procurement decision.