Per-token API prices are falling, but engineering bills for autonomous coding agents keep climbing because the dominating metric is now cost per successful task, not price per million tokens. A lightweight routing layer can intercept routine decisions before they reach an expensive reasoning model, preventing unnecessary deep-reasoning spend. The article tests TypeSafe’s Jev classifier in front of Google Antigravity’s model calls, using a single atomic Noul question to route tasks. On a 50-question coding-agent benchmark, the Jev router achieved 100% accuracy on 34 unseen held-out tasks and 96% overall, while a frozen regex and prompt-length heuristic dropped to 70.6% on unseen tasks. The most cost-effective approach is to start with a fast model on a light thinking setting, then add a near-free classifier to send only hard tasks to a stronger model.
Context
Per-token API prices are falling, but engineering bills for autonomous coding agents keep climbing. The dominating metric is now cost per successful task: total spend across every loop iteration, tool call, retry, and internal thinking pass divided by the number of tasks that pass verification. Using a high-thinking reasoning configuration for every micro-decision incurs unnecessary cost.
Approach / What changed
Add a lightweight routing layer (e.g., TypeSafe’s Jev classifier) in front of model calls. The classifier evaluates a single atomic Noul question per factor—such as whether a task requires more than one sequential calculation—and routes simple tasks to a cheaper model (Flash-Lite) and hard tasks to a stronger model (Flash on low thinking).
Takeaways
1
A frozen regex and prompt-length heuristic dropped from 93.8% to 70.6% on unseen coding-agent tasks, while Jev classified all 34 unseen tasks with 100% agreement.
2
Lowering maxOutputTokens does not reduce thinking tokens on easy tasks; it only truncates hard tasks, breaking 7 of 25 in the test.
3
The strongest setup without a router was Gemini 3.8 Flash on low thinking, solving all 50 tasks; the Jev router matched that accuracy while reducing cost and response time.
FAQ
Does lowering maxOutputTokens save money on easy tasks?
No. Capping maxOutputTokens does not reduce thinking tokens on easy tasks; the cap is only a ceiling that easy answers never approach. In tests, a capped model spent almost identical thinking tokens on simple tasks as an uncapped one, and the cap broke 7 of 25 hard tasks by truncating reasoning or forcing wrong answers.
How should I structure a routing question for Jev?
Use a single atomic Noul question per factor, such as whether the task requires more than one sequential calculation, simulation step, or logical deduction. A broad Choice question (simple vs. complex) tends to route nearly everything to simple, even tasks needing multi-step reasoning.
How does caching interact with a routing classifier?
Routing and caching pull in opposite directions because a cache belongs to one model. If your agent switches between models from turn to turn, it either keeps two caches or loses the 75%–90% discount. The practical split is to route short, self-contained tasks and keep long, context-heavy turns on a single model.
Classification is a gate, not a label: a fast model scores each incoming signal, and only the ambiguous cases escalate to expensive reasoning. This map shows the layers, the decision boundary, and the feedback loop.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.