Description: "A practical engineering guide to controlling expensive output tokens, avoiding hidden reasoning token burn, and building reliable two-tier model routing in production."
In Part 1 and Part 2, we focused on reducing input token overhead through prompt caching and batch processing.
Once input caching is working, teams usually run into a second surprise on their invoice: output tokens and reasoning tokens. Across most LLM APIs, output tokens cost 3x to 5x more than input tokens—and if you enable reasoning or high max_tokens limits on routine tasks, a single verbose model can quietly eat most of your budget even when your prompt cache hit rate is high.
This guide covers how to cut output token waste and route traffic between fast/cheap models and frontier models safely.
1. Why Output Tokens Hurt More Than Input Tokens
Two dynamics make output tokens uniquely expensive in production:
- Asymmetric pricing: Input tokens are cheaper to process in parallel; output tokens are generated sequentially autoregressively, so providers price them at a steep multiple.
- Unbounded verbosity: A prompt might have a predictable 1,200-token input, while the response varies from 80 tokens to 1,400 tokens depending on how chatty the model feels or how many edge cases it explains.
A Concrete Monthly Example
Suppose you run an API feature handling 150,000 requests/month:
- Average input: 2,000 tokens (with 75% cache hits on your system/context block)
- Average output: 500 tokens (75,000,000 output tokens/month)
If every request goes to a high-tier model at $5.00 / 1M input and $25.00 / 1M output:
- Output tokens alone cost $1,875/month ($25 × 75M).
- Even if you cut input costs in half, output generation still dominates the bill.
Meanwhile, if 75% of those requests are simple tasks (intent classification, entity extraction, short formatting, or straightforward lookups) handled by a low-cost model at $0.25 / 1M input and $1.50 / 1M output, and only 25% go to the frontier model:
- Economy tier (112.5k calls × 500 output tokens = 56.25M output tokens): ~$84.38 in output tokens
- Frontier tier (37.5k calls × 500 output tokens = 18.75M output tokens): ~$468.75 in output tokens
- Total output spend drops from $1,875 to ~$553 (before factoring in input savings).
You can plug your own request volume, token counts, and model rates into the PromptBill Cost Calculator and compare provider rates side by side on PromptBill Models.
2. Five Practical Ways to Cut Output Tokens Without Hurting Accuracy
Before switching models, tighten what the model is allowed to emit.
1. Ban Conversational Filler via Strict Schemas
Without constraints, models routinely add 30–80 tokens of polite framing ("Here is the JSON you requested based on the text provided..."). Define a strict JSON schema or response contract and instruct the model to return only valid data matching that schema.
2. Return IDs or Indices Instead of Echoing Source Text
If your pipeline extracts entities, filters documents, or ranks passages that already exist in your input context, do not ask the model to copy paragraphs back verbatim. Have it return chunk_id values, start/end character offsets, or short normalized values, and look up the full text in your backend.
3. Right-Size max_tokens Per Endpoint
Leaving max_tokens huge or unset allows runaway loops or rambling explanations on simple endpoints. Set tight upper bounds per task type:
- Classification / routing:
64–150tokens - Structured extraction:
250–600tokens - Concise user-facing answer:
300–800tokens
4. Match Reasoning Effort to Task Difficulty
If your provider supports configurable reasoning/thinking budgets, keep reasoning low or off for deterministic extraction, tagging, and simple Q&A. Save deep reasoning for multi-step debugging, planning, or complex synthesis where it actually improves accuracy.
5. Pre-Filter Before Calling the LLM
Deterministic checks—regexes, allowlists, cached exact/semantic lookups, or basic validation—can resolve a surprising share of traffic at $0 token cost before an LLM is ever invoked.
3. Reliable Hybrid Routing Patterns
Routing only saves money if it doesn't silently degrade user experience. Here is pattern that work well in practice.
Rule-Based Pre-Routing (Fastest & Cheapest)
Use known metadata—task type, input size, user tier, or complexity flags—to pick the model before making an API call:
typescript
export type ModelTier = "economy" | "frontier";
export interface RoutingContext {
task: "classify" | "extract" | "summarize" | "analyze" | "code_gen";
estimatedInputTokens: number;
highStakes: boolean;
}
export function chooseModelTier(ctx: RoutingContext): ModelTier {
// Always use frontier for high-stakes decisions, complex code, or very large contexts
if (ctx.highStakes || ctx.task === "code_gen" || ctx.estimatedInputTokens > 24_000) {
return "frontier";
}
// Routine classification, extraction, and short summaries fit the economy tier
if (ctx.task === "classify" || ctx.task === "extract" || ctx.task === "summarize") {
return "economy";
}
return "frontier";
}
Top comments (1)
part 4 next!