Claude Code sends `thinking: {type: adaptive}` to custom ANTHROPIC_BASE_URL models — gateways 400 / return empty / hang ("not responding")

Open 💬 2 comments Opened Jun 15, 2026 by fawang

Summary. At effortLevel: high/xhigh, Claude Code sends thinking: {type: adaptive} on every request — including to unrecognized custom model ids routed via ANTHROPIC_BASE_URL. Many non-Anthropic models served behind an OpenAI/Anthropic-compatible (LiteLLM-style) gateway cannot handle that parameter, and the failure mode is silent: the session appears to hang ("not responding"), returns empty output, or errors HTTP 400.

Environment. Claude Code 2.1.177 · macOS · custom ANTHROPIC_BASE_URL → LiteLLM-based gateway that speaks the Anthropic Messages API · effortLevel: xhigh.

Repro.

  1. ANTHROPIC_BASE_URL=<gateway>, ANTHROPIC_AUTH_TOKEN=<key>, ANTHROPIC_MODEL=<custom non-Anthropic id>, effortLevel: xhigh.
  2. Start a session (or /resume one) and send any prompt.
  3. Session hangs with no streamed output / never completes.

Evidence (request intercept). Logging CC's outgoing /v1/messages shows it sends "thinking": {"type": "adaptive"} to the custom id. A per-model sweep (same prompt, with vs. without the param) through one such gateway:

| Model family | with thinking:adaptive | without |
|---|---|---|
| a DeepSeek reasoning model | hangs minutes, no output | responds |
| a Nemotron model | empty response | responds |
| Claude Haiku (via gateway) | HTTP 400 | responds |
| GLM / Gemini (via gateway) | tolerated (slow) | responds |

Workaround. CLAUDE_CODE_DISABLE_THINKING=1 omits the thinking param and resolves all of the above, while keeping cache_control (prompt caching still works). Note: CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 does not help — intercept confirms it still sends thinking: {type: adaptive}.

Ask. Either (a) don't send adaptive thinking to unrecognized custom model ids by default (they can't be assumed to support the Anthropic thinking schema), or (b) make CLAUDE_CODE_DISABLE_THINKING discoverable / per-model — gateways commonly reject the param, and the current default turns a working model into a silent hang.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗