# Quickstart (/docs/overview/quickstart)

> For AI agents, the [documentation index](https://bitrouter-docs-staging.up.railway.app/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

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](https://bitrouter-docs-staging.up.railway.app/docs/overview/quickstart#authenticate-and-send-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? \[#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.

| Capability                                                  | Self-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 / guardrails                                 | Custom 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](https://github.com/bitrouter/bitrouter/blob/main/docs/GUARDRAILS_EXTENSION.md); 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](mailto:contact@bitrouter.ai) 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](https://bitrouter-docs-staging.up.railway.app/pricing).

## Install the binary \[#install-the-binary]

**macOS / Linux**

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

**Homebrew**

```bash
brew install bitrouter/tap/bitrouter
```

**npm**

```bash
npm install -g bitrouter
```

**cargo**

```bash
cargo install bitrouter
```

## Use BitRouter Cloud \[#use-bitrouter-cloud]

### Authenticate and send your first request \[#authenticate-and-send-your-first-request]

1. Sign in to your account at the [BitRouter Cloud console](https://cloud.bitrouter.ai/sign-in).
2. After [installing the CLI](https://bitrouter-docs-staging.up.railway.app/docs/overview/quickstart#install-the-binary), sign in from the terminal and mint a key with the `inference:invoke` scope:

```bash
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:

```bash
export BITROUTER_API_KEY='paste-your-cloud-key-here'
```

3. Send a Responses API request directly to the hosted Cloud endpoint:

```bash
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](https://bitrouter-docs-staging.up.railway.app/docs/reference/discovery/listModels) 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](https://bitrouter-docs-staging.up.railway.app/docs/reference/authentication#cloud-api-keys), the [Python client example](https://bitrouter-docs-staging.up.railway.app/docs/reference#python-client), and the [Responses API contract](https://bitrouter-docs-staging.up.railway.app/docs/reference/openai-responses/createResponse).

### Use Cloud through a local proxy \[#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](https://bitrouter-docs-staging.up.railway.app/pricing).

## Onboard via the Agent Skill \[#onboard-via-the-agent-skill]

For agent runtimes that support skills (Claude Code, Cursor, Codex, Copilot, etc.). BitRouter ships a `/bitrouter` [Agent Skill](https://agentskills.io/) 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:

```bash
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.

> **info**
>
> 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 \[#onboard-via-the-cli-wizard]

For terminal-first setup, launch the wizard:

```bash
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:

```bash
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](https://bitrouter-docs-staging.up.railway.app/docs/usage/cli#bro-init). 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 \[#run-self-hosted]

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

```bash
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](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/byok-subscriptions#built-in-providers-with-your-own-key) for the full list of recognized variables, or [local inference](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/local-models) to point BitRouter at Ollama, vLLM, or LM Studio for free.

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

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

## Point your agent at the proxy \[#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:

```bash
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:

```bash
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:

| Form             | Meaning                                                                       | Example                               |
| ---------------- | ----------------------------------------------------------------------------- | ------------------------------------- |
| `provider/model` | Stable logical model id; BitRouter may route it through any eligible provider | `anthropic/claude-opus-4.8`           |
| `provider:model` | Explicit provider pin for local routing                                       | `anthropic: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](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/virtual-models#model-selector-forms) for the complete resolution order.

## Adaptive routing \[#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:

```bash
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](https://bitrouter-docs-staging.up.railway.app/docs/routing/auto-router#initialize-a-policy-binding) 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](https://bitrouter-docs-staging.up.railway.app/docs/routing/workload-optimization#evaluations) covers objective-scored evidence.

## Next steps \[#next-steps]

* [Virtual Models](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/virtual-models) — Define named model endpoints and request profiles.

* [bitrouter/auto](https://bitrouter-docs-staging.up.railway.app/docs/routing/auto-router#initialize-a-policy-binding) — Use one stable model id and inspect the policy-driven route.

* [Integrations](https://bitrouter-docs-staging.up.railway.app/docs/integration/coding-agents) — Step-by-step guides for every supported agent runtime.

* [CLI reference](https://bitrouter-docs-staging.up.railway.app/docs/usage/cli#init-and-config) — The full command surface of the binary.