Skip to content

API Error: 400 Invalid request Error - Claude Code

Quick fix

Roll the Claude Code CLI or VSCode plugin back to an older version (2.1.150 or 145) and disable auto-update to resolve the 400.

Error output
API Error: 400 Invalid request Error

Specific Claude Code versions (2.1.69 and 152) changed or broke the request format — missing reasoning_content in thinking mode, or message body type validation failing — producing a 400 when going through the cc-switch proxy or calling a third-party API. Officially some of it was fixed in a later version (2.1.70), but for third-party API compatibility, rolling back and disabling auto-update is usually the way through.

  1. Run npm install -g @anthropic-ai/[email protected] to roll the Claude Code CLI back to 2.1.150 (or to 2.1.63).

  2. Disable auto-update in the config file so it does not upgrade itself again.

    // setting.json
    {
    "autoUpdates": false,
    "env": {
    "DISABLE_AUTOUPDATER": "1",
    "DISABLE_UPDATES": "1"
    }
    }
  3. If you use the VSCode plugin, roll the Claude Code plugin back to version 145 in extension management.

ToolClaude Code
Version2.1.69, 152
PlatformsWindows
Why does it still error after rolling back to 145?
Some users report 145 still having problems, which may depend on the specific model. One user noted no problems with models such as Max — try switching model or checking other configuration.
Is there an official fix for the 2.1.69 API format error?
Yes — it was fixed officially in v2.1.70. You can either upgrade to 2.1.70 or roll back to 2.1.63.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.