Skip to main content
Bifrost CLI starts coding agents with the gateway URL, credential, and model of the current context. Set up a context and a credential first with OSS setup or Enterprise setup.

Supported agents

If a harness is not installed, the interactive launcher offers to install it and asks for confirmation first.

Launch a harness

Choose the context, harness, and model. On Enterprise, the Enterprise SSO row signs you in or out without leaving the launcher. When the harness exits, the launcher returns to the chooser. bifrost launch --tabs runs several harnesses in one terminal, with some rendering differences from native mode.
Before the harness starts, the CLI prints the endpoint, credential type (Enterprise SSO or virtual key), and the equivalent harness command. Launches change only the child process environment and temporary files:
  • Claude Code receives the gateway URL and model. With SSO, it also receives a temporary --settings file whose apiKeyHelper runs bifrost auth print-token; the file is removed when Claude Code exits.
  • Codex CLI runs with a temporary CODEX_HOME containing a copy of your config.toml plus a bifrost provider. The temporary home, including that session’s history, is removed when Codex exits.
  • OpenCode receives an owner-readable temporary provider configuration that is removed when OpenCode exits.
  • Inherited provider credentials such as ANTHROPIC_API_KEY or OPENAI_API_KEY are removed from the child environment so they cannot override the Bifrost credential.

Attribute requests to a project

On Bifrost Enterprise, select one project by ID or name without changing the caller’s credential:
--project-id and --project-name are mutually exclusive. Put them before native harness arguments (and before --). Each launch gets its own selection; two sessions can use different projects in the same repository. Empty selectors and control characters are rejected. The interactive chooser does not select projects: use direct launch for project-scoped sessions. An unsupported combination returns an error; it does not launch an unscoped session. Gemini’s header format cannot carry a comma in a project selector through this integration; use the project ID instead. Pi selectors must be literal values, not command or environment substitutions. To make a project the default when running a supported harness directly:
Persistent configuration still requires a virtual key. unconfigure restores the complete pre-Bifrost configuration, including its original headers. Reconfiguring with another selector replaces both old project selectors. Omitting the flags does not mean “clear my existing project”; restore or edit the native configuration to remove a saved selection. For Claude launches, the CLI preserves custom headers from the shell and the user/repository settings it reads, then replaces the project selector in session settings. Do not combine the project flags with a native --settings override; use repository settings for the other headers. Managed Claude settings retain their higher precedence. For OpenCode, remove OPENCODE_CONFIG_CONTENT before using the project flags so a later inline override cannot replace the generated project configuration. A launcher preflight carries the same project header. Verify actual inference in Bifrost Logs: the resolved project_id/project_name and caller identity should appear together. A missing or unauthorized project is rejected. The header selects a project; it does not create one or grant membership. For spend funded by the project instead of the caller, select project_only accounting in Bifrost. A plain virtual key without a resolved user requires open project membership; use Enterprise SSO for explicit user membership and per-member shares. Deployment-wide caps still apply. Claude Desktop on 3P has its own configuration. See Desktop project attribution; bifrost configure claude writes Claude Code settings, not Desktop’s third-party inference settings.

Persist configuration for direct use

bifrost configure writes the Bifrost endpoint, virtual key, and optional model into the harness’s own configuration so it works when you run the harness directly. It supports all four agents and requires a virtual key: short-lived SSO tokens are never written to long-lived files.
OpenCode requires --model on first configuration. Existing JSON settings are merged; comments and formatting may change, and unconfigure restores the original bytes. Environment variables and project settings can override these user settings. Gemini loads the first .env it finds, so a project .env can take precedence over the home configuration. Before changing anything, the CLI saves a restoration receipt under ~/.bifrost/receipts/. To undo the change:
unconfigure restores the exact files captured before configuration. If you edited a configured file afterwards, configure and unconfigure refuse to overwrite it; rerun with --force to proceed. The receipt contains your original files and the virtual key, so it is written with owner-only permissions.
A persistent Claude Code configuration sets ANTHROPIC_AUTH_TOKEN, which outranks the SSO token helper used by bifrost claude. Run bifrost unconfigure claude before launching Claude Code with Enterprise SSO.
For Claude Code without the launcher and with SSO, configure apiKeyHelper yourself; see Dynamic credentials with apiKeyHelper.

Verify requests flow through Bifrost

  1. Check the launch banner: endpoint shows your Bifrost URL and auth shows the expected credential type.
  2. Inside the harness, confirm the model: /status in Claude Code and Codex, or the model footer in OpenCode.
  3. Send a short prompt.
  4. Confirm the request reached Bifrost:
    • Enterprise SSO users: bifrost usage shows updated budget usage and the model under top models for your identity.
    • Administrators: bifrost logs list --limit 5 or the dashboard Logs page shows the request with the expected virtual key or user.

Harness caveats

  • Model permissions. The launcher lists models from /v1/models using the effective credential, so it shows only models your user or virtual key can use. The model must also support the tool calling the harness relies on.
  • Gemini CLI sends its credential as x-goog-api-key, which cannot carry an SSO session. Store a virtual key before launching Gemini on a gateway that enforces inference authentication.
  • Codex CLI builds its /model picker from its own catalog. Start Codex with the full Bifrost model ID (bifrost codex --model provider/model) and confirm with /status. Codex uses the Responses API, so non-OpenAI models must support Responses tool calls through Bifrost.
  • OpenCode shows the launched model as bifrost/<model>. Relaunch to switch to a model outside that generated provider. If colors differ from a direct launch, set an explicit theme in ~/.config/opencode/tui.json.
  • Claude Code model setup, routing aliases, and MCP are covered in the Claude Code guide.

Next steps

Claude Code

Static and dynamic Claude Code credentials, models, and MCP.

Troubleshooting

Fix common authentication, context, and agent errors.

CLI Agents

Per-agent configuration and limitations, including manual setup.