Smart routing and budgets
Put every agent on a budget you set
Give a developer, a squad, or the whole org a token budget. As it fills, Edgee reroutes requests to open weight models mid-task, without quality loss and without interrupting the session. Combined with compression, up to 70% lower token costs, no code changes.
Works with Claude Code, Codex, OpenCode, Cursor... and more. Team plan required for routing strategies.
$
Agent spend grows faster than the org can govern it
Agentic workloads consume 5 to 30 times more tokens per task than chatbot workloads. At fleet scale, that is a budgeting problem before it is a technical one.
The bill doubles every six months
In the teams we work with, coding-agent spend compounds faster than headcount. Nobody signed off on the curve, and nobody can point to which team caused it.
The budget is a single number
One provider invoice for the whole engineering org. You can cap it by cutting people off, or you can let it run. There is no third option without a routing layer.
The blunt fix costs you velocity
Downgrading everyone to a cheaper model slows every task, including the ones that justified the spend. Budget control should not mean uniform degradation.
Strategies
What a Strategy looks like in practice
Here is one worked example: a squad on a $100 weekly Claude budget. Nothing below is a default. You choose the budget, the period, the thresholds, and the model at each step.
Set your own thresholds and models, on any budget period. Spend stops climbing at the ceiling you choose, and nobody files a ticket to get unblocked.
Watch budget stages in action
Self-learning routing
Smart routing that learns from your own sessions
Smart routing sends each turn to the model set for its difficulty: low, medium, high, or max. Picking those models by hand is guesswork. Self-learning routing replays your team's real coding-agent sessions every week and recommends the cheapest tier map that keeps every turn on a model fit for it.
- 1
Every turn gets a difficulty label
When a developer sends a new message to their agent, the gateway rates its difficulty (low, medium, high, or max) and the kind of work while the request runs. Only the labels are stored. No added latency.
- 2
Each week, your real sessions are replayed
Edgee replays the last 30 days of labelled sessions against many candidate tier maps, with the same rules as live routing: models switch only at user turns, and a cold cache pays to rewrite.
- 3
You get the cheapest map that holds
The run recommends the cheapest tier map that keeps every turn on a model rated for its difficulty, with the replayed saving and its 95% range. It never recommends a map that would have cost more than what you paid.
- 4
Apply it, or let it update itself
One click turns the map into a smart routing Strategy you assign like any other. Switch updates to automatic and the weekly run applies new maps only when every guardrail passes.
Each column is one turn: a prompt and everything the agent did until the next one. Models switch only when a person writes; turns the agent wrote itself (dashed) keep their model, so the cache stays warm.
Learned from your traffic, not a benchmark
Your agents, your prompts, your cache behavior, your prices. The map only uses models your Model access policies and providers allow.
Guardrails on every automatic update
A new map rolls out on its own only with medium or high confidence, a saving clearly above zero, and models that have already served enough of your traffic.
Every change can be undone
Each apply is logged on the self-learned Strategy. Undo the latest one to restore the previous map and switching settings.
Turns are labelled under zero data retention: only the labels are kept, never the message text. Labelling runs on Edgee's credentials, not your keys. Available on Team and Enterprise, for organization admins. Read the self-learning docs
Watch routing by task complexity
Routing rules
Six things a policy can react to
Budget thresholds are the primary trigger. Outage and rate-limit handling come with them.
Route on budget consumption
Thresholds are the primary trigger. As a Strategy burns through its budget, successive tiers redirect more of the traffic to cheaper models. Spend flattens without anyone being blocked.
Scope to a person, a squad, or the org
Assign a Strategy to one developer, one squad, or every seat. A platform team on a tight budget and a team shipping a launch can run different policies on the same gateway.
Pin models regardless of the request
Reroute rules let you send requests to a specific model whatever the client asked for. Use it to standardize a fleet on one provider, or to keep an expensive model off a given repo.
Fall back on 429 and 5xx
When the primary model returns a rate limit or a server error, Edgee retries through the next model in the chain. Resilience is a property of the same policy, not a separate product.
Keep working past a plan cap
Hit a weekly plan cap or a hard rate limit and Edgee detects the exhausted quota, then routes to a model that is available. Works with consumer subscriptions, not just API credits.
Reroute mid-task, without quality loss
Switching models does not mean restarting the task. Edgee carries the session across the switch, so a refactor that started on Opus can finish on an open weight model.
Claude Code request
alex-chen · implement-feature.ts
Primary: Claude Opus
Weekly limit reached — 0 tokens remaining
Fallback 1: Kimi K3
Routed · 312ms to first token
Coding continues
Transparent to the dev
Model catalog
Route to any model in the catalog
247 models across 62 provider routes, frontier and open weight. Every one of them is a valid target for a routing rule.
A few of the ones teams reach for most:
Frontier
What your agents ask for by default.
Claude Sonnet 5
1M context · 6 routes
Gemini 3.1 Pro Preview
1M context · 2 routes
Grok 4.6
500K context · 6 routes
Claude Opus 5
1M context · 7 routes
GPT-5.6 Sol
1M context · 5 routes
Claude Fable 5.1
1M context · 3 routes
Open weight
Where routing sends the request as a budget fills.
GLM 5.3 Flash
1.0M context · 8 routes
DeepSeek V4.1 Flash
1.0M context · 11 routes
MiniMax M3
1M context · 4 routes
DeepSeek V4 Pro
1.0M context · 7 routes
GLM 5.3
1.0M context · 15 routes
Kimi K3
1.0M context · 7 routes
Prices are the cheapest published input rate across our routes for each model. Bring your own keys for any provider in the catalog, or connect Bedrock, Vertex, and Azure.
Bring Your Own Cloud
Route to Bedrock, Vertex, or Azure
Same agent setup. Zero code changes. Your cloud account, your data. You paste credentials once and Edgee routes policy traffic through your own cloud provider, with the same latency and attribution as our hosted models.
- AWS Bedrock credentials keyed by region
- Google Vertex AI service account JSON
- Azure OpenAI endpoint + API key
- Credentials tested live before going active
AWS Bedrock
Multi-region credentials via access key. Edgee routes to Bedrock models in your AWS account.
Google Vertex AI
Service account JSON from Google Cloud Console. One paste, Edgee resolves OAuth2 tokens at runtime.
Azure OpenAI
Endpoint URL plus API key. Edgee derives the models endpoint from your deployment automatically.
How it works
Three steps. No config files. No proxy setup. No code changes.
- 1
Your agents call providers through Edgee
Install the Edgee CLI once. Claude Code, Codex, and the rest send requests through the Edgee Agent Gateway instead of calling the provider directly. No code changes.
- 2
You define a Strategy and assign it
A Strategy is a budget plus the routing rules that fire as it fills. Assign it to a developer, a squad, or every seat in the org from the console.
- 3
Edgee routes every request against the policy
On each request Edgee checks live consumption against the thresholds, picks the model the policy calls for, and meters the result. Rerouting happens mid-task, with no interruption to the session.
Squad budget at 78%
Past the 75% threshold in the Strategy
Edgee routes to Kimi K3
Same session, task continues
Resilience comes with the policy
Once your traffic runs through a routing policy, provider failure stops being a separate problem. A 429, a 5xx, or an exhausted plan cap moves the request to the next model in the chain, the same way a budget threshold would. Teams that adopted Edgee for cost control keep working through outages without having configured anything extra.
It also covers the billing changes. Provider credit and quota mechanics keep shifting, and a policy that already knows where to send traffic absorbs those changes without a migration.
No routing layer vs Edgee
What agent spend looks like before and after a policy.
| Agents calling providers directly | Agents behind Edgee | |
|---|---|---|
| Spend control | One invoice, after the fact | Budget per developer, per squad, or per org |
| What happens at the cap | Work stops or spend overruns | Traffic reroutes to cheaper models, nobody is blocked |
| Model switching | Manual, restart the task | Automatic, mid-task, no quality loss |
| Which model fits which task | Picked once, by guesswork | Learned weekly from a replay of your own sessions |
| Outage and rate-limit handling | Wait it out | Next model in the policy, within ~300ms |
| Model choice | One provider only | 247 models across every major provider, plus BYOK |
| Cost attribution | Per API key | Per developer, per repo, per PR, per model |
Pricing
Routing policies are included in Team
Budget-driven routing, smart routing, and self-learning routing are Team plan features.
Team plan
For engineering orgs that need spend under control before the next invoice.
per seat / month, 1 billion processed tokens included
Everything in Free, plus:
Above that, each additional billion started is billed at the seat price. Inference costs stay separate.
Choose models based on task complexity, or let self-learning routing adapt them from usage
Control team-wide usage, coding agent access, and squad organization
Manage skills, hooks, and MCP servers for your team
Export usage to your data tools
Enable or disable models for your organization
Attribution helps you track usage and costs
Set the ceiling. Keep the velocity.
About 5 minutes to install. Works with your existing agent setup. No credit card.
Questions engineering leaders ask
Part of the Edgee Agent Gateway
Routing is the first of three pillars.
Edgee also compresses what is left to send, and observes every session at team level, attributing cost per developer, per repo, and per PR. Combined, up to 70% lower token costs.