CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 before starting Claude Code to turn off experimental beta request fields.
Claude models are available again from October 18, 2026 (see the announcement). If Claude Code hits one of these 400 errors with a Claude model, the steps below still apply. For the full Claude Code configuration, see Claude Code setup with LaoZhang API.
When this applies
- Claude Code is already configured with LaoZhang API
- The request uses the AWS Claude official route or a Bedrock-related route
- The terminal or request log shows
400 ValidationException - The error contains
Extra inputs are not permitted - The error points to
cache_control.scope,cache_control,scope, or another extra request field - The API key, balance, and model ID look correct, but Claude Code is rejected before a normal model response
This error is usually a request-field compatibility issue. It does not automatically mean the account balance, model permission, or API key is wrong. Disable experimental beta request fields before rotating keys.
Steps to fix
1
Stop the current Claude Code process
If Claude Code is already running, exit it first. An environment variable exported in the shell must be present before Claude Code starts.
2
Export the compatibility setting
Run this in the same terminal where you will start Claude Code:
3
Start Claude Code again
Start Claude Code from the same terminal:If the 400 error disappears, the issue was most likely caused by experimental beta fields that the AWS Claude / Bedrock route rejects.
Persistent settings.json configuration
To avoid setting the variable every time, add it under theenv key in ~/.claude/settings.json:
~/.claude/settings.json already contains your LaoZhang API base URL and key, merge the new key into the existing env object instead of replacing the file:
YOUR_LAOZHANG_API_KEY with your LaoZhang API key. If you also set ANTHROPIC_MODEL, use a model whose Endpoints include Anthropic Messages in the model catalog, such as glm-5.2.
Why this fix works
Claude Code can add Anthropic-specific beta headers and beta fields to its requests. The AWS Claude official route and Bedrock-related routes validate the payload strictly and reject fields they do not support, with errors such as:400 ValidationExceptionExtra inputs are not permitted- Errors related to
cache_control.scope
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 tells Claude Code not to send those beta headers and fields, so the request matches what the route accepts.
The Claude Code environment variable reference recommends this setting when a proxy gateway rejects requests with errors like Extra inputs are not permitted. It fixes field compatibility only; it does not replace checks for model access, balance, API key validity, or model ID correctness.
With this setting, MCP tool search is turned off and all MCP tools load at startup, which can use more context.
If the error continues
- Restart the terminal or restart Claude Code after changing the setting.
- Check that
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASis under the top-levelenvobject in~/.claude/settings.json. - Update Claude Code to the current available version and retry.
- Confirm that the model ID lists Anthropic Messages in the model catalog and that your token group can call it.
- Make sure you are using a LaoZhang API key and a token group that works with Claude Code.
- Check call logs to see whether the failure is related to request validation, model access, or balance.
Still need help
If disabling experimental beta fields does not fix the issue, send support:- Account email or username
- Claude Code version
- Operating system and terminal type
- Model ID
- Whether the AWS Claude official route is being used
- Full error text, especially the field name after
ValidationException - Request time, status, and request ID from LaoZhang API call logs
- A masked
~/.claude/settings.json, without the full API key or AccessToken
Related
- To check model access, see How to check model availability and access
- To create or rotate an API key, see Create, store, rotate, and revoke API keys
- To inspect request status, see How to review and use call logs
- For the Anthropic Messages protocol, see the Claude API guide
- Official reference: Claude Code environment variables