Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions docs/cli-agents/claude-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ Claude Code supports multiple authentication methods. Choose the one that matche

### Claude Pro / Max accounts

If you have a Claude Pro or Max subscription, Claude Code authenticates via browser-based OAuth — no API key needed.
If you have a Claude Pro or Max subscription, Claude Code authenticates via browser-based OAuth. When routing through a custom base URL like Bifrost, an API key is still required.

1. **Set the Bifrost base URL**
1. **Set environment variables**
```bash
export ANTHROPIC_API_KEY=your-bifrost-virtual-key # or "dummy" if virtual keys are not enabled
export ANTHROPIC_AUTH_TOKEN=your-bifrost-virtual-key # same value
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 # same value comment could be clearer

The comment # same value on the ANTHROPIC_AUTH_TOKEN line implicitly refers to the value on the ANTHROPIC_API_KEY line above, but doesn't remind the reader that "dummy" is also valid here when virtual keys are not enabled. A user who sets ANTHROPIC_AUTH_TOKEN without reading the previous line carefully might miss that nuance.

Consider making the comment more self-contained, e.g. # same value as ANTHROPIC_API_KEY (or "dummy"). The same applies at line 51 in the Teams/Enterprise section.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

export ANTHROPIC_BASE_URL=http://localhost:8080/anthropic
```

Expand All @@ -41,10 +43,12 @@ Max subscriptions default to **Opus**, while Pro subscriptions default to **Sonn

### Claude for Teams / Enterprise accounts

Teams and Enterprise users authenticate the same way — via browser OAuth with their team Claude.ai account.
Teams and Enterprise users authenticate the same way — via browser OAuth with their team Claude.ai account. When routing through a custom base URL like Bifrost, an API key is still required.

1. **Set the Bifrost base URL**
1. **Set environment variables**
```bash
export ANTHROPIC_API_KEY=your-bifrost-virtual-key # or "dummy" if virtual keys are not enabled
export ANTHROPIC_AUTH_TOKEN=your-bifrost-virtual-key # same value
export ANTHROPIC_BASE_URL=http://localhost:8080/anthropic
```

Expand Down Expand Up @@ -84,6 +88,7 @@ For enterprise setups where Bifrost handles authentication centrally, Claude Cod

- **`ANTHROPIC_AUTH_TOKEN`** — Sets the `Authorization: Bearer` header. Use this when your gateway requires a custom bearer token.
```bash
export ANTHROPIC_API_KEY=your-bearer-token # required even when using AUTH_TOKEN
export ANTHROPIC_AUTH_TOKEN=your-bearer-token
export ANTHROPIC_BASE_URL=http://localhost:8080/anthropic
```
Expand All @@ -97,7 +102,7 @@ For enterprise setups where Bifrost handles authentication centrally, Claude Cod
Set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` to control the refresh interval (in milliseconds).

<Note>
`ANTHROPIC_AUTH_TOKEN` takes precedence over `ANTHROPIC_API_KEY`. The `apiKeyHelper` has the lowest precedence — it is only used when neither `ANTHROPIC_AUTH_TOKEN` nor `ANTHROPIC_API_KEY` is set.
`ANTHROPIC_AUTH_TOKEN` takes precedence over `ANTHROPIC_API_KEY`. The `apiKeyHelper` has the lowest precedence — it is only used when neither `ANTHROPIC_AUTH_TOKEN` nor `ANTHROPIC_API_KEY` is set. Note: `ANTHROPIC_API_KEY` (even a dummy value) is always required when using a custom `ANTHROPIC_BASE_URL`.
</Note>

Now all Claude Code traffic flows through Bifrost, giving you access to any provider/model configured in your Bifrost setup, plus MCP tools and observability.
Expand Down Expand Up @@ -253,8 +258,9 @@ If you experience issues with tool calls not executing properly, try switching t
# Core Bifrost configuration
export ANTHROPIC_BASE_URL=http://localhost:8080/anthropic

# For API key users (skip for Pro/Max/Team OAuth login)
# Always required (use Bifrost virtual key or "dummy" for OAuth-only setups)
export ANTHROPIC_API_KEY=your-bifrost-virtual-key
export ANTHROPIC_AUTH_TOKEN=your-bifrost-virtual-key

# Custom model tiers (optional)
export ANTHROPIC_DEFAULT_SONNET_MODEL="anthropic/claude-sonnet-4-5-20250929"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading