400 error: messages.content.type invalid value when using third-party API proxy (Volcengine/DeepSeek)

Resolved 💬 2 comments Opened Jun 20, 2026 by EANz0923 Closed Jun 24, 2026

Describe the bug

When using Claude Code with a third-party API proxy (Volcengine Ark), the session frequently throws:

API Error: 400 The parameter messages.content.type specified in the request are not valid: invalid value

This causes the entire session to freeze/hang, requiring a restart.

Environment

  • Claude Code version: 2.1.183 (npm global install)
  • OS: Windows 11 Pro (build 22000)
  • Shell: bash (Git Bash)
  • Node: v24.3.0

API Proxy Config

  • ANTHROPIC_BASE_URL=https://ark.cn-beijing.volces.com/api/coding
  • ANTHROPIC_MODEL=deepseek-v4-pro

Steps to reproduce

  1. Configure Claude Code to use Volcengine Ark as the API endpoint
  2. Set model to deepseek-v4-pro
  3. Run normal Claude Code operations
  4. The error occurs intermittently during normal usage, then the session becomes unresponsive

Expected behavior

Claude Code should either:

  • Gracefully handle 400 errors from third-party proxies (retry, fallback, or clean error message)
  • Not send message formats that are incompatible with the configured endpoint

Actual behavior

The session freezes completely after the error, requiring a process kill and restart.

Additional context

This appears to be a compatibility issue between the message format Claude Code sends and what Volcengine's Anthropic-compatible API accepts. The messages.content.type field likely contains a value that Volcengine's implementation doesn't recognize.

This has been happening across many sessions (seen in 10+ session log files).

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗