For AI agents, the documentation index lists all pages. Append .md to a documentation URL for Markdown, or request text/markdown.

Skip to Content

Quickstart

Install BitRouter and get your agent routing in under a minute — pick self-host or Cloud, then onboard via the Agent Skill, the CLI wizard, or manual env keys.

8 min readEdit this page

This page gets BitRouter routing for your agent in under a minute. There are two deployment modes, and three ways to onboard either one — the Agent Skill, the CLI wizard, or manual env keys.

  • BitRouter Cloud (default). Hosted endpoint at api.bitrouter.ai. Cloud Auto Routing with your own provider keys and Elastic Inference share $0.01 per million processed input + output tokens at early access pricing. Each request is counted once. Provider or supplier inference charges are separate.
  • Local proxy. A single binary on your machine, BYOK with your own provider keys. Basic routing requires no external service.

For a hosted API integration, start with Cloud authentication and your first request.

Both modes use the same open-source routing core (Apache 2.0). The deployment boundary changes, but the client protocol does not, so you can switch modes without rewriting your harness.

Self-host or Cloud?

The routing contract is shared, while operational surfaces follow the deployment boundary:

  • Self-host if you already have provider keys, run local/private models, have data-residency rules, or are prototyping solo.
  • Cloud if you want BitRouter to operate the router and provide hosted model access.
CapabilitySelf-hosted (OSS)Cloud
Universal API + cross-protocol routing✅✅
Local / private model endpoints✅—
Model fallback & provider selection✅✅
Model variants & presets✅✅
Local evidence-based routing policies✅—
Request checks / guardrailsCustom host✅
OTLP trace + metric export✅—
Local MCP gateway & server tools✅—
Local ACP adapters✅—
Structured outputs✅✅
Namespace isolation primitive✅✅
Managed provider network (no upstream keys needed)—✅
Hosted activity and request receipts—✅
Elastic Inference (supplier charges + Cloud platform usage)—✅
Cloud Auto Routing with BYOK (same Cloud platform usage)—✅

Self-hosted request checks require a compiled extension in a custom host; the default bro binary does not include a matcher.

BitRouter does not package a separate enterprise suite today. Teams with deployment, security, procurement, or support requirements can contact the founders and help shape the team offering.

Do you need your own provider keys? Cloud BYOK uses your provider credentials; the provider bills inference separately. Elastic Inference purchases supplier inference through BitRouter. Both use the same Cloud platform fee of $0.01 per million processed input + output tokens at early access pricing, counted once per request. You can attach Cloud to a self-hosted binary and use both. Self-hosted routing remains free of BitRouter fees. See pricing.

Install the binary

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/bitrouter/bitrouter/releases/download/v1.0.0-alpha.33/bitrouter-installer.sh | sh

Use BitRouter Cloud

Authenticate and send your first request

  1. Sign in to your account at the BitRouter Cloud console.
  2. After installing the CLI, sign in from the terminal and mint a key with the inference:invoke scope:
bro cloud login
bro cloud keys mint --name my-integration --scope inference:invoke

bro cloud login uses a browser device sign-in flow. Follow the displayed URL and code to complete it. The mint command prints the new key once. Replace the placeholder below with that key:

export BITROUTER_API_KEY='paste-your-cloud-key-here'
  1. Send a Responses API request directly to the hosted Cloud endpoint:
curl https://api.bitrouter.ai/v1/responses \
  -H "Authorization: Bearer $BITROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-haiku-4.5","input":"Hello!"}'

The Cloud API host is https://api.bitrouter.ai; the SDK base URL is https://api.bitrouter.ai/v1. Use a Cloud catalog model ID that your account can access, or an enabled workspace routing preset. The local bitrouter/auto selector requires a self-hosted policy binding. See Cloud authentication, the Python client example, and the Responses API contract.

Use Cloud through a local proxy

After bro cloud login, run bro start. The bitrouter provider auto-enables once signed in, so Cloud-managed models can be routed alongside your BYOK keys through http://127.0.0.1:4356/v1. The direct Cloud request above does not require a local proxy.

Cloud BYOK uses your provider keys, with inference billed by the provider. Elastic Inference bills supplier inference charges through BitRouter. Both share a Cloud platform fee of $0.01 per million processed input + output tokens at early access pricing, counted once per request. See pricing.

Onboard via the Agent Skill

For agent runtimes that support skills (Claude Code, Cursor, Codex, Copilot, etc.). BitRouter ships a /bitrouter Agent Skill so the agent can install, configure, migrate to, and troubleshoot BitRouter on its own — the skill carries the facts that drift easily (the listen port, env var names, the provider/model slash form, which subcommands exist), and it lives in the main repo at skills/bitrouter/, kept in sync with the code in the same change. Install once:

npx skills add bitrouter/bitrouter    # via the generic skills CLI

Then ask your agent: "Set up BitRouter for me." — the agent runs the wizard, picks Cloud by default, and verifies the connection autonomously.

The /bitrouter Skill explains which structured bro command to use. The agent host still owns approval and execution; BitRouter does not publish the local skill directory as an MCP origin server.

Onboard via the CLI wizard

For terminal-first setup, launch the wizard:

bro

Bare bro opens the saved default agent when one is configured; otherwise, in a terminal, it starts the wizard and probes local credentials. After setup, it can open the configured TUI conversation. The wizard walks three steps:

  1. Credentials — sign in to BitRouter Cloud (default), log in to a provider, or paste a BYOK key.
  2. Harness — choose a default ACP adapter. Adapters use a compatible local CLI when available.
  3. Finish — open BitRouter Code, start the proxy at http://127.0.0.1:4356, or exit.

Every step maps to a flag, so an agent or CI can configure BitRouter without a human. With --yes, the wizard consumes flag-supplied credentials, reports and skips interactive OAuth, and emits a JSON result envelope on stdout. Select --after exit to finish without opening Code or starting the proxy:

bro init --yes --provider openai --provider-api-key "sk-..." --harness claude --after serve
bro init --yes --use-detected --harness claude --after serve   # accept env keys, run proxy
bro init --yes --api-key "brk_..." --after exit                # Cloud key, no launch
bro init --reset                                               # clear credentials, start over

Every flag is documented in the bro init reference. The wizard creates or updates the resolved bitrouter.yaml, recording the selected agent, optional model, and provider entries. Without --force it starts from the existing configuration; --force starts from the starter template.

Run self-hosted

Set your provider keys in the environment and start the proxy:

export OPENAI_API_KEY=sk-...    # ANTHROPIC_API_KEY / GEMINI_API_KEY also work
bro start
# Proxy running at http://127.0.0.1:4356

BitRouter auto-detects any key set in the environment — no config file needed. Any provider whose key is present is immediately available. See BYOK for the full list of recognized variables, or local inference to point BitRouter at Ollama, vLLM, or LM Studio for free.

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

bro init -c ./bitrouter.yaml  # choose an explicit destination
bro start

Point your agent at the proxy

However you start it, BitRouter is a drop-in proxy. Point your agent runtime at the proxy base URL — http://127.0.0.1:4356 when self-hosting — and every model call routes through BitRouter with no harness changes.

Verify with a request:

curl http://127.0.0.1:4356/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Point any OpenAI-compatible runtime at http://127.0.0.1:4356/v1 to route through BitRouter.

Two commands make the routing decision itself legible:

bro models                            # every model id routable right now
bro route anthropic/claude-opus-4.8   # preview the routing decision

Model selectors use two similar-looking forms for different jobs:

FormMeaningExample
provider/modelStable logical model id; BitRouter may route it through any eligible provideranthropic/claude-opus-4.8
provider:modelExplicit provider pin for local routinganthropic:anthropic/claude-opus-4.8

Use the slash form by default. Use the colon form only when you intentionally need one configured provider, such as a subscription-backed route. See Virtual Models for the complete resolution order.

Adaptive routing

Explicit model ids give you deterministic model selection. To let a self-hosted router apply the policy bound to its named auto router, keep one stable model id in your agent or application:

curl http://127.0.0.1:4356/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "bitrouter/auto", "messages": [{"role": "user", "content": "..."}]}'

bitrouter/auto requires an auto policy binding and fails visibly when the binding is missing. The Auto Router guide shows how to create it, inspect the selected route, and publish a reviewed policy update. Cloud uses catalog model IDs or enabled workspace routing presets such as @<name>; it does not use this local selector. Evaluations covers objective-scored evidence.

Next steps

How is this guide?

On this page