bitrouter

Agent

VAULTED

bitrouter

Creator:

About this agent

Agent-native LLM router that optimizes your agent with every run. Zero harness changes — every model call reliable, traceable, secure, and cost-effective.

BitRouter

Build status
Crates.io
License: Apache-2.0
Twitter
Discord
Docs

Agent-native LLM router that optimizes your agent with every run. Zero harness changes — every model call reliable, traceable, secure, and cost-effective.

Install

BASH
# macOS / Linux  
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/bitrouter/bitrouter/releases/latest/download/bitrouter-installer.sh | sh

# Homebrew  
brew install bitrouter/tap/bitrouter

# npm  
npm install -g bitrouter  
<details> <summary>From source (Cargo)</summary>
BASH
cargo install bitrouter  
</details>

Quick Start

Local (BYOK)

Set your provider API keys and start:

BASH
export OPENAI_API_KEY=sk-...    # ANTHROPIC_API_KEY / GOOGLE_API_KEY also work  
bitrouter start  
# Proxy running at http://localhost:4356  

BitRouter auto-detects any key set in the environment — no config file needed. Point your agent runtime at http://localhost:4356 and any provider whose key is present is immediately available.

For advanced routing rules, guardrails, or multi-account failover, scaffold a config file:

BASH
bitrouter init          # writes ./bitrouter.yaml (override with `-c <path>`)  
bitrouter start  

Cloud

Sign in to your BitRouter Cloud account from the terminal — one OAuth account covers every model the gateway offers, no upstream provider keys required:

BASH
bitrouter auth login    # RFC 8628 device flow against api.bitrouter.ai  
bitrouter start         # `bitrouter` provider auto-enables once signed in  

Manage keys, usage, billing, policies, and BYOK from the same CLI — see bitrouter cloud --help or CLI.md.

Features

  • Multi-provider routing — unified access to OpenAI, Anthropic, Google, OpenRouter, OpenCode Zen / Go, BitRouter Cloud, GitHub Copilot, ChatGPT Codex, and Amazon Bedrock; configure multiple accounts per provider with failover or round-robin load-balancing (sdk · providers)
  • Cross-protocol routing — any client protocol (Chat Completions, Responses, Messages, Generate Content) against any upstream; BitRouter translates transparently (sdk)
  • Zero-config — auto-detects providers from environment variables; no config file needed to get started (providers)
  • MCP gateway — proxy for MCP servers; agents discover and call tools across hosts (sdk)
  • ACP integration — manage coding agent sessions (Claude Code, OpenAI Codex, Gemini CLI) via the CLI (sdk)
  • Agent guardrails — inspect, redact, or block risky content at the proxy layer (guardrails)
  • Observability — per-request spend tracking, Prometheus metrics, and OTLP export (observe)
  • Virtual keys — mint scoped brvk_ API keys with bitrouter key sign, persisted to SQLite, PostgreSQL, or MySQL
  • Custom providers — add any OpenAI-compatible or Anthropic-compatible upstream via config

Supported Providers

ProviderStatusNotes
OpenAIChat Completions + Responses API
AnthropicMessages API + Claude Pro/Max subscription (PKCE)
GoogleGenerative AI API
Amazon BedrockVia AWS SDK (opt-in)
OpenRouterChat Completions + Responses API
OpenCode ZenCurated models across Chat Completions, Messages, and Generate Content protocols
OpenCode GoLow-cost subscription for open coding models
BitRouter CloudOAuth sign-in (bitrouter auth login); cloud-managed routing
GitHub CopilotGitHub OAuth device flow (bitrouter login github-copilot)
ChatGPT CodexChatGPT subscription PKCE (bitrouter login openai-codex)

Want to see another provider? Open an issue or submit a PR. If you're a provider interested in first-party integration, reach out on Discord.

Any agent runtime that supports a custom OpenAI or Anthropic base URL works with BitRouter out of the box — point it at http://localhost:4356. Building an agent runtime? We partner with teams on native integrations — email contact@bitrouter.ai or book a meeting with the founder.

Comparison

BitRouterOpenRouterLiteLLM
ArchitectureLocal-first proxy + optional cloudCloud-only SaaSLocal proxy (Python)
LanguageRustClosed-sourcePython
Self-hostedYesNoYes
Agent-nativeYes — built for autonomous agent runtimesNo — human-facing gatewayPartial — SDK-oriented
Agent protocolsMCP + ACPNoMCP
Agent guardrailsBuilt-in (inspect, redact, block)YesYes
Cross-protocol routingYes (e.g. OpenAI format → Anthropic upstream)Provider-specificYes (unified interface)
ObservabilityCLI + per-request cost tracking + PrometheusWeb dashboardLogging + callbacks + WebUI
ExtensibilityTrait-based SDK — import and compose cratesAPI onlyPython middleware
Performance~10ms~30ms (cloud)~500ms
LicenseApache 2.0ProprietaryApache 2.0

TL;DR — OpenRouter is a cloud API marketplace for humans picking models. LiteLLM is a Python proxy for unifying provider SDKs. BitRouter is a Rust-native proxy purpose-built for autonomous agents — with cross-protocol routing, MCP and ACP support, and guardrails out of the box.

CLI

BASH
bitrouter start / stop / restart / reload      # daemon lifecycle  
bitrouter status                               # pid, listen address, active models  
bitrouter route <model>                        # trace how a model name resolves  
bitrouter models [--provider <id>]            # list routable models  
bitrouter providers list                       # list configured providers  
bitrouter tools list / status / discover       # MCP server introspection  
bitrouter agents list / check / install        # ACP agent management  
bitrouter key sign --user <id>                 # mint a scoped brvk_ API key  
bitrouter policy create <id>                   # scaffold a routing policy  
bitrouter init                                 # scaffold bitrouter.yaml  
bitrouter login <provider>                     # upstream-provider OAuth (anthropic, openai-codex, github-copilot, …)  
bitrouter auth login / logout / whoami         # BitRouter Cloud sign-in (RFC 8628 device flow)  
bitrouter cloud keys / usage / billing / …     # manage keys, usage, billing, policies, BYOK against BitRouter Cloud  

See CLI.md for flags, config resolution, and examples.

Documentation

  • CLI.md — full CLI reference with flags and examples
  • DEVELOPMENT.md — workspace architecture and SDK internals
  • CONTRIBUTING.md — contribution workflow, issue reporting, and provider updates
  • CLAUDE.md — guidance for AI coding agents working in this repository

Roadmap

  • Core routing engine and provider abstractions
  • OpenAI, Anthropic, Google, and Amazon Bedrock adapters
  • Zero-config auto-detection from environment variables
  • Custom provider support (OpenAI-compatible / Anthropic-compatible)
  • Cross-protocol routing (e.g. OpenAI format → Anthropic provider)
  • MCP gateway and ACP agent integration
  • Multiple accounts per provider — failover + load-balancing
  • Virtual key management (bitrouter key) backed by SQLite / PostgreSQL / MySQL
  • Telemetry and usage analytics
  • Provider & model routing policy customization

Star History

Star History Chart

License

Licensed under the Apache License 2.0.

Source: https://github.com/bitrouter/bitrouter

Comments & Discussion

Scroll to load comments...

Tags

ai-agent
ai-agents
rust
agent-guardrails
agent-harness
agent-observability
llm-gateway
openclaw
mcp
claude-code
openai-compatible
api-gateway
llm-router
bittensor
opencode
skills
acp
anthropic-compatible
hermes-agent
litellm

Share

Related Links
Tokenization

This item is not available for tokenization.

Loading recommendations...

Yuki

Your Marketplace Companion

Agent

Hey, I'm Yuki 👋

Ask me about specific products, customer support, or anything about the Swarms Marketplace.