LLM Inference Cost: A Practical Guide to Measuring Real Usage and Tiered Scheduling

    This article shows why a low per-token price does not guarantee a low bill, and how to reverse-engineer effective consumption rates from your own call logs when a platform uses credits instead of a published token price table. It covers a linear cost model, measured figures across four model tiers, quota runway calculations, a tiered routing strategy that separates planning from execution, and prefix-cache and context hygiene practices for keeping input costs down.

    1. Background: Why a Low Unit Price Does Not Mean a Low Bill

    When integrating LLM capabilities into a business system, the most common mistake teams make is comparing the “price per million tokens” across model tiers and concluding that they should pick the cheapest one. The real bill is determined by four variables together: the input-to-output price ratio, cache hit rate, the distribution of context lengths, and how much reasoning depth the task actually requires. Ignore any one of them and your estimate can be off by an order of magnitude.

    It gets worse: many platforms bill with a credit system or resource packages and do not expose a unified per-token price table. In that case, the only reliable path is to run a regression fit against your own real call records and back out the effective consumption rate for each tier.

    2. Method: Backing Out Effective Consumption Rates from Real Records

    The core assumption is simple: the credits consumed by a single request are a linear combination of input tokens and output tokens.

    1. cost = a * input_tokens + b * output_tokens + c

    Here a and b are the effective consumption rates to solve for, and c is a constant term (used to absorb the minimum billing unit and per-request fixed overhead). Collect 20 or more samples with different input/output distributions and run a least-squares fit.

    The order of magnitude measured in practice is below (in credits per million tokens; personal reverse-engineered values, not official pricing):

    Tier Input Output Cached input
    Flagship reasoning ~80,000 ~400,000 —
    Balanced reasoning ~32,000 ~112,000 —
    Fast execution ~4,000 ~8,000 ~80
    Lightweight batch ~2,000 ~2,000 —

    Two key findings: output cost on the flagship tier is roughly 200x that of the lightweight tier; and on the fast execution tier, once a cache hit occurs, input cost drops to just 2% of normal input cost. The fit produced R² = 1.0 with residuals near zero, indicating that credit consumption is highly linear with respect to token usage and that the model is usable for capacity planning.

    Note that these are personal measurements and reverse-engineered values; the rules may change as platform policies are adjusted, so production environments should establish a periodic regression calibration process.

    3. The Math: How Long Does a Quota Actually Last

    Assume 80% input + 20% output with no cache for now; the weighted cost is 0.8a + 0.2b:

    • Flagship reasoning: ~417,000 tokens per 5-hour quota
    • Balanced reasoning: ~1.25 million tokens
    • Fast execution: ~12.5 million tokens
    • Lightweight batch: ~30 million tokens

    For the same quota, the tiers differ by roughly 72x. This means running full-volume code completion on the flagship model is practically infeasible, while using only the lightest tier sacrifices the success rate on complex tasks. The sensible approach is tiering.

    4. Tiered Scheduling: Expensive Models Think, Cheap Models Do

    Tier Responsibility Typical scenarios
    Flagship reasoning Planning, solution breakdown, final review Requirement clarification, architecture design, code review
    Balanced reasoning Complex reasoning and hard diagnosis Root cause analysis of defects, cross-module refactoring
    Fast execution Main workhorse Routine coding, unit test generation, script writing
    Lightweight batch Bulk simple tasks Comment completion, formatting cleanup, log categorization

    Sample router implementation:

    1. def route(task):
    2. if task.needs_planning or task.needs_review:
    3. return "flagship"
    4. if task.complexity >= 0.6:
    5. return "balanced"
    6. if task.batch and task.avg_tokens < 2000:
    7. return "lite"
    8. return "fast"

    Three engineering points matter. First, persist planning artifacts in a structured form so downstream execution tiers consume only the condensed instructions, avoiding repeated passing of long contexts. Second, when an execution tier fails, escalate step by step from lightweight to fast to balanced rather than jumping straight to flagship. Third, the review stage is always handled by the flagship tier, forming a quality gate.

    5. Caching and Context Hygiene

    A cache hit can compress input cost to 2%, provided the prefix is stable. In practice, put the system prompt, tool definitions, and project conventions at the very front of the context and do not assemble them dynamically; push volatile content such as timestamps and random IDs to the end. Combined with logging services and monitoring alerts, track hit rate by prefix hash; a persistently low hit rate usually means the template has been polluted by dynamic variables.

    6. Common Pitfalls

    • Looking only at unit price and ignoring the input/output ratio: tasks with a high output share have their cost severely underestimated.
    • Ignoring the minimum billing unit: the effective unit price of short requests is far higher than the theoretical value.
    • Using peak quota for capacity planning: plan against both the weekly quota and the rate-limit threshold.
    • Switching all traffic to the lowest tier at once: the rework cost from a lower success rate is higher.

    7. Conclusion

    The essence of cost optimization is not picking the single “cheapest model,” but building a measurable cost model plus tiered scheduling with fallback plus periodic regression that can be recalibrated. First fit your own call data to obtain effective consumption rates, then allocate tiers according to the principle of separating thinking from doing; only then can you preserve both quality and throughput under a quota constraint.