Claude Code “Extra Inputs Are Not Permitted” Error With a Proxy or LiteLLM

Claude Code “Extra Inputs Are Not Permitted” Error With a Proxy or LiteLLM

The Claude Code extra inputs are not permitted error means your request carried a field that the server on the other end doesn’t accept. Behind a proxy or an LLM gateway such as LiteLLM, the usual reason is that a preview field arrived without the header that switches it on. Your prompt and your project are fine.

Read the word just before the colon. If it’s context_management or defer_loading, run claude update, because newer versions resend the request without that field. If that isn’t enough, set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 before you start Claude Code.

That switch doesn’t cover every field. For output_config, set CLAUDE_CODE_EFFORT_LEVEL=auto. For thinking, set CLAUDE_CODE_DISABLE_THINKING=1.

Browse all our Claude Code tutorials for more fixes and how-tos.

Tested with Claude Code v2.1.330 on macOS on November 22, 2026. The requests went to a small stand-in gateway on the same computer, set to refuse one field at a time with the exact error text. LiteLLM itself wasn’t part of the test, and the gateway-side advice follows Anthropic’s official docs.

Quick Summary

Field in your errorWhat we saw on v2.1.330Fix
context_managementRecovered by itself on the second requestUpdate to v2.1.304 or later
defer_loadingRecovered by itself on the fourth requestUpdate to v2.1.305 or later
output_config.effortRecovered by itself on the second requestUpdate
output_configError stayed, even with betas offCLAUDE_CODE_EFFORT_LEVEL=auto
thinkingError stayed, even with betas offCLAUDE_CODE_DISABLE_THINKING=1
A field you addedError stayed, even with betas offRemove it from CLAUDE_CODE_EXTRA_BODY
No field namedDepends on which field was refusedTurn experimental betas off

What “Extra Inputs Are Not Permitted” Means

The message starts with a 400, so the server understood the connection but rejected the content. The name in front tells you which part it didn’t want. Here it is inside a session:

Claude Code session showing API Error: 400 output_config: Extra inputs are not permitted after a short prompt
The name before the colon is the field that was refused.

Why a proxy or LiteLLM triggers it

Claude Code uses some features that are still in preview. Many of them come as a pair: a value in the anthropic-beta header and a matching field in the request body. Both halves have to reach the server.

The docs name two ways this breaks. A gateway can forward the body but drop the header, or it can pass an Anthropic-style body to a service with different rules, such as Amazon Bedrock.

Diagram of three request paths: header and field forwarded together are accepted, a dropped header or a different upstream ends in a 400 error
The same request works or fails depending on what the gateway does with it.

Claude Code can’t see past your gateway. When you set ANTHROPIC_BASE_URL, the docs say it treats the gateway as the Claude API and sends the full set of fields, wherever the request goes next.

The fix depends on the field, so read the name before you change any setting.

Is this the same as “invalid beta flag”?

It’s the other half of the same problem. There the server refuses the header value, and here it refuses the body field. If your message says “invalid beta flag,” use our Bedrock beta flag guide.

How to Fix Claude Code Extra Inputs Are Not Permitted

Decision diagram matching each field in the extra inputs are not permitted error to a fix: update, effort level auto, disable thinking, check extra body, or turn experimental betas off
Find your field on the left, then use the fix on the right.

Step 1: Confirm that you’re going through a gateway

Type /status in a session. A line called Anthropic base URL means your requests go to that address instead of straight to Anthropic.

Claude Code /status screen with Auth token ANTHROPIC_AUTH_TOKEN and an Anthropic base URL pointing to a local address
Our stand-in gateway’s address shows up here. Yours will be your company’s or your LiteLLM address.

Is the line missing even though you set the variable? Then it didn’t reach this session. Our environment variables guide explains where to put them.

Step 2: Update Claude Code

claude update
claude --version

The error reference gives two version numbers. Claude Code handles a refused context_management from v2.1.304, and a refused defer_loading or tool_reference from v2.1.305.

Claude Code error reference for Extra inputs are not permitted, with the advice to update to v2.1.304 or later highlighted
The official advice for the most common version of this error.

We checked that on v2.1.330. Our gateway refused context_management, and Claude Code quietly sent the request again without it. The gwlog command below is our own script that prints what the gateway received.

Gateway log showing request 1 refused for context_management and request 2 accepted without that field, while Claude Code prints ready
One refusal, one retry, and no error on screen.

Tool search took longer. Claude Code tried three times before it dropped defer_loading, and then it loaded its tools upfront, so the count went from 12 to 22.

Gateway log showing three requests refused for tools.10.custom.defer_loading and a fourth accepted with 22 tools and no defer_loading
The fourth request got through, without tool search.

Step 3: Turn experimental betas off

export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
claude

This is the docs’ fallback. It stops Claude Code from sending the preview fields at all, so there’s nothing left to refuse. To keep it on, add it to a settings file (see settings.json locations):

{
  "env": {
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
  }
}

We tried the settings file version in a project’s .claude/settings.json, and it worked the same way. Our gateway’s log showed no context_management, no defer_loading, and three beta values instead of eight.

You do give something up. MCP tool search turns off, so every MCP tool loads at the start and takes up context.

Step 4: Fix a refused output_config

This one surprised us. The switch from Step 3 leaves the effort setting in place, so an error that names output_config came straight back. Telling Claude Code to send no effort level cleared it:

export CLAUDE_CODE_EFFORT_LEVEL=auto
Terminal showing output_config Extra inputs are not permitted with and without experimental betas disabled, then a reply after setting CLAUDE_CODE_EFFORT_LEVEL to auto
Only the effort setting made the difference here. It also worked without the betas switch.

With auto, the API picks its own default effort for the model. A fixed level such as low didn’t help, because the field was still sent.

Wording matters too. When our gateway said output_config.effort instead of just output_config, Claude Code fixed it without any setting.

The same field can also carry a structured output format. If the message points at output_config.format, the docs offer CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS=1 on v2.1.288 or later, which removes only that part.

Step 5: Fix a refused thinking field

The thinking field has no beta header, so turning betas off doesn’t remove it. This setting does, and the docs describe it as a compatibility option for proxies and gateways:

export CLAUDE_CODE_DISABLE_THINKING=1
Terminal showing thinking Extra inputs are not permitted with experimental betas disabled, then a reply after setting CLAUDE_CODE_DISABLE_THINKING to 1
Betas off didn’t help. Leaving out the thinking field did.

We also tried MAX_THINKING_TOKENS=0 with Opus 5.5, and the error stayed. The docs explain why: thinking can’t be turned off on that model this way.

Step 6: Remove a field you added yourself

CLAUDE_CODE_EXTRA_BODY merges your own JSON into each request. It’s handy for provider settings, but a strict server refuses any name it doesn’t know. The betas switch leaves your own fields alone.

Terminal showing zz_custom Extra inputs are not permitted after setting CLAUDE_CODE_EXTRA_BODY, then a reply after unsetting it
We added a made-up field on purpose. Removing it fixed the request.

When the Gateway Hides the Real Error

Claude Code decides how to recover by reading the error text. The docs warn that a gateway that wraps errors in its own words breaks that recovery, even if the status code is still 400.

Claude Code gateway docs explaining that retry logic matches on the upstream error wording, so error bodies should be forwarded unmodified
Why your gateway should pass error messages through untouched.

We refused context_management again, but this time with the text “Request rejected by gateway policy.” Claude Code tried six times with different changes, kept sending the refused field, and gave up.

Terminal showing API Error 400 Request rejected by gateway policy, then a reply after disabling experimental betas, and a log of six refused requests and one accepted
Without the field’s name, six tries failed. Turning betas off worked on the first try.

So if your 400 shows vague wording, ask for the original message from the gateway’s logs. Our error 400 guide covers the other causes of that code.

What to Change on LiteLLM or Your Gateway

Anthropic’s docs name LiteLLM as one example of an Anthropic-compatible gateway, but they say Anthropic doesn’t endorse, maintain or audit third-party products. Use your gateway’s own manual for the setting names. These are the goals to aim for:

  1. Forward the anthropic-beta and anthropic-version headers exactly as they arrive.
  2. Don’t keep an allowlist of beta values, because the set changes with Claude Code releases.
  3. Pass request body fields through without removing or rewriting any, when the upstream is Anthropic-format.
  4. Return upstream error bodies unchanged.
  5. Keep the gateway itself updated. The docs point out that a gateway which falls behind breaks newer features.

If your gateway sends requests to Bedrock or Google Cloud

Here the two sides speak different formats, and the docs say bridging them is the gateway’s job. If your gateway also offers the provider’s own format, you can skip that problem. This is the Bedrock version from the docs:

unset ANTHROPIC_BASE_URL
export ANTHROPIC_BEDROCK_BASE_URL=https://llm-gateway.example.com/bedrock
export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1
export CLAUDE_CODE_USE_BEDROCK=1

On that route, Claude Code sends only the fields Bedrock accepts. Google Cloud’s Agent Platform has matching settings, ANTHROPIC_VERTEX_BASE_URL and CLAUDE_CODE_USE_VERTEX=1. The gateway connection docs list each block in full.

If you use a custom model name

Gateways often rename models. With a name Claude Code doesn’t recognize, the docs say it sends everything current Claude models accept, which an older model behind that name may refuse.

We set the model to my-claude-alias and saw the thinking, effort and context_management fields all go out. The docs suggest a modelOverrides entry that ties the alias to the real model. If the name itself is refused, see the selected model error.

What the Betas Switch Leaves In

It helps to know what CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 doesn’t touch, so you don’t wait on it for the wrong field.

Claude Code docs listing what the disable experimental betas variable leaves in place, including effort, adaptive thinking and system messages
The official list of what stays in your requests.
Removed by the switchStays in the request
context_managementoutput_config.effort
Tool fields such as strict and defer_loadingthinking
output_config.format and output_config.task_budgetSystem messages inside the conversation
MCP tool searchAnything from ANTHROPIC_BETAS or CLAUDE_CODE_EXTRA_BODY

Try It Yourself

First, list the variables that shape your requests. This prints names only, so no keys show up:

env | grep -E '^(ANTHROPIC|CLAUDE_CODE|MAX_THINKING)' | cut -d= -f1 | sort

Next, try these three commands one at a time. Each setting applies to that single run, so nothing is saved:

claude -p "Reply with the word ready."
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 claude -p "Reply with the word ready."
CLAUDE_CODE_EFFORT_LEVEL=auto claude -p "Reply with the word ready."

The first one that answers tells you which group the refused field belongs to. If none of them does, try CLAUDE_CODE_DISABLE_THINKING=1 the same way. The commands use Mac and Linux syntax.

Common Mistakes

  • Letting a gateway strip headers it doesn’t know. The body field then arrives alone and gets refused.
  • Expecting the betas switch to fix output_config or thinking.
  • Setting a variable in one terminal while Claude Code is already running in another.
  • Reinstalling Claude Code or signing in again. The error is about the request, so neither one changes it.
  • Leaving an old CLAUDE_CODE_EXTRA_BODY value in a settings file after a test.

Pro Tips

  • Send your gateway team the gateway compatibility guide. It lists what to forward and what breaks when a piece goes missing.
  • Copy the whole error line before you ask for help. The field name is the most useful part.
  • Remove your workaround after a gateway update and test again, so you get tool search and effort levels back.
  • If requests don’t reach the gateway at all, start with corporate proxy setup instead.

Cheat Sheet

Cheat sheet for the Claude Code extra inputs are not permitted error: first checks, beta fields, settings for other fields, and what to ask your gateway team
Keep this card next to your gateway settings.

Frequently Asked Questions

Is this error a bug in Claude Code?

Usually it’s a mismatch between what Claude Code sends and what your gateway or its upstream accepts. Newer versions recover from several of these on their own, so updating is still the best first step.

Can I see this error without a proxy or gateway?

It has happened. The docs say that before v2.1.302 the error could name diagnostics when an open session moved from the Anthropic API to Bedrock or Google Cloud without a restart. Update, or run /clear on those older versions.

Why does it say tools.10.custom.defer_loading?

The number is the tool’s position in the request, and defer_loading is the refused field. It belongs to tool search, so update Claude Code or set ENABLE_TOOL_SEARCH=false. With that setting, our gateway received no defer_loading field at all.

Does turning off experimental betas make Claude worse?

The model stays the same. You lose preview features such as context management and MCP tool search, so long sessions with many MCP tools will use more context.

Do I need to restart Claude Code after changing these settings?

Yes. Set the variable first, then start Claude Code from that same terminal. For other messages, check our list of common errors.

Conclusion

The Claude Code extra inputs are not permitted error is a message about one field, and the field’s name picks the fix. Update first, then use CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 for preview fields, CLAUDE_CODE_EFFORT_LEVEL=auto for output_config, and CLAUDE_CODE_DISABLE_THINKING=1 for thinking. The lasting cure is a gateway that forwards headers, fields and error messages unchanged, and our overview of Claude AI is a good next read if you’re choosing which models to put behind it.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top