Short Answer
If Claude Code returns400 ValidationException, Extra inputs are not permitted, or an error related to cache_control.scope on the AWS Claude official route, set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 before starting Claude Code. This disables Claude Code experimental beta request fields so unsupported extra fields are not rejected by the AWS Claude / Bedrock route. Use export for a quick test, then put the setting in ~/.claude/settings.json for persistent use.
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
Stop the current Claude Code process
If Claude Code is already running, exit it first. The environment variable must be present before Claude Code starts.
Persistent settings.json Configuration
To avoid setting the variable every time, add it to~/.claude/settings.json:
~/.claude/settings.json already contains your LaoZhang API base URL, token, and model, merge the new key into the existing env object instead of replacing the file:
Why This Fix Works
Some Claude Code versions may add experimental beta fields to the request body. The AWS Claude official route or Bedrock-related route may strictly validate the payload and reject unsupported fields 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 experimental beta request fields, making the request shape closer to what the route accepts. This setting fixes field compatibility only; it does not replace checks for model access, balance, API key validity, or model ID correctness.
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 is still available in the console.
- Make sure you are using a LaoZhang API key and a token group that works with Claude Code.
- Check usage logs to see whether the failure is request validation, model access, or balance related.
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 usage logs
- A masked
~/.claude/settings.json, without the full API key or AccessToken
Related
- For the full setup guide, see Claude Code Setup Guide
- To check model access, see Model Availability and Permissions
- To create or rotate an API key, see Token Management
- To inspect request status, see How do I view my usage logs?