Troubleshooting · as of 2026-10-07

Claude Code Gateway Errors and Their Official Fixes (2026)

As of 2026-10-07, the common 400 errors Claude Code shows behind a third-party gateway or a custom ANTHROPIC_BASE_URL each have an official fix or workaround: "400 … Input tag 'advisor_20260301'" is fixed in 2.1.276 and later; if your gateway rejects structured outputs, set CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS=1, added in 2.1.288; and requests failing when a gateway rejects a beta header with a status other than 400 were fixed in 2.1.290. For "Extra inputs are not permitted", the official error reference blames a gateway that stripped the anthropic-beta header; have it forward the header unchanged. This page lists each error's exact text, cause and fix, quoting the official Claude Code changelog and gateway docs.

Updated 2026-10-08

#ANTHROPIC_BASE_URL#anthropic-beta#Extra inputs are not permitted#advisor_20260301

Four versions and headers to remember

2.1.276

Fixes the advisor_20260301 400

Per the official changelog, every request failed with "400 … Input tag 'advisor_20260301'" when ANTHROPIC_BASE_URL pointed at a proxy or gateway — a 2.1.275 regression fixed in 2.1.276, released 2026-09-18.

2.1.288

Adds CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS

Fixes session titles, memory recall and prompt hooks failing behind gateways that reject structured outputs. Setting it to 1 removes only the output_config.format field and its paired beta value; other pre-release capabilities stay on.

2.1.290

Fixes non-400 beta header rejections

Per the official changelog: fixes requests failing behind proxies and gateways that reject one of Claude Code's beta headers with a status other than 400, or together with a second beta (released 2026-10-05).

anthropic-version + anthropic-beta

Headers a gateway must forward unchanged

From the official gateway compatibility guide: forward both unchanged, and don't allowlist individual anthropic-beta values, because the set changes with Claude Code releases.

Why 400s appear once a gateway is in the path

As of 2026-10-07, Claude Code's 400 errors behind a third-party gateway have two main sources. One is client regressions — the Artifact tool schema in 2.1.265 through 2.1.267 and the advisor tool entry in 2.1.275 — which an upgrade fixes. The other is a gateway that doesn't forward beta headers together with the request body fields they pair with. The official compatibility guide says Claude Code treats an ANTHROPIC_BASE_URL gateway as an Anthropic-format endpoint and sends it the same beta headers and body fields it sends to api.anthropic.com; a gateway that strips the header while passing the body, or forwards the body to a service with a different schema, produces hard 400 errors, and only when both halves are absent together does the feature turn off quietly. The guide adds that a gateway rewriting request bodies for content inspection breaks the pairing the same way.

Since 2.1.285: custom endpoints default to 1M

The changelog entry for Claude Code 2.1.285 (released 2026-09-29) reads: "Changed sessions behind a custom ANTHROPIC_BASE_URL to use the 1M context window of models that have one (Opus 4.7+, Sonnet 5+, Fable); run /autocompact 200k if your gateway stops at 200K". In other words, models with a 1M window (Opus 4.7+, Sonnet 5+, Fable) run at 1M behind a custom endpoint, and you run /autocompact 200k when the gateway stops at 200K. The official model configuration page adds that Claude Code can't detect a lower limit that the gateway or the server behind it enforces; if your gateway rejects requests above 200K tokens, set CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000 in the environment that starts Claude Code.

Timeline (GitHub release dates)

2026-09-18

Claude Code 2.1.276 ships, fixing every request failing with "400 … Input tag 'advisor_20260301'" when ANTHROPIC_BASE_URL points at a proxy or gateway — a regression from 2.1.275, released the day before.

2026-10-02

2.1.288 ships with the new CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS; the day before, 2.1.287 made CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS also remove the structured-output format from session-title and prompt-hook requests.

2026-10-05

2.1.290 ships, fixing requests that failed when a gateway rejected a beta header with a status other than 400, or together with a second beta. As of 2026-10-07 the latest release is 2.1.292 (released 2026-10-06).

Confirmed vs not verified

Confirmed (verbatim in the official sources)

All of the following can be checked word for word in the official Claude Code changelog and docs: 2.1.276 fixes the advisor_20260301 400 (a 2.1.275 regression), and from 2.1.280, with the advisor on, Claude Code retries once without the entry after the same rejection; 2.1.287 extends CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS to the structured-output format, and 2.1.288 adds CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS; 2.1.290 fixes beta headers rejected with a non-400 status; since 2.1.285 models with a 1M window default to 1M behind custom endpoints; a gateway must forward anthropic-version (currently 2023-06-01) and anthropic-beta unchanged; and because Claude Code's recovery matches on the error wording, error response bodies should be forwarded unmodified too. Release dates come from GitHub Releases.

Not verified or not stated officially

Three questions have no official answer, so don't draw conclusions from them. First, the 2.1.290 changelog entry gives no error text and doesn't name the beta header involved. Second, which headers your gateway forwards, which fields it validates and what its context limit is depend on that gateway; the official docs don't answer for it, and Claude Code can't detect a lower limit the gateway enforces. Third, the set of capabilities Claude Code sends grows over releases, and the official advice is to test your gateway against new releases rather than pin an observed list — so this list isn't final, and this page makes no promise that any gateway, QCode included, accepts any particular beta value.

Which fix: upgrade, change the gateway, or set a variable

Upgrade Claude Code vs a stopgap variable

For client regressions, upgrade first: the tool schema 400 on 2.1.265–2.1.267 is fixed from 2.1.268, and advisor_20260301 on 2.1.275 from 2.1.276. If you can't upgrade yet, the official stopgaps are turning off the Artifact tool (CLAUDE_CODE_DISABLE_ARTIFACT=1) and setting CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1 respectively. To upgrade, the official setup page gives claude update; for an npm install, it gives npm install -g @anthropic-ai/claude-code@latest.

DISABLE_EXPERIMENTAL_BETAS vs DISABLE_STRUCTURED_OUTPUTS

CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 is broad: it removes context management and its context_management field, beta tool fields such as strict and defer_loading, the structured-output output_config.format field (2.1.287+), output_config.task_budget and MCP tool search. It does not remove the beta values for extended context, interleaved thinking and effort, nor values you add yourself through ANTHROPIC_BETAS. CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS=1 (2.1.288+) removes only the structured-output format field and its paired beta value, leaving the other pre-release capabilities on.

Error text → cause → fix, one by one

① "400 … Input tag 'advisor_20260301'" on every request → during the gradual rollout on 2.1.275, requests carry an advisor tool entry even with the advisor off, and a gateway that validates tool types rejects the whole request → upgrade to 2.1.276 or later; on 2.1.275, set CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1. With the advisor on, from 2.1.280 Claude Code retries once without the entry and leaves the advisor out for that base URL until it exits. ② "API Error: 400 ... Extra inputs are not permitted ... context_management" → a proxy or LLM gateway stripped the anthropic-beta request header, so the API rejected fields that depend on it → have the gateway forward anthropic-beta unchanged; as a fallback, set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1. Claude Code doesn't retry these 400s. ③ An "Unexpected value(s)" error for the anthropic-beta header → the gateway rejects a beta value → set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1; requests failing because the gateway rejects a beta header with a status other than 400, or together with a second beta, are fixed in 2.1.290 (the changelog gives no error text for this case); a terminal "API Error: 400" on every turn behind a gateway that rewrites error responses was fixed in 2.1.275. ④ A 400 naming output_config, often "Extra inputs are not permitted", with session titles, memory recall or prompt hooks failing → the service behind the gateway rejects structured-output fields → on 2.1.288 or later, set CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS=1, which removes only the format field; or set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 (covers this since 2.1.287), which leaves effort in place. ⑤ A 400 naming thinking or adaptive, such as "Input tag 'adaptive' found" → the model build behind the gateway doesn't accept adaptive reasoning → upgrade that model; on Opus 4.6 and Sonnet 4.6, CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 works instead. ⑥ A 400 on every request on 2.1.265–2.1.267, with the gateway rejecting a tool's input schema or its pattern in its own words → a regex in the Artifact tool's input schema that such endpoints reject → upgrade to 2.1.268 or later, or turn the Artifact tool off. ⑦ "API returned an empty or malformed response (HTTP 200)" → the gateway or an intermediate proxy returned a non-API response, often an HTML error or login page → test with a direct curl request and fix the hop that answers with something other than a Claude API response; the same error caused by a gateway labelling the non-streaming reply text/plain was fixed in 2.1.271. ⑧ A 400 stating a context limit in the gateway's own words, such as "ContextWindowExceededError" or "prompt token count of N exceeds the limit of M" → the gateway enforces a smaller window than the model's and rewrites the error, so Claude Code doesn't compact and retry automatically → run /compact to recover; to prevent it, set CLAUDE_CODE_AUTO_COMPACT_WINDOW to the gateway's limit (minimum 100,000); since 2.1.285, run /autocompact 200k if the gateway stops at 200K.

On QCode

As of 2026-10-07, the QCode docs set up Claude Code like this: ANTHROPIC_BASE_URL is https://api.qcode.cc/api (no /v1, no trailing slash), and ANTHROPIC_AUTH_TOKEN is the key starting with cr_ that you create in the console; Claude models only work on the Anthropic-protocol endpoint. The QCode troubleshooting page lists the same fixes: for the 2.1.275 "400 … Input tag 'advisor_20260301'", upgrade to 2.1.276 or later; for "Unexpected value(s) … anthropic-beta", set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1; and it advises making sure you run the latest version, since many issues are already fixed in newer releases. Start with the curl self-test from the docs: a POST to /api/v1/messages without a body that returns 400 means the path and key both work, while 401 means the key is invalid. Billing is per token; see /models for each model's price.

Frequently asked questions

How do I fix "400 … Input tag 'advisor_20260301'"?

Upgrade to Claude Code 2.1.276 or later. It's a 2.1.275 regression: during a gradual rollout, requests carried an advisor tool entry even with the advisor off, and gateways that validate tool types rejected the whole request; from 2.1.276 the entry isn't sent behind an ANTHROPIC_BASE_URL gateway unless you turn the advisor on. If you can't upgrade yet, set CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1. With the advisor on, from 2.1.280 Claude Code retries once without the entry after the same rejection, then leaves the advisor out for that base URL — with /advisor unavailable — until it exits.

Is "Extra inputs are not permitted" a gateway problem?

Usually, yes. The official error reference says a proxy or LLM gateway between Claude Code and the API stripped the anthropic-beta request header, so the API rejected fields that depend on it; the typical text is "API Error: 400 ... Extra inputs are not permitted ... context_management". The real fix is to have the gateway forward anthropic-beta unchanged; the fallback is to set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 before launching. The docs also note that some betas aren't gated by that variable, and that Claude Code doesn't retry 400s caused by context management or tool schema fields.

Which request headers does a gateway have to forward?

anthropic-version and anthropic-beta, unchanged — plus anthropic-workspace-id when the gateway fronts Claude Platform on AWS. anthropic-version is currently 2023-06-01; forward anthropic-beta verbatim and don't allowlist individual values, because the set changes with Claude Code releases. The credential travels in Authorization or x-api-key depending on which credential variable you set, and anything not marked forward-unchanged is the gateway's to consume or ignore. The docs also ask gateways to forward error response bodies unmodified, because Claude Code's automatic retries match on the error wording.

What's the difference between ANTHROPIC_BETAS and CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS?

They work in opposite directions. ANTHROPIC_BETAS is a comma-separated list of additional anthropic-beta values; per the docs, Claude Code already sends the beta headers it needs, and this variable opts into an Anthropic API beta before Claude Code adds native support. CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 strips pre-release anthropic-beta values and the body fields that pair with them, for gateways that answer with "Unexpected value(s)" or "Extra inputs are not permitted". The latter doesn't strip values you add through ANTHROPIC_BETAS, so if the gateway rejects one of those, remove it from ANTHROPIC_BETAS yourself.

My gateway only supports 200K. What do I do after 2.1.285?

Run /autocompact 200k — that's the fix the 2.1.285 changelog entry gives. From 2.1.285, models with a 1M window (Opus 4.7+, Sonnet 5+, Fable) run at 1M behind a custom ANTHROPIC_BASE_URL, and the official model configuration page says Claude Code can't detect a lower limit the gateway enforces. To apply it on every launch, set CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000 in the environment that starts Claude Code. If the gateway reports the overflow in its own words, such as ContextWindowExceededError, Claude Code won't compact and retry on its own, so run /compact by hand first.

What should I check first when I see these errors on QCode?

Check your Claude Code version and upgrade to the latest; the QCode docs also note that many issues are already fixed in newer releases. As of 2026-10-07 the latest is 2.1.292, and the official upgrade command is claude update. Then check the configuration: ANTHROPIC_BASE_URL should be https://api.qcode.cc/api (no /v1, no trailing slash), with the credential in ANTHROPIC_AUTH_TOKEN, which is sent as an Authorization: Bearer header. If "Unexpected value(s) … anthropic-beta" persists, set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 as the QCode docs say.

Sources

Version numbers and fixes: the official Claude Code changelog (CHANGELOG.md in the anthropics/claude-code repository on GitHub — the 2.1.268, 2.1.271, 2.1.275, 2.1.276, 2.1.280, 2.1.285, 2.1.287, 2.1.288 and 2.1.290 entries), with release dates (UTC) from the same repository's GitHub Releases. Causes and fixes: on code.claude.com, the troubleshooting table in "Connect Claude Code to an LLM gateway", the Claude Code gateway compatibility guide, the Error reference, and the environment variables, model configuration and Advanced setup pages. QCode setup and checks: the troubleshooting, environment variables, and endpoints and API formats pages on docs.qcode.cc. All fetched 2026-10-07.

Upgrade, then connect again

Set the base URL to https://api.qcode.cc/api and put your key in ANTHROPIC_AUTH_TOKEN — one cr_ key connects Claude Code. Billing is per token; see /models for each model's price.

Related reading

The version numbers, error text and official statements on this page were checked on 2026-10-07 against Anthropic's official changelog and docs, which take precedence; upstream changes may happen without notice. Which headers a given gateway forwards and its context limit are governed by that provider's documentation; model availability is whatever /models shows.

Try first, then decide

Not sure which tier? Start with Starter ($8.57/mo) and upgrade when you're happy — the unused value of the old plan goes back to your balance.