Model sources

Connect subscriptions, hosted providers, or local inference servers to BitRouter.

2 min readEdit this page

A model source is where inference runs and how it is authenticated. BitRouter puts each source behind the same model ids and routing policy, so the calling agent does not need source-specific code.

Pick the source shape

SourceAuthenticationSetup
Claude or Codex subscriptionProvider OAuthbro providers login <provider>
Built-in BYOK providerEnvironment variable or stored keyExport its key or use bro providers login <provider> --api-key ...
Custom hosted APIAPI keyAdd a providers: entry
Local inference serverUsually loopback; optional keyAdd a providers: entry

Subscription providers do not need a YAML block. Other sources use the same minimal shape:

providers:
  my-source:
    api_base: https://example.com/v1
    api_key: ${MY_SOURCE_API_KEY}
    api_protocol:
      - "*": chat_completions
    models:
      - id: example/model

Use the upstream's actual served model id in models. Keep secrets in environment variables rather than committing them to the file.

Verify a source

bro config validate
bro models --provider my-source
bro route my-source:example/model
bro start
  • config validate catches malformed configuration and unsafe upstream URLs.
  • models confirms the source is in the resolved catalog.
  • route previews resolution without making an inference request.
  • The provider-qualified form pins one source; the bare model id lets BitRouter select among every source that serves it.

To combine sources, define a virtual model or fallback chain. A common pattern is local inference first and a hosted source second.

How is this guide?

On this page