New · self-tuning routing policies

Stop tokenmaxxing while loop engineering.

Context-aware LLM router that continuously improves your agent workflows

Get API keyRead the docs
$
curl -fsSL https://bitrouter.ai/install.sh | sh
then bitrouter run claude-code
dev — api — node ~/.local/bin/claude — 100×31
[dev@mbp ~ %
bitrouter/autolowmediumhighextramaxwaiting for the session·
Five tiers, set once in bitrouter.yaml — every harness only ever sees the id bitrouter/auto.
claude-code · Debugging · one model, five efforts
bring your own model
swap any model, open or frontier, per call
OpenAI · Anthropic · Qwen · DeepSeek · Mistral · Llama
bring your own contexts
MCPs & Skills — any context your agent needs
GitHub · Notion · Figma · Obsidian · Exa · Snowflake
bring your own agents
Claude Code, Cursor, Codex — or your own
Claude Code · Cursor · Codex · Cline · OpenCode · Windsurf
30% cheaper
Routes routine calls to open models and escalates only the hard ones to frontier.
30% faster
Biases every hop to the fastest model that still clears your quality bar.
30% more accurate
Escalates the judgment calls to frontier, held to the quality floor you set.

Proof, not promises.

Every number here is a real routed run against an all-frontier baseline on the same workload — not a projection.

−80%
cost / run
96%
quality held
88ms
p50 latency
run #1428 · coding agent12 calls
requestroutedcostlat
fix auth.py testqwen/qwen-3.7$0.00282ms
summarize threadqwen/qwen-3.7$0.00291ms
design migrationgpt-5.5$0.021140ms
rank retrieval hitsdeepseek-v4$0.003101ms
total $0.026p50 88mssaved −80%

Act. Observe. Evaluate. Improve.

Other routers are tuned once, offline, on somebody else's benchmark. BitRouter closes the loop against your own traffic — and every lap lands as a diff to one file you own.

policy-lock.yaml · policy_table
fingerprints: # agent-loop step → tier
opening: capable
after_read: capable
midstream: cheap
tool_safe_tiers: ["capable"] # never strand a tool call
01 Act

Route every step to the cheapest tier that clears the bar.

Each request is fingerprinted by its shape in the agent loop — opening turn, a turn after a given tool, a midstream turn with no tool call — and routed to a tier. Deterministic, no LLM in the path.

Guardrailscustom_patterns
regex block or redact on prompts and responses, in the same request path
Virtual keysbrvk_
every agent authenticates with its own scoped key — none hold an upstream credential
trace · run #1428
run #1428 31 hops $0.68 p50 96ms
opening claude-opus-4.8 $0.021 140ms
after_read claude-opus-4.8 $0.019 131ms
midstream kimi-k2.7-code $0.002 82ms
02 Observe

Every hop traced, with the cost already attached.

Ingress, routing, every upstream attempt — including multi-account failover hops — and settlement: one OpenTelemetry trace per request, cost and tokens on the span, over OTLP to a backend you already run.

policy-lock.yaml · adequacy
adequacy:
enabled: true
escalation_threshold: 2 # hard fails before pinning up
pin_cooldown_secs: 1800 # then re-try the cheap path
explore_enabled: false # opt-in: trials on live traffic
after_read 12 consecutive clean → earns cheap
midstream 2 hard failures → pinned to capable
03 Evaluate

Score whether the cheap route was actually enough.

Asymmetric on purpose: one hard failure escalates immediately, while a cheaper route must succeed repeatedly before it earns traffic. Exploration — trialling cheap on live traffic — stays off until you ask.

$ bitrouter policy evolve
fingerprints:
opening: capable
- after_read: capable
+ after_read: cheap # 12 clean trials
- midstream: cheap
+ midstream: capable # pinned · 2 hard fails
cost_per_run $0.68 → $0.41
04 Improve

The router proposes a diff. You commit it.

Under the default writeback: locked the router never publishes on its own — evolve prints the dry run, --apply writes the lock file. One versioned artifact next to your config, reviewed like any other change.

Budgets per key--kind budget
a spend window and rate limit scoped to one agent, so an unattended run can't walk away with the bill

Questions.

A unified API layer between your agent and the upstream LLM providers. Instead of hardcoding one provider, you point every call at the router and it selects the best model by cost, latency, capability and provider health — plus failover, per-run observability and guardrails, with no changes to your agent code.
OpenRouter is a closed-source hosted gateway. BitRouter is Apache 2.0 — fork the binary and run it anywhere, or use the hosted edge. The provider registry is fully open, and you get router-level guardrails, per-run cost attribution, MCP/ACP/Skills support and intent-aware routing OpenRouter does not offer.
LiteLLM is a library you embed in your application code. BitRouter is a standalone binary that runs as a sidecar or hosted edge — drop it in front of any runtime without modifying each service. It ships with auth, billing, observability and guardrails built in.
No. Point your harness at the bitrouter endpoint and it works — Claude Code, Cursor, Codex, or your own loop. Routing, tracing and policy all live in the request path.

Stop overpaying for tokens.

Point your agent at bitrouter and cut cost on the next run — quality held, nothing to rewrite.

$curl -fsSL bitrouter.ai/install.sh | sh
Get API keyClone source