Skip to content

Gateway /v1/models returned an unexpected body: Claude Code

Quick fix

No verified solution is available; the local proxy must return an Anthropic data model-list format to Claude Code.

Error output
Gateway /v1/models returned an unexpected body. The connection test needs
at least one model — add entries under Models to skip discovery, or fix
the provider's model list endpoint. (httpStatus: 200)

In the reported environment, Claude Code accessed the Claude slot through the CC Switch local proxy. The upstream self-hosted gateway's `GET /v1/models` returned a Codex/ChatGPT-style `{"models":[{"slug":...}]}` response, which the local proxy passed through unchanged. Claude Code expects Anthropic-style `{"data":[{"id":...}]}`, so it could not parse any models and reported an error even with HTTP 200.

`POST /v1/messages` converted correctly and completed conversations in this report; the problem only affects model discovery. Converting `/v1/models` to Anthropic format for the target application was proposed by the reporter, but the original issue remains open and has no verified solution.

  1. The original issue does not provide a verified solution. Follow the source issue for updates on converting the `/v1/models` response format in the CC Switch local proxy for the Claude slot.

ToolClaude Code
Version3.20.1(受影响报告环境)
PlatformsWindows

(No FAQ yet)

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.