← all posts
// cost · cost

Routing your agent's spend down with OpenRouter

One API key for every model is the convenience pitch for OpenRouter. The cost pitch is separate, and it's the one that actually moved my monthly bill.

Cascade instead of picking one model

Most agent tasks don't need your most expensive model on the first try. I run a models array with three tiers, a cheap fast model first, a mid-tier model second, Fable 5 last, and let OpenRouter's fallback walk down it only when a call actually fails or hits a moderation flag.

That's not quality-based routing. OpenRouter won't retry a low-tier model's bad-but-valid answer up to a better one for you; it only escalates on errors, never on a weak answer. For actual quality-based escalation you still need your own judge step, the same pattern from orchestrating ChatGPT and Gemini from Claude Fable 5: a cheap model drafts, something checks, only disagreement escalates to the expensive model.

Floor pricing for the jobs nobody's watching

  • Batch classification, embeddings generation, overnight test-suite triage, anything where a human isn't staring at a spinner, gets the :floor suffix and takes whichever provider is cheapest that hour
  • Interactive coding sessions get :nitro instead, because a developer waiting eight seconds for autocomplete will just stop using the tool
  • I never mix the two on the same model string, pick one priority per call site and be honest about which one this call site actually needs

Rate limits pool across providers

If three different providers all serve the same open-weight model, your effective rate limit is roughly the sum of what each provider allows, not the single tightest one. That mattered more than the price difference the one time a provider throttled us mid-demo and OpenRouter just moved the next request to a different provider without us noticing until we checked the logs afterward.

Cascading tiers saves money on volume. It does nothing for the one request that actually needed your best model, know which is which before you build the cascade.

What routing quietly breaks

The real limitation: prompt caching is vendor-specific, and OpenRouter's automatic provider switching can silently defeat it. If your agent sends the same long system prompt on every turn expecting a cache hit, and OpenRouter routes turn three to a different provider than turn two, you pay full price for a prompt that should have been cached, the exact problem the architecture that cuts 99% of your LLM bill is built to avoid.

Pin the provider with a fixed provider order and fallbacks disabled for any workflow that depends on caching, and only let routing float free on stateless, one-shot calls. Check your pricing dashboard after the first week either way, the theoretical savings and the actual bill don't always agree.

#cost#openrouter#savings