Claude Code on a third-party model: API Error 400 'type' must be in ["enabled", "disabled", "auto"]
From late July 2026 Claude Code sends its thinking setting in Anthropic's newer form, thinking: {"type": "adaptive"}, to every model, including ones it does not recognise. Hosts that implemented the Messages API against the older specification validate thinking.type against enabled, disabled and auto and reject the request. The error shows up after the first thinking block, in the middle of a tool call, and compacting the session does not help because the next request carries the same field. This entry shows what is on the wire and the three ways out.
Last verified September 18, 2026 against cc-switch issue #5897 (15 comments), cc-switch issue #3654: turn ends with thinking and no text, cc-switch issue #6221: "not a model this version of Claude Code recognizes", Anthropic docs: extended thinking · 4 min read
| Where it appears | Claude Code pointed at a non-Anthropic host through ANTHROPIC_BASE_URL, directly or through a switcher such as cc-switch |
| HTTP status | 400, in Anthropic's error envelope, shown by Claude Code as API Error: 400 … |
| Message | 'type' must be in ["enabled", "disabled", "auto"] |
| Since | Reports start on July 30, 2026, with "seems to have started today" in the thread; every affected user was on a current Claude Code build |
| Models | Reported on DeepSeek V4 Flash and V4 Pro via SenseNova and DeepSeek-format hosts; the model is not the cause |
| Can you wait it out? | No. Retrying sends the same request. Users report it as intermittent only because load-balanced hosts run mixed backend versions |
- Keep thinking, keep the host: set
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1; Claude Code then sends{"type":"enabled","budget_tokens":N}, which these hosts accept. - Thinking off:
CLAUDE_CODE_DISABLE_THINKING=1(andMAX_THINKING_TOKENS=0); nothinkingfield is sent at all. - Change host: one that accepts both forms. Ours does; three environment variables.
What the error looks like
⏺ API Error: 400 'type' must be in ["enabled", "disabled", "auto"]400 ValidationException: "thinking.type.enabled" is not supported for this model. Use "thinking.adaptive" and "output_config.effort" to control thinking behavior.The two messages are the same disagreement seen from opposite sides. The first comes from a host that knows only the older thinking forms; the second from a gateway that has moved to the newer one and now refuses the older form for current Claude models. A switcher in the middle (cc-switch, a local proxy) does not change what Claude Code sends, so it cannot fix this on its own unless it rewrites the field.
What Claude Code actually sends
{
"model": "deepseek-ai/DeepSeek-V4-Flash",
"max_tokens": 32000,
"stream": true,
"thinking": { "type": "adaptive", "display": "omitted" },
"output_config": { "effort": "..." },
"context_management": { "..." : "..." },
"system": [ { "type": "text", "text": "...", "cache_control": { "type": "ephemeral" } } ],
"tools": [ "Agent", "Bash", "Edit", "Read", "Write", "... 21 tools" ],
"messages": [ "..." ]
}We captured this with a logging proxy between Claude Code 2.1.275 and our endpoint. The thinking field is adaptive whatever the model name, output_config.effort comes with it, and the request is streamed. A user in the cc-switch thread measured the same from a SenseNova endpoint: all 92 failing requests in their proxy log were streaming ones, and direct calls to the host with type: "adaptive" reproduced the rejection.
thinking value | Who sends it | Accepted by |
|---|---|---|
{"type":"enabled","budget_tokens":N} | Older Claude Code, most SDK code, Claude Code with CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 | Anthropic (older models), DeepSeek-format hosts, this endpoint |
{"type":"adaptive"} + output_config.effort | Claude Code since about July 30, 2026, whatever the model name | Anthropic (current models), this endpoint. Rejected by hosts that validate against enabled / disabled / auto |
{"type":"disabled"} or no field | Claude Code with thinking off | Everyone |
{"type":"auto"} | Some DeepSeek-format hosts document it | Those hosts, this endpoint |
Fix 1: send the older form and keep thinking
{
"env": {
"CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING": "1"
}
}With CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 Claude Code goes back to {"type": "enabled", "budget_tokens": N}. Two users in the thread confirmed this stops the error; we confirmed the variable exists in Claude Code 2.1.275. Put it in ~/.claude/settings.json under env, or export it in the shell. If you use cc-switch, note the report that its proxy mode rewrites settings.json on restart and the block has to be added again.
Fix 2: switch thinking off
{
"env": {
"CLAUDE_CODE_DISABLE_THINKING": "1",
"MAX_THINKING_TOKENS": "0"
}
}No thinking field is sent, so nothing can be rejected. The model then answers without its reasoning phase, which is faster and cheaper for routine edits and worse for hard problems. One person in the thread objected to the trade, which is why Fix 1 is listed first.
Fix 3: a host that accepts both forms
export ANTHROPIC_BASE_URL="https://api.inferenceapis.com"
export ANTHROPIC_AUTH_TOKEN="your-key"
export ANTHROPIC_MODEL="deepseek-ai/DeepSeek-V4-Flash[1m]"
claudeOur Messages route treats enabled, adaptive and auto the same way: the model's reasoning stays on and streams back as thinking blocks. No field, or disabled, switches it off. Nothing in Claude Code needs changing. The models are DeepSeek V4 Flash, V4.1 Flash and V4 Pro, GLM 5.3 and 5.3 Flash, Kimi K2.7 Code, MiniMax M3 and GPT-OSS 120B, on GPUs in the United States, billed per token from a prepaid balance. The Claude Code guide has the full setup and what each model did in our test.
Frequently asked questions
Why did this start suddenly?
Claude Code changed what it sends, not the hosts. The thread's first report is July 30, 2026, and one user who downgraded to 2.1.153 still saw it, so the change predates that build. Anthropic's current models take the adaptive form and the client now sends it for every model name.
Does ANTHROPIC_MODEL=deepseek-v4-flash make Claude Code send the older form?
No. The captured request above was for a DeepSeek model name and still carried type "adaptive". Only the environment variables, or a proxy that rewrites the field, change it.
Is "auto" a real value?
Not in Anthropic's documentation, which lists enabled, disabled and adaptive. Some DeepSeek-format Messages endpoints accept auto, which is why it appears in their error message. We accept it and treat it as enabled.
I use cc-switch. Can it fix this for me?
In its proxy mode it could rewrite thinking.type before forwarding; as of the thread it does not, and its restart overwrote the settings.json workaround for one user. Check the project's newer releases, or set the variable in your shell where cc-switch cannot touch it.
Where Inference APIs fits
Our /v1/messages route accepts enabled, adaptive and auto and leaves the model's reasoning on for all three, so Claude Code works with its defaults. Claude Code 2.1.275 ran a full fix-the-tests task through it on eight open models on 2026-09-18; the guide has the setup and the per-model timings.
Something changed or wrong? Tell us and we will re-verify the entry.
