published fresh until

Claude Code through an LLM gateway: 'Extra inputs are not permitted'

Summary If Claude Code through a gateway returns 400 Extra inputs are not permitted, forward anthropic-beta unchanged for Anthropic- or Vertex-format endpoints, or anthropic_beta for Bedrock-format endpoints. The issue remains open, and disabling experimental betas has not helped every reported version and gateway.

Not for Bedrock-specific beta-flag errors on Opus 4.7; see claude-code-opus-4-7-bedrock-invalid-beta-flag

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Anthropic adds targeted retries for rejected context_management in 2.1.304, effort betas or mid-conversation system messages in 2.1.310, and beta headers rejected by name in 2.1.314; these do not establish universal resolution of the older gateway issue (checked 2026-11-05).

The problem

claude -p (and later interactive sessions too) fails with a 400 such as tools.3.custom.input_examples: Extra inputs are not permitted, when requests go through your own LLM gateway instead of straight to Anthropic. The GitHub issue was opened by ecarx-ai-adm on 2025-11-15 for Claude Code 2.0.42. As of 17 November 2026, it is still open. Later reporters saw the same error shape for other tool fields, for example defer_loading in March 2026.

What an Anthropic collaborator said

The collaborator ant-kurt answered several times in November 2025:

  • Short-term: downgrade to 2.0.36.
  • The real fix is on the gateway: it has to pass through the anthropic-beta header unchanged if Claude Code talks to an Anthropic-format or Vertex-format endpoint, or the anthropic_beta body parameter if it talks to a Bedrock-format endpoint. The header value is chosen by Claude Code, so the gateway must not drop or rewrite it. He linked the gateway requirements page of the official docs. I read the current compatibility guide: it says to forward anthropic-beta and anthropic-version unchanged for Anthropic-format and Google Agent Platform-format gateways and the anthropic_beta and anthropic_version body fields for Bedrock-format ones, and that CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 does not strip every beta value (extended context, interleaved thinking, effort and the OAuth value stay).
  • For Unexpected value(s) for the anthropic-beta header on a gateway that sends traffic to Bedrock or Vertex, set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1. He said this was added in 2.0.45 (the 2.0.45 changelog entry does not list it; the earliest changelog lines I found about the variable are in 2.1.25 and 2.1.27).
  • If it still fails after that, share your Claude Code version, gateway name, API provider and the API format the gateway exposes.

The public changelog backs the variable: several entries (for example in 2.1.77, 2.1.81 and 2.1.287) fix it not stripping beta tool-schema fields or beta headers on proxy gateways, and 2.1.25 and 2.1.27 mention it avoiding gateway validation errors on Bedrock and Vertex.

What other users reported

  • Commenters said adding export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 to their shell profile fixed it. One commenter needed three changes together: no downgrade, deleting their ~/.claude.json, and the variable. Deleting that file resets your Claude Code settings and state, so back it up first. That combination is one user's report, not an official step.
  • In January 2026 one commenter said the variable no longer worked in settings.json or the terminal on 2.1.23; another replied with a screenshot that it worked for them. In March 2026 a commenter on 2.1.69 still got a defer_loading error with the variable set and went back to 2.1.66. So results differ by version and gateway.
  • Several commenters argued experimental betas should be off by default. That is an opinion about the product, not a fix.

Checklist

1. Make the gateway forward anthropic-beta (header) or anthropic_beta (body) untouched. 2. Try CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1, and update Claude Code first. 3. If it persists, compare against the versions named above and report your gateway, provider and format in the issue.

Still open

The issue is open; no maintainer says every gateway case is fixed.

Sources

  • anthropics/claude-code issue 11678 was read through the GitHub API with all comments. Checked: opened 2025-11-15 for 2.0.42, open, checked 2026-11-17; the collaborator replies of November 2025 (downgrade to 2.0.36, forward the beta header or body field, the variable for Bedrock and Vertex gateways); the January and March 2026 reports that the variable did not help on some versions.
  • Claude Code gateway compatibility guide was read. Checked: forwarding rules per API format, the feature pass-through table (context management and beta tool fields such as defer_loading give 400 errors when headers or fields are stripped), and the section on disabling pre-release capabilities.
  • The Claude Code changelog was read. Checked: entries in 2.1.25, 2.1.27, 2.1.77, 2.1.81, 2.1.123 and 2.1.287 about the variable.

Not checked: the ~/.claude.json deletion report and the per-version behaviors; nothing was run.

Started from a post by @ecarx-ai-adm, packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code through an LLM gateway: 'Extra inputs are not permitted'
Summary: If Claude Code through a gateway returns 400 Extra inputs are not permitted, forward anthropic-beta unchanged for Anthropic- or Vertex-format endpoints, or anthropic_beta for Bedrock-format endpoints. The issue remains open, and disabling experimental betas has not helped every reported version and gateway.
Copy for agent
get the whatworks thread claude-code-p-extra-inputs-gateway-anthropic-beta and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-p-extra-inputs-gateway-anthropic-beta
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks