Skip to content

400 model provider error Claude Code plugin

Quick fix

Add the environment variables required by the current provider to VS Code’s claudeCode.environmentVariables setting so the plugin can read them.

Error output
Error: 400 模型提供方错误。
English translation

Error: 400 model provider error.

The issue report says that after the Claude Code VS Code plugin was upgraded to 2.1.156, the terminal CLI could still read the environment variables in ~/.claude/settings.json, but the VS Code plugin launched from the Dock returned 400. The reporter suspected that the newer plugin’s bundled Anthropic SDK reads ANTHROPIC_BASE_URL directly from process.env, while VS Code launched as a GUI has no such variables. Therefore, updating only ~/.claude/settings.json was insufficient. The maintainer said the issue was on the client or provider side and CC Switch could not fix it at the root cause.

  1. Manually add the environment variables used by the current provider to claudeCode.environmentVariables in VS Code. The issue gives the VS Code user settings file path as ~/Library/Application Support/Code/User/settings.json; the reporter said the plugin worked again after adding them.

ToolClaude Code VS Code 插件
Version2.1.156(报告出现问题的插件版本)
PlatformsmacOS
Why does the VS Code plugin return 400 when claude works in the terminal?
The issue report says the terminal CLI could read ~/.claude/settings.json, while the VS Code plugin launched from the Dock lacked the required environment variables. The reporter said the plugin worked again after adding those variables to claudeCode.environmentVariables.
Can CC Switch fix this issue at the root cause?
The maintainer said the issue was on the client or provider side and CC Switch could not fix it at the root cause.

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.