[BUG] Getting "invalid beta flag" error despite CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
Resolved 💬 16 comments Opened Jan 29, 2026 by igor-makarov Closed Jan 29, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
This began occurring on 2.1.23. Version 2.1.22 does not have the issue.
When running with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 in the env, CC uses some beta flag, which is passed on to Bedrock, causing an error.
What Should Happen?
Claude Code runs
Error Messages/Logs
API Error: 400 {"error":{"message":"{\"message\":\"invalid beta flag\"}.
Received Model Group=claude-opus-4-5-20251101
Available Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}
Steps to Reproduce
Run 2.1.23 against Bedrock
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.22
Claude Code Version
2.1.23
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
16 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is not a duplicate - started happening in 2.1.23 only.
Definitely something in 2.1.23.
We doing this
The issue is gone.
But I want 2.1.23, it finally lets me (hopefully) get rid of spinner verb slop.
I was able to use 2.1.23 yesterday. But today I am getting this same failure on everything I try.
By the way the offending header is
prompt-caching-scope-2026-01-05.I hacked my installation to not send it and it "fixed" it.
LiteLLM is not "firstParty"!
Yes, I am using LiteLLM.
Is there a way that I can see the requests that claude code is sending?
BTW, I ripped everything out and started over with version 2.1.22, and am succeeding.
Too quick. A very simple request succeeds. A harder one fails. Oh, wait. I have 2.1.23! Even though I told the install script to get 2.1.22.
What happened here?
<img width="589" height="464" alt="Image" src="https://github.com/user-attachments/assets/e60d000c-53fe-4108-969d-656c1db94535" />
<img width="588" height="463" alt="Image" src="https://github.com/user-attachments/assets/ccc80218-f449-485f-b7fa-353ee30aa6ec" />
How did it slip from 2.1.22 to 2.1.23?
I've managed to do this by running a local LiteLLM proxy with
--detailed_debug.BUT - the thing that figured out the fix was Claude Code reverse-engineering the minified JS in search of beta headers.
Thanks so much for reporting. We just shipped v2.1.25 with the fix, and you should be able to avoid the error now (keep setting
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1). So sorry for the friction, closing now but please let me know if you're still seeing any issues.@szwang it might be useful to have a way to differentiate between "firstParty" and LiteLLM and such. Something like env THIRD_PARTY_PROVIDER=1.
I'm required by my employer to use the LiteLLM setup and there are always papercuts, like having to have specific model slugs or various beta params shenanigans like this issue here.
It feels like these go unnoticed until it makes a lot of noise.
@szwang Thanks for the fix - do we loose anything by setting this beta flag? We've only seen this issue come up starting today (we hadn't updated beyond ~2.1.20 at that stage), whereby the CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS flag was needed at all -
We can confirm that 2.1.22 still works without the CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS flag, so something has changed in 23-25.
Ideally this wouldn't require setting an environment variable. Can Claude Code use the API URL to determine if its connecting to a Gateway or Anthropic, and if not, can we have an environment variable that more accurately blankets "connecting through a gateway" as opposed to experimental betas.
Thanks!
@igor-makarov We hear you on the papercuts here :/ Better accommodating gateways is something we're discussing, but the tricky thing is that different third party providers also have different quirks. We've documented our gateway requirements here and recommend following those standards, which would have avoided this (i.e. gateways should forward beta headers).
Of course, we definitely anticipate this behavior and do a better job of catching regressions! But it is hard to generalize into a single flag. I hope that makes sense. Would also love to know what your other issues are.
@bdavj
There are certain Claude API beta features that you might lose, but nothing major. When features GA we update accordingly so all users get them.
It tells us that you do not want us to the beta header, or send fields that require it. The bug was due to a code change that didn't take the env var flag into account.
Nothing is planned at the moment. Curious what your ideal would be/
We could and are considering it.
Hope that helps!
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.