Light Tasks, Small Models: Building a Model Router for a Thin API Bill
Every request rides the priciest model? Build a tiered router: light tasks go to small models and your API bill drops up to 90%.

The most common way to inflate an API bill is also the simplest: every request goes to the same model — the biggest and most expensive one. Tagging an inbox email as "sales" or "complaint", pulling dates out of contracts, reformatting product descriptions — all handled by a frontier model, like driving a container truck to buy groceries. Yet most daily tasks were mastered by small models long ago, at five to twenty-five times lower prices.
This tutorial assembles the single design decision that typically cuts 60-90% of costs on mixed workloads: a tiered model router. Light tasks go to mini models, medium ones to the mid-tier, and the expensive model wakes up only when the job justifies its price. The whole system can be built in one afternoon with no extra libraries.
1. Compute the Cost per Task, Not Just per Bill
Every decision in this article rests on one formula:
cost = (input_tokens / 1,000,000 × input_price) + (output_tokens / 1,000,000 × output_price)
As a snapshot of public prices at the time of writing (per million tokens; prices move fast, always check official pages): the frontier class, such as GPT-5, runs about $1.25 for input and $10 for output; the mini class, such as GPT-5 mini, about $0.25 and $2; the nano class, such as GPT-5 nano, about $0.05 and $0.40. In the Claude family, Sonnet sits around $3/$15 while Haiku is around $1/$5.
A concrete example: your monthly workflow — an internal FAQ chatbot, email classification, daily activity summaries — consumes 5 million input tokens and 500 thousand output tokens.
- Frontier class: (5 × $1.25) + (0.5 × $10) = $11.25
- Mini class: (5 × $0.25) + (0.5 × $2) = $2.25
- Nano class: (5 × $0.05) + (0.5 × $0.40) = $0.45
Those figures look small until you scale them: at 50 million input tokens per month, the spread becomes $112.50 versus $22.50 versus $4.50. Choosing a model tier is not a technical detail — it is the line between a bill you feel and one you barely notice.
2. Sort Every Task into Three Tiers
Before installing the router, map your workloads. Three tiers are enough.
Tier 1 — mini/nano models. Classification and labeling (ticket category, sentiment, spam), structured data extraction (invoice numbers, dates, names from CVs), text reformatting, short summaries, language detection. Hallmarks: short answers, clear rules, and one or two wrong cases are still tolerable.
Tier 2 — mid-tier models. Writing content and email drafts, summarizing long documents, simple table analysis, fixing small pieces of code. These need stylistic coherence and deeper contextual understanding.
Tier 3 — frontier models. Multi-step reasoning, strategy planning, architecture design, decisions whose failures are expensive. The tier you need least often — and pay most for.
The golden rule is one sentence: every new task starts at the lowest tier, and moves up only on evidence of failure — never on the assumption of "playing it safe".
3. Install the Router: Simple Rules First, a Small Model for the Rest
The router does not need to be clever. Its first layer is even free: explicit rules. Short requests containing words like "categorize", "extract", or "reformat" go straight to tier 1; requests that attach a full document go to tier 2; words like "strategy", "compare options", or "design" go to tier 3.
The rest — the gray majority — goes to the second layer: a nano model that classifies each request before it is executed. The prompt can be this simple:
You are a task router. Your ONLY job is to classify, not to execute.
Categories:
- LIGHT: classification, labeling, structured extraction, reformatting, summaries < 200 words
- MEDIUM: writing drafts, summarizing long documents, table analysis, small code fixes
- HEAVY: multi-step reasoning, strategy, high-stakes decisions, system design
Reply with valid JSON only:
{"tier": "LIGHT|MEDIUM|HEAVY", "reason": "max 12 words"}
User request:
{{input}}
This router costs nearly nothing: a few hundred tokens per decision at nano prices, and the router itself runs on the cheapest tier. Map the results onto models: LIGHT to nano, MEDIUM to mini or the mid-tier, HEAVY to frontier. Then add a fallback rule — if a tier-1 model returns invalid output twice in a row, escalate one tier automatically.
4. Prove the Downgrade with a 20-Case Test Set
The biggest cost leak happens not when choosing a model but when being afraid to choose: "quality might drop", without ever testing it. The cure is cheap — build a test set.
Take 20 real cases from your production history for one task, say email classification, each with an ideal answer. Run them all through the small model, then grade the results with a judge prompt:
Compare OUTPUT_MODEL with IDEAL_ANSWER for the same task.
- Score 1 if the meaning is equivalent: wording may differ, all required fields correct and complete
- Score 0 if any field is wrong, missing, or outside the required format
Reply with JSON only: {"score": 0 or 1, "note": "max 15 words"}
IDEAL_ANSWER: {{ideal}}
OUTPUT_MODEL: {{output}}
The threshold is strict: above 90% means the task stays on the lower tier permanently. Below that, do not move the whole task up — move up only the failing category. Nine times out of ten, the failure is a single specific sub-case that one extra instruction sentence can patch, far cheaper than swapping models.
5. Log Cost per Task in a Simple Sheet
Without measurement, the router slowly leaks: new requests get added without thinking about tiers, new models ship and old prices never get revisited. The cure is a six-column spreadsheet: date, workflow, model, input tokens, output tokens, cost — the formula from section 1 — plus one verdict column: OK or escalated.
In each weekly review, answer two questions. First, which workflows are still running on a higher tier than they need? Second, which escalations happen most often — and is the cause a fixable instruction rather than an insufficient model?
Then put guardrails on the provider side: enable monthly budget limits and their alerts on the dashboard, and keep a separate API key per project. When the bill spikes, you know exactly which project leaked without digging through application logs.
6. Revisit Quarterly: Prices Fall, So Should Your Router
The model market moves downward: mid-tier capability from a year ago is often held by the mini class at a quarter of the price. A router that fits this year can be wasteful next year. So every quarter, rerun the 20-case test set on newer, cheaper models; if quality holds, migrate.
Two complements are worth checking once: the Batch API for non-urgent jobs (usually around 50% off) and prompt caching for repeated instructions. Both are separate levers from routing — install them after tiers are settled, not instead of them. And know when to stop: if dropping one tier sends the test score far below your threshold, leave the task where it is. Savings that hollow out quality are not savings; they just postpone the bill into a more expensive form.
A model router is the most satisfying kind of system to build: an hour or two of work, then it quietly trims the bill every day without maintenance. Start this week with one step: find your most token-hungry workflow, test it on a small model, and see for yourself whether the most expensive model was ever needed there.
References
- OpenAI API Pricing — official per-million-token prices for OpenAI model families
- Anthropic Pricing — API prices for Claude Haiku, Sonnet, and Opus
- Google AI Gemini Pricing — prices for the Flash-Lite, Flash, and Pro tiers
- OpenAI Batch API — documentation for the discounted async processing tier



