docs: recommend ANTHROPIC_AUTH_TOKEN over ANTHROPIC_CUSTOM_HEADERS for Claude Code auth - #3686
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughUpdated ChangesClaude Code authentication documentation
Sequence Diagram(s)(omitted — doc-only changes, no runtime component interactions) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ANTHROPIC_AUTH_TOKEN over ANTHROPIC_CUSTOM_HEADERS for Claude Code auth
78376b2 to
fbd0edc
Compare
8177210 to
3c226a6
Compare
Confidence Score: 5/5Documentation-only change with no code modifications; safe to merge. The change is confined to a single .mdx documentation file. The new content is accurate (the Authorization header is already in Bifrost's default whitelist, and the trade-off description for each auth method is technically correct). All five settings.json snippets are updated consistently. No logic, migrations, or runtime behavior is affected. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "refactor: claude code integration recomm..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/cli-agents/claude-code.mdx (1)
51-170: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy liftAdd required Mintlify tabs for configuration guidance.
The updated config section still presents raw snippets without the required
Web UI/API/config.jsontabbed structure for docs pages. Please wrap these setup instructions/snippets in the mandated tabs and ensure theconfig.jsontab example aligns withtransports/config.schema.json.As per coding guidelines,
docs/**/*.mdx: Mintlify MDX documentation must have Web UI / API / config.json tabs; validate config.json examples against transports/config.schema.json.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/cli-agents/claude-code.mdx` around lines 51 - 170, The docs page docs/cli-agents/claude-code.mdx must be updated to use the mandated Mintlify tabbed layout: wrap the relevant setup sections and all JSON snippets into three tabs labeled "Web UI", "API", and "config.json" (use the "Web UI" tab for UI instructions/screenshots and "API" for env/auth guidance), and move the concrete settings.json example into the "config.json" tab; ensure the config.json example conforms to transports/config.schema.json (validate keys like env, ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and provider-specific DEFAULT_* model keys and remove any disallowed top-level fields such as model), keeping the existing images and routing instructions in their appropriate tabs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/cli-agents/claude-code.mdx`:
- Around line 54-57: Rewrite the note as step-by-step bullets: instruct the user
to open settings.json and remove the "model" field if present (it overwrites env
model selection), then save the file; start Claude, run the /logout command, and
restart Claude; finally, explain auth behavior: if using ANTHROPIC_AUTH_TOKEN no
Anthropic console login is required, but if using ANTHROPIC_CUSTOM_HEADERS
select "Anthropic Console account · API usage billing" when prompted. Ensure
each action is its own bullet for clarity.
---
Outside diff comments:
In `@docs/cli-agents/claude-code.mdx`:
- Around line 51-170: The docs page docs/cli-agents/claude-code.mdx must be
updated to use the mandated Mintlify tabbed layout: wrap the relevant setup
sections and all JSON snippets into three tabs labeled "Web UI", "API", and
"config.json" (use the "Web UI" tab for UI instructions/screenshots and "API"
for env/auth guidance), and move the concrete settings.json example into the
"config.json" tab; ensure the config.json example conforms to
transports/config.schema.json (validate keys like env, ANTHROPIC_BASE_URL,
ANTHROPIC_AUTH_TOKEN, and provider-specific DEFAULT_* model keys and remove any
disallowed top-level fields such as model), keeping the existing images and
routing instructions in their appropriate tabs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1b7c19ac-5588-4c73-93f9-6ce106a620a7
📒 Files selected for processing (1)
docs/cli-agents/claude-code.mdx
3c226a6 to
3f9c8e8
Compare
Merge activity
|
…` for Claude Code auth (#3686) ## Summary Updates the Claude Code documentation to recommend `ANTHROPIC_AUTH_TOKEN` as the primary authentication method over `ANTHROPIC_CUSTOM_HEADERS`. Using `ANTHROPIC_AUTH_TOKEN` eliminates the requirement for users to log in with an Anthropic account, since Bifrost handles all routing and authentication through the virtual key. ## Changes - Added an "Authentication Methods" section explaining both `ANTHROPIC_AUTH_TOKEN` (recommended) and `ANTHROPIC_CUSTOM_HEADERS` (alternative), including the caveat that `ANTHROPIC_CUSTOM_HEADERS` still requires an Anthropic account login - Replaced `ANTHROPIC_CUSTOM_HEADERS: x-bf-vk: your-virtual-key` with `ANTHROPIC_AUTH_TOKEN: your-virtual-key` across all configuration examples (non-Anthropic, Anthropic, Bedrock, Vertex, Azure) - Updated the caching/setup note to clarify the login flow differs depending on which authentication method is used - Removed the previous blanket note recommending `ANTHROPIC_CUSTOM_HEADERS` for all versions ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [x] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [x] Docs ## How to test Review the updated Claude Code documentation page and verify: - The "Authentication Methods" section clearly explains both options and their trade-offs - All configuration snippets use `ANTHROPIC_AUTH_TOKEN` instead of `ANTHROPIC_CUSTOM_HEADERS` - The setup note accurately reflects the login requirements for each method ## Breaking changes - [ ] Yes - [x] No ## Security considerations `ANTHROPIC_AUTH_TOKEN` passes the virtual key via the `Authorization: Bearer` header, which is the standard bearer token pattern. Users no longer need to expose or manage Anthropic account credentials when using the recommended method. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [x] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
## ✨ Features
- **Azure v1 API Migration** — Migrated Azure provider to the v1 API:
removed the `api-version` query parameter and the
`/openai/deployments/{model}/...` URL pattern in favor of
`/openai/v1/{operation}`; the `api_version` field has been dropped from
`AzureKeyConfig` (#3661, #3756)
- **EnvVar Support for OTEL & Prometheus Configs** — `CollectorURL`,
`MetricsEndpoint`, headers, push gateway URL, and basic auth credentials
can now be sourced from environment variables (e.g.,
`env.OTEL_COLLECTOR_URL`); added a new `ConfigMarshallerPlugin`
interface that lets plugins control storage/redaction round-trips
(#3651)
- **OTel Extra Header Forwarding** — `x-bf-eh-*` extra headers forwarded
to upstream providers are now also emitted on the request span under
`gen_ai.request.extra_header.*` for end-to-end tracing (#3730)
- **OTel Semantic Conventions** — Aligned OTel attribute keys with the
OpenTelemetry GenAI spec (canonical `gen_ai.*` and new `bifrost.*`
attributes); legacy attributes are retained in parallel to avoid
breaking existing dashboards (#3732)
- **VK Quota with Provider Configs** — `GetVirtualKeyQuotaByValue` and
the `getVirtualKeyQuota` HTTP response now include `provider_configs`
with their budgets and rate limits (#3721)
- **MCP Temp Token Non-Auth Toggle** — Added
`mcp_enable_temp_token_auth` client config flag to gate short-lived MCP
token minting for non-authenticated users (#3720)
- **Responses Stream in JSON Parser** — `jsonparser` plugin now handles
OpenAI Responses API streaming (`ResponsesStreamRequest`) in addition to
chat completions (#3749)
- **Session API Rework** — Logout now calls both the password-based
session logout and OAuth logout endpoints and resets all RTK Query cache
state (#3698)
## 🐞 Fixed
- **Streaming Latency for Observability** — Deferred root span
termination to the trace completer callback for streaming requests so
request latency is no longer inflated by header-flush time (#3762)
- **Stream Cancellation Race** — Set `BifrostContextKeyConnectionClosed`
before closing the stream and short-circuit `idleTimeoutReader.Read`
when the connection is already closed to avoid panics and hangs on
cancellation (#3733)
- **Bedrock Cache Points** — Strip cache points from Bedrock requests
for models that do not support prompt caching (e.g., GLM, Llama) to
avoid Converse API errors (#3754)
- **Bedrock Empty Text Blocks** — Skip empty/nil text blocks during
Bedrock response conversion to avoid invalid messages (#3747)
- **Bedrock Reasoning + Tools** — Preserve reasoning content blocks on
assistant turns that also contain tool calls in the Bedrock chat
converter (#3690)
- **Bedrock Search Content & Video** — Restored search content and video
parts that were being dropped from Bedrock-native passthrough requests
(#3729)
- **Structured Output Stop Reason** — Fixed an incorrect `tool_calls`
finish reason when structured output is combined with extended-thinking
tools (#3685)
- **Gemini Tool Schema Passthrough** — Forward full tool parameter
schemas via `parametersJsonSchema` instead of the lossy `parameters`
form; corrected tool response role to `user`; resolved structured output
+ tools conflict (#3761)
- **Anthropic Stop Reason & Tool Versions** — Normalized stop reason
mapping (`end_turn` to `stop`, `tool_use` to `tool_calls`, `max_tokens`
to `length`) and upgraded `text_editor_20250124`/`str_replace_editor` to
`text_editor_20250728` for computer-use tools (#3761)
- **Azure Endpoint Redaction** — Fixed a panic when
`AzureKeyConfig.Endpoint` is a literal value rather than an env
reference (#3761)
- **Auth Middleware Path Match** — Match temp-token auth middleware
whitelist against the request path only, not the full URI with query
parameters (#3737)
- **Governance Blocked Models UI** — Restored the missing Blocked Models
create/edit UI in the VK provider config sheet (#3750)
- **Logging Plugin Cleanup Drain** — Fixed a shutdown race where
`batchWriter` could drop in-flight log entries; `Cleanup` now drains
both the recovered batch and remaining queue within a 30-second budget
(#3717)
- **Model Rankings Empty Entries** — Excluded entries with empty `model`
values from model rankings matview queries so blank rows no longer
surface in the UI (#3758)
- **User Filter Duplicates** — Recreated `mv_filter_users` matview to
require non-empty `user_name`, eliminating duplicate filter dropdown
entries (#3764)
- **User Filter Display Name** — Use `user_name` instead of `user_id` as
the display label for users in logging filters (#3691)
- **Large Numeric ID Precision** — Preserve large numeric IDs in URL
search params by skipping JSON parsing for plain strings (#3692)
## 🔧 Refactors & Chores
- **Error Propagation for GetAvailable\* APIs** — `GetAvailable*`
methods on `LoggerPlugin`/`LogManager` now return wrapped errors instead
of silently logging and returning empty slices (#3759)
- **Governance Blocklist Matching** — Use `slices.Contains` for VK
blocked-model matching for clearer code with identical semantics (#3727)
- **Exported `ResolvePeriod`** — Renamed `resolvePeriod` to
`ResolvePeriod` so external packages can reuse the period parsing
(#3763)
## 📚 Docs
- **OTEL Env Var Documentation** — Documented `env.VAR_NAME` support for
`collector_url`, `metrics_endpoint`, and headers in OTEL/Prometheus
plugin docs
- **OTEL OSS Features & Examples** — Added OTEL documentation to the OSS
features list with usage examples (#3731)
- **Anthropic Auth Recommendation** — Recommend `ANTHROPIC_AUTH_TOKEN`
over `ANTHROPIC_CUSTOM_HEADERS` for Claude Code authentication (#3686)

Summary
Updates the Claude Code documentation to recommend
ANTHROPIC_AUTH_TOKENas the primary authentication method overANTHROPIC_CUSTOM_HEADERS. UsingANTHROPIC_AUTH_TOKENeliminates the requirement for users to log in with an Anthropic account, since Bifrost handles all routing and authentication through the virtual key.Changes
ANTHROPIC_AUTH_TOKEN(recommended) andANTHROPIC_CUSTOM_HEADERS(alternative), including the caveat thatANTHROPIC_CUSTOM_HEADERSstill requires an Anthropic account loginANTHROPIC_CUSTOM_HEADERS: x-bf-vk: your-virtual-keywithANTHROPIC_AUTH_TOKEN: your-virtual-keyacross all configuration examples (non-Anthropic, Anthropic, Bedrock, Vertex, Azure)ANTHROPIC_CUSTOM_HEADERSfor all versionsType of change
Affected areas
How to test
Review the updated Claude Code documentation page and verify:
ANTHROPIC_AUTH_TOKENinstead ofANTHROPIC_CUSTOM_HEADERSBreaking changes
Security considerations
ANTHROPIC_AUTH_TOKENpasses the virtual key via theAuthorization: Bearerheader, which is the standard bearer token pattern. Users no longer need to expose or manage Anthropic account credentials when using the recommended method.Checklist
docs/contributing/README.mdand followed the guidelines