Introduction

Agent-native LLM router that makes every model call reliable, traceable, secure, and cost-effective — with zero harness changes.

What is BitRouter?

BitRouter is an agent-native LLM router that optimizes your agent with every run. It's a single local binary that gives any agent one endpoint to discover, route to, and pay for LLMs and tools across providers — with zero harness changes. Point your runtime at it and every model call becomes reliable, traceable, secure, and cost-effective.

It runs anywhere your agent runs, with no dependencies to install, and is operated as a permissionless network where any provider can register and any agent can connect. Open-sourced under Apache 2.0; Cloud is opt-in.

Why agents run on BitRouter

Four mechanisms, built into the router — not bolted on per agent.

Reliability — one provider fails, your agent run doesn't

BitRouter reroutes across providers mid-run, transparently — your agent never sees the failed call. Automatic retries with exponential backoff, model and provider fallbacks, connection reuse, and request-level idempotency keep long agent loops alive through outages and 429s. Failed requests aren't billed. See Model Fallback and Provider Selection.

Observability — trace every hop, not just every request

Full call-chain visibility: every agent, every model, every step, with cost attributed per run rather than per month. A real-time CLI + TUI monitors sessions, requests, latency, and spend, and structured logs feed downstream pipelines. See Observability.

Security — guardrails for every agent, configured once

Prompt-injection detection, PII and output filtering, and rate limits — enforced at the router, once, for every agent, with no application-level changes. Combined with per-agent KYA identity, an autonomous agent holding your keys stops being an unsupervised attack surface. See Guardrails.

Efficiency — not every call needs your strongest model

Most calls in a run are trivial — a lookup, a format, a yes/no. BitRouter matches each call to the right model by task complexity with price-aware routing, so you stop billing simple calls at frontier prices. The savings compound across every run.

The foundation

  • Universal LLM API — One binary, three protocol surfaces: OpenAI Chat Completions + Responses, Anthropic Messages, and Google Generative AI. Talk to any LLM through your preferred protocol, and route cross-protocol (OpenAI ↔ Anthropic).
  • Free BYOK — Bring your own provider keys at zero cost. BitRouter auto-detects keys from environment variables — no config file required.
  • MCP & ACP gateway — Proxy MCP servers so agents can discover and call tools across hosts. ACP support for agent identity, discovery, and task dispatch.
  • Agentic auth & payment — KYA (Know-Your-Agent) identity and x402/MPP pay-per-use on the hosted service. Agents authenticate and pay autonomously — no credit cards, no prepaid credits, no invoices.
  • Open ecosystem — Permissionless provider registration. Any provider exposing an OpenAI- or Anthropic-compatible endpoint can join the network and be discovered by agents on it.

How BitRouter compares

BitRouter, LiteLLM, and OpenRouter all route LLM traffic, but BitRouter is the only one that is open-source and self-hostable, agent-native, and built on a permissionless provider marketplace — with automatic mid-run failover and sub-10ms routing overhead. See the full Comparison against OpenRouter, LiteLLM, and other API gateways.

Why we're building this

Today's LLM agents lose hours of work to a single provider outage, rewrite integration code every time they swap models, ship risky outputs with no consistent way to redact or block them, and operate in the dark because each provider only shows its own slice. BitRouter survives outages with automatic fallback, lets agents swap models without code changes, redacts or blocks risky content at the proxy, and shows every call, cost, and error in one feed. The longer goal is an open, permissionless intelligence layer where agents discover, route to, and pay for their own resources — owned by the agents and operators using it, not a gateway company in the middle.

Agent Runtimes

BitRouter is a drop-in proxy for any runtime that supports a custom OpenAI or Anthropic base URL — point it at http://localhost:8787 and you're done.

Setup recipes for OpenClaw, Hermes Agent, Claude Code, and more live in the Cookbook.

AI Resources

Material to feed into your agent or LLM context:

  • llms.txt — Curated BitRouter documentation index in the llms.txt format.
  • llms-full.txt — Complete documentation as plain text for full-context ingestion.
  • Agent Skills — Drop-in skills that teach an agent (Claude Code, Cursor, Copilot, Codex, etc.) how to install and use BitRouter. Install with npx skills add BitRouterAI/agent-skills.
  • BitRouter CLIcargo install bitrouter to install. Runs the proxy, an interactive setup wizard, and the TUI dashboard.
  • Comparison — How BitRouter differs from OpenRouter, LiteLLM, and other API gateways.

How is this guide?

Last updated on

On this page