[BUG] API Error 400: context_management: Extra inputs are not permitted

Resolved 💬 35 comments Opened Jan 29, 2026 by mehulparmariitr Closed Mar 13, 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?

Bug Description

Claude Code fails immediately on any prompt with API Error 400.

Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"context_management: Extra inputs are not permitted"},"request_id":"req_vrtx_011CXb3h5QVzmdZjWqPq1Qc7"}

What Should Happen?

There should be no issues while working on an old or a new session.

Error Messages/Logs

## Bug Description
Claude Code fails immediately on any prompt with API Error 400.

## Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"context_management: Extra inputs are not permitted"},"request_id":"req_vrtx_011CXb3h5QVzmdZjWqPq1Qc7"}

Steps to Reproduce

Steps to Reproduce

  1. Open terminal
  2. Run claude
  3. Type any message (e.g., "hi")
  4. Error occurs immediately

Claude Model

Opus 4.5

Is this a regression?

No

Last Working Version

2.1.20 (Claude Code)

Claude Code Version

2.1.23 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

This was also happening in 2.1.22 (Claude Code)

View original on GitHub ↗

35 Comments

github-actions[bot] · 5 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/14135

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

mehulparmariitr · 5 months ago

No this should not be closed and let go. This is quite urgent!

mehulparmariitr · 5 months ago

I downgraded to 2.1.20, and it worked fine. Something broke after this version.

hegdeashwin · 5 months ago

Please do not close this reported bug, its impacting our internal platform users. We observe the same downgrade it to v2.1.20 or less fixes the issue.

We are consistently encountering "Extra inputs are not permitted" errors following Claude Code upgrades, which suggests potential backward compatibility issues.

mithunsasidharan · 5 months ago

Adding another data point here — we’re also seeing this issue in our environment after upgrading Claude Code.

The "_Extra inputs are not permitted"_ error is causing active regressions for users and blocking workflows that were previously stable. Rolling back to v2.1.20 consistently resolves the problem for us as well.

jesseobrien · 5 months ago

Seeing this with our LiteLLM deployment (v1.81.3) and Claude Code 2.1.22 as well with bedrock.

Edit: I'm trying out adding drop_params to the litellm configuration with bedrock to see if that will stop this from happening.

Edit 2: For anyone using LiteLLM, you can add this to the litellm_params:

"drop_params": True,
"additional_drop_params": ["context_management"],
faiz121 · 5 months ago

Yes, seeing the same issue since upgrading the v2.1.22, please prioritize fixing this

wnm3 · 5 months ago

v2.1.20 works, (I didn't try 2.1.21, or 2.1.22), but v2.1.23 is useless until this gets fixed.

mehulparmariitr · 5 months ago

I upgraded to 2.1.25, but still the error is there

szwang · 5 months ago

Thanks so much for reporting, and so sorry for the issues here! We just released v2.1.27, which should fix the error so long as you pass CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 when running Claude Code. Please let me know if you run into any more errors.

robert-chis-ciure · 5 months ago

Still broken in 2.1.27 for Claude Max subscription users.

Error:

```
API Error: 400

{"type":"error","error":{"type":"invalid_request_error","message":"system.2.ca
che_control.ephemeral.scope: Extra inputs are not permitted"}}
```

Environment:

  • Claude Max subscription (direct Anthropic API, not gateway/Bedrock/Vertex)
  • macOS (Apple Silicon)
  • Opus 4.5 model

Tested versions:

  • 2.1.20 ✅ works
  • 2.1.23 ✅ works
  • 2.1.25 ❌ broken
  • 2.1.26 ❌ broken
  • 2.1.27 ❌ broken

Tried workaround:
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 — did NOT fix the issue for Claude
Max users, @szwang .

Bug appears to have been introduced in 2.1.25, not 2.1.22.

wnm3 · 5 months ago

@robert-chis-ciure I was using Sonnet, and it was broken in 2.1.23 for me, in the same Apple environment, though.

wnm3 · 5 months ago

I used brew install claude-code and exported CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 and ran claude -r and it appears to work with the Sonnet model. Thank you @szwang

szwang · 5 months ago

I'm so glad. @robert-chis-ciure thanks for the report! Looking into it.

dpup · 5 months ago

Still happening on v2.1.29 for me. Opus only, not Sonnet. Any work arounds?

Update:
From 2.1.27 release notes

- Fixed context management validation error for gateway users, ensuring `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` avoids the error

This fixed it for me.

narengogi · 5 months ago

still happening, I'm using anthropic through portkey.
Plus it appears that vertex does not support the new prompt-caching-scope-2026-01-05 at all, leading to this error

⎿  Error: Error during compaction: Error: API Error: 400 {"error":{"message":"vertex-ai error: Unexpected value(s) prompt-caching-scope-2026-01-05 for the anthropic-beta header. Please consult our documentation at docs.anthropic.com or try again without the header.","type":"invalid_request_error","param":null,"code":null},"provider":"vertex-ai"}
tplass-ias · 5 months ago

Please make experimental features opt-in instead of opt-out in the future :) thx for the CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS fix!

ipqhjjybj · 5 months ago

I also have such error!

ipqhjjybj · 5 months ago

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"context_management: Extra
inputs are not permitted"},"request_id":"req_011CXpT18aE4sFKqHkpUo8j9"}

ipqhjjybj · 5 months ago

it works fun after when i use npm install -g @anthropic-ai/claude-code@2.1.4
maybe the new version of claude-code has something different

locotoki · 5 months ago

Maabook

API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"system.2.ca
che_control.ephemeral.scope: Extra inputs are not permitted"}}
Environment:

Claude Max subscription macOS (Apple Silicon)
Opus 4.5 model
Tested versions:

2.1.20 ✅ works
2.1.23 ✅ works
2.1.25 ❌ broken
2.1.26 ❌ broken
2.1.27 ❌ broken
2.1.28❌ broken
2.1.29 ❌ broken
2.1.30 ❌ broken
2.1.21 ❌ broken

Tried workaround: Did not work
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1

robert-chis-ciure · 5 months ago

Any update on this? It's been over a week.

I'm a Max subscriber paying $200+/month, and Claude Code has been completely unusable since v2.1.23. I've now gone through v2.1.24, 2.1.25, 2.1.27, 2.1.31, and now 2.1.32 — _every single version is broken_.

Current error on 2.1.32:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system_2.cache_control.ephemeral.scope: Extra inputs are not permitted"}}

Opus 4.6 launched today, and I can't use it. To use Opus 4.5, I must downgrade to v2.1.23, which defeats the purpose of paying for access to the latest models. I'm frustrated. Less than a month ago, I migrated from Codex and was thrilled with the Claude Code experience and capabilities.

@anthropic / @claude-code-team — can we please get an official response? Even just an ETA or acknowledgment that this is being worked on?

The "just downgrade" workaround is unacceptable for paying customers who need access to flagship models (e.g., for scientific research). This is a critical regression affecting multiple users, and there's been almost radio silence for a week (thanks, @szwang , for looking into it!).

I've also filed a support ticket. Happy to provide logs, environment details, or whatever else is needed to debug this.

robert-chis-ciure · 5 months ago
Any update on this? It's been over a week. I'm a Max subscriber paying $200+/month, and Claude Code has been completely unusable since v2.1.23. I've now gone through v2.1.24, 2.1.25, 2.1.27, 2.1.31, and now 2.1.32 — _every single version is broken_. Current error on 2.1.32: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system_2.cache_control.ephemeral.scope: Extra inputs are not permitted"}} Opus 4.6 launched today, and I can't use it. To use Opus 4.5, I must downgrade to v2.1.23, which defeats the purpose of paying for access to the latest models. I'm frustrated. Less than a month ago, I migrated from Codex and was thrilled with the Claude Code experience and capabilities. @Anthropic / @claude-code-team — can we please get an official response? Even just an ETA or acknowledgment that this is being worked on? The "just downgrade" workaround is unacceptable for paying customers who need access to flagship models (e.g., for scientific research). This is a critical regression affecting multiple users, and there's been almost radio silence for a week (thanks, @szwang , for looking into it!). I've also filed a support ticket. Happy to provide logs, environment details, or whatever else is needed to debug this.
robert-chis-ciure · 5 months ago

Update (Feb 6, 2026): I found a reliable workaround for Max/direct Anthropic users still hitting:

API Error: 400 ... system.2.cache_control.ephemeral.scope: Extra inputs are not permitted

Environment:

  • macOS (Apple Silicon)
  • Claude Code 2.1.32
  • Claude Max subscription (direct Anthropic path)

Important:

  • Again, CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 did not fix this path for me.

Working workaround:

export DISABLE_PROMPT_CACHING=1
claude -p "hi"

Persist across terminals:

echo 'export DISABLE_PROMPT_CACHING=1' >> ~/.zshrc
source ~/.zshrc

Verification after applying workaround:

  • claude -p "hi" returns normal output (no 400).
  • Interactive claude sessions work.
  • New terminal session still works.
  • I ran a second, more comprehensive prompt successfully (no errors).

Likely cause direction:

  • Prompt-caching request path appears to include cache_control.ephemeral.scope, which this backend path rejects.

Request:

  • Please provide an official fix/ETA for Max/direct Anthropic users so prompt caching can remain enabled without breaking requests.

I hope this helps other users who encountered this error.

szwang · 5 months ago

@robert-chis-ciure I'm so sorry for the lack of response on my end. It's completely unacceptable and I have set up better alerting on future tags on Github issues.

I believe we've found the cause, and will keep you posted on release status.

To confirm, are you using a gateway or proxy at all? Are you always setting ANTHROPIC_DISABLE_EXPERIMENTAL_BETAS?

Thank you so much for finding the workaround and pushing on this.

ilaikim99 · 4 months ago

Claude Code v2.1.21+ added a context_management parameter that some API backends (Vertex AI, older Bedrock, LiteLLM) reject with 400. One env var disables it for direct Anthropic users; LiteLLM has a drop_params config option. Both fixes here: https://cacheoverflow.dev/blog/pgOuyFOA

varadhvi · 4 months ago

Something similar has popped up again in the latest version [claude-code 2.1.69]. and previous workarounds are not working!

API Error: 400 {"error":{"message":"{\"message\":\"tools.0.custom.defer_loading: Extra inputs are not permitted\"}. Received Model
Group=claude-model\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}

tplass-ias · 4 months ago

@varadhvi I set ENABLE_TOOL_SEARCH=false to fix this one. It wasn't mentioned in the release notes, but I guess tool search was toggled to enabled by default, but not all backend providers/routers support the api schema yet

varadhvi · 4 months ago

Thank you. Trying now. It was working fine till the [claude-code 2.1.63], we are using litellm gateway routing to bedrock as the backend.

varadhvi · 4 months ago

@szwang can we have a permanent fix pls?

JimSander-uniphore · 4 months ago

Came here to report the same, was working fine today until an auto-update to 2.1.69
Tried clearing the Cache files, and all the usual reloads.

Reverted to 2.1.68 and working again. Curious about theENABLE_TOOL_SEARCH=false; might test that if I have time.

Environment

  • macOS 14+ (Darwin 25.2.0)
  • VSCode latest
  • Claude extension: (2.1.69) (broken), 2.1.68 (working)
  • Claude CLI: present (2.1.69)
wnma3mz · 4 months ago

The same problem. I reverted to version 2.1.58 to resume my work.

JimSander-uniphore · 4 months ago
The same problem. I reverted to version 2.1.58 to resume my work.

Confirmed that exporting this in your parent session works to.  I'm back to 2.1.69 and no issues.
export ENABLE_TOOL_SEARCH=0

szwang · 4 months ago

Ack, thank you for the reports. Does this work with the newest versions?

We are working on longer term solution to accomodating Bedrock, Vertex, and proxies like litellm.

github-actions[bot] · 3 months ago

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.