[BUG] 400 error with custom ANTHROPIC_BASE_URL should suggest CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
When using Claude Code with a custom ANTHROPIC_BASE_URL (e.g. Azure AI, LiteLLM, or other gateways), Claude Code v2.1.100 sends beta headers such as advisor-tool-2026-03-01 that the third-party endpoint does not recognize, causing an immediate HTTP 400 failure with a cryptic API error.
The workaround is to set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1, which suppresses these headers and restores functionality. However, Claude Code gives no indication that this flag exists or is relevant — the user only sees a raw 400 API error.
Related to the pattern in #22893 (same class of issue, new beta header advisor-tool-2026-03-01).
What Should Happen?
When a 400 error is received that contains "Unexpected value(s)" for the anthropic-beta header, and ANTHROPIC_BASE_URL is set to a non-Anthropic endpoint, Claude Code should output a clear, actionable message:
You appear to be using a custom API endpoint. If you are seeing beta header
errors, set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 to disable them.
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"Unexpected value(s) `advisor-tool-2026-03-01` for the
`anthropic-beta` header. Please consult our documentation at docs.claude.com
or try again without the header."},"request_id":"req_011CZudNPFEcZGR8Ace3tPTm"}
Steps to Reproduce
- Configure Claude Code with an Azure AI endpoint:
``bash``
export ANTHROPIC_BASE_URL="https://<deployment>.services.ai.azure.com/anthropic/"
export ANTHROPIC_AUTH_TOKEN="<api-key>"
export ANTHROPIC_MODEL=claude-sonnet-4-6
export ANTHROPIC_API_KEY=""
# CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS is NOT set
- Run
claudeand send any prompt. - Request fails with HTTP 400 — no suggestion that
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1would fix it.
Workaround: Setting CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 resolves the issue.
Is this a regression?
Yes — introduced in v2.1.100 (new advisor-tool-2026-03-01 beta header added without coverage by the disable flag's detection logic).
Claude Code Version
2.1.100
Platform
Linux
Additional Information
The fix could be either:
- (Better UX) Detect
Unexpected value(s)+anthropic-betain a 400 response whenANTHROPIC_BASE_URLis custom, and surface a helpful message pointing toCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1. - (Stricter fix) Ensure
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1suppresses all experimental headers including newer ones likeadvisor-tool-2026-03-01.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗