The API returns a 400 error - Claude Code
Quick fix
Upgrade CC Switch to v3.16.1 for the 400 caused by MiMo missing reasoning_content; on Github Copilot, check the API format and proxy config.
Symptom
Section titled “Symptom”API 返回 400 错误The API returns a 400 error
A 400 on a request proxied through CC Switch in Claude Code comes mainly from two mechanisms. First, the Xiaomi MiMo model requires the reasoning_content field to be sent back in a multi-turn conversation whose history contains tool calls; Claude Code does not support that field natively and drops it, and early CC Switch passed the request straight through, so the next request lacked the field and was rejected. Second, on the Github Copilot provider, the API format (OpenAI-Response versus Anthropic native) does not match the proxy settings, or a token refresh fails, and the request fails.
Upgrade CC Switch to v3.16.1 or newer. That version added caching and completion of reasoning_content on the pass-through path, which resolves the MiMo 400.
On the Github Copilot provider, try switching the API format in CC Switch settings (OpenAI-Response or Anthropic native) and make sure the local proxy is on.
If the Copilot problem persists, try logging in to the Copilot account again, or uninstall CC Switch, delete the config directory (~/.cc-switch on macOS), and reinstall.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Why does configuring MiMo directly in Claude Code also error, when the Xiaomi announcement does not mention Claude Code?
- Claude Code connecting to the official Anthropic API natively does not hit this, because the Anthropic API has no reasoning_content field. The constraint is only triggered when proxying through CC Switch to the MiMo Anthropic-compatible endpoint.
- The Github Copilot test model passes but real use reports Error 400. How do I investigate?
- Check the API format setting and try logging in to the Copilot account again. To investigate further, look at the CC Switch log (Windows: %APPDATA%\com.farion.ccswitch\logs\cc-switch.log, macOS: ~/Library/Application Support/com.farion.ccswitch/logs/cc-switch.log, Linux: ~/.config/com.farion.ccswitch/logs/cc-switch.log).
Related problems
Section titled “Related problems”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.