Skip to content

The user sent an empty message. - Claude Code

Quick fix

Set Kimi API format in cc-switch to OpenAI chat completions and enable proxy, or export history and rebuild the session.

Error output
The user sent an empty message.

In the Claude Code agent loop, Kimi repeatedly treats input as an empty message. This is usually caused by a mismatch between the cc-switch API format and the provider, producing empty-content requests during protocol conversion or forwarding. For OpenAI-compatible providers such as Kimi, using the native Anthropic Messages format can cause parsing errors. With third-party proxies such as OpenRouter and ANTHROPIC_AUTH_TOKEN configured, an incompatible format may also cause API Error: Cannot read properties of undefined (reading 'map').

  1. In the cc-switch provider configuration, change the API format to OpenAI chat completions and enable the local proxy.

  2. If you are stuck in an empty-message loop, stop the current loop, export the chat history with /export, and start a new session using the history as a temporary workaround.

ToolClaude Code
Version2.1.223
PlatformsWindows
Does cc-switch have verbose or debug logs showing the actual forwarded request body?
The issues do not currently provide a way to enable verbose logs. Bypass cc-switch and connect directly to the Kimi endpoint for a comparison test to isolate the problem.
What do the custom endpoint, API format, authentication fields, and model mapping do in the configuration?
The custom endpoint overrides the request address. The API format selects the native Anthropic format or an OpenAI-compatible format. Authentication fields map to request header authentication, such as ANTHROPIC_AUTH_TOKEN. Model mapping maps Claude default model names to third-party model names.

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.