[BUG] CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS doesn't remove ?beta=true query params and anthropic-beta headers
Resolved 💬 18 comments Opened Jan 22, 2026 by pdecat Closed Jan 30, 2026
Description
When CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 is set, Claude Code still sends:
?beta=truequery parameters on API URLs (e.g.,/v1/messages?beta=true)anthropic-betaheaders with beta feature flags
This causes issues when using LLM gateways like LiteLLM that proxy to AWS Bedrock, as Bedrock rejects requests with these beta flags with error: {"message":"invalid beta flag"}
Current behavior
The env var only disables betas when the provider is "anthropic" or "foundry":
(jB()==="anthropic"||jB()==="foundry")&&!f$(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)
Expected behavior
When CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 is set:
- All
?beta=truequery parameters should be removed from API URLs - The
anthropic-betaheader should be empty or not sent - This should apply regardless of the detected provider
Workaround
Binary patching Claude Code:
sed -i 's/?beta=true//g; s/anthropic-beta/anthropic-xxxx/g' $(which claude)
Environment
- Claude Code version: 2.1.15
- OS: Linux
- LLM Gateway: LiteLLM proxying to AWS Bedrock
Related issues
- #11678 - BUG: claude -p fails with "tools.3.custom.input_examples: Extra inputs are not permitted"
- #11960 - BUG: CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS ENV variable is not honored in claude settings
- BerriAI/litellm#16726 - invalid beta flag for Anthropic models with AWS Bedrock
18 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Experiencing the same with Anthropic Models through Databricks
another hacky workaround is to set up a local proxy server that strips the query parameter and beta header from all outbound requests to anthropic API. you can get claude-code to spin one up for you really easily if you don't feel like writing one yourself...
Any update on this?
For me (using a proxy to Bedrock) this issue appeared when version
2.1.23was rolled out. Version2.1.22still seems to work though.So if you used the native install method on Mac & want to rollback:
curl -fsSL https://claude.ai/install.sh | bash -s -- 2.1.22Source
Confirming @TilmannF : 2.1.22 works fine, but 2.1.23 is failing. Just in case you want to rollback to 2.1.22 the NPM way:
npm install -g @anthropic-ai/claude-code@2.1.22I have also the same issue with the Claude CLI with the new version 2.1.23
FWIW, recent reports are completely unrelated to MCP usage at all, v2.1.23 is just broken in regard to AWS Bedrock.
Also, my original workaround with sed won't work anymore.
Still happening in 2.1.25, specifically header
structured-outputs-2025-12-15does not work with Vertex but is still being sent by Claude Code even with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1Still happening in 2.1.25,please quick quick repair.
In version 2.1.25, adding the global variable
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1worked, but I’m not sure if it’s possible to write an Nginx filter to remove parameters—it feels like it would be very troublesome.Issue is resolved in https://github.com/anthropics/claude-code/releases/tag/v2.1.25
You only fixed part of the issue.
In 2.1.22 I see errors about
structured-outputs-2025-12-15beta headers, but it doesn't break the main Claude Code workflow. let's call it BUG_MINORIn 2.1.23 Claude Code can't even start, lets call it BUG_MAJOR
In 2.1.25 you fixed BUG_MAJOR but not BUG_MINOR, I still see errors about
structured-outputs-2025-12-15when sending messages to vertex. Even withCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1Still seeing this issue. We weren't seeing this yesterday with 2.1.22.
LiteLLM, Claude Code, Bedrock
As of about 1400 GMT today, we've started seeing the invalid beta flag coming from the bedrock back end. Presumably the DISABLE_EXPERIMENTAL_BETAS flag shouldn't be needed, and this is something that needs fixing properly? Has a beta feature flag been deprecated recently?
Well, this issue was about
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1not being respected, and v2.1.25 resolves that in our context (LiteLLM proxying to AWS Bedrock).PS: I'm just a user here.
Fair point - will raise a separate issue if one doesn't already exist.
Yeah, I can also confirm the issue is resolved for me now.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.