Invalid API Request: Empty Message Content Violation

Resolved 💬 2 comments Opened Jul 25, 2025 by ayyzad Closed Jul 25, 2025

Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_err
or","message":"messages.11: all messages must have non-empty
content except for the optional final assistant message"}}

Environment Info

  • Platform: darwin
  • Terminal: windsurf
  • Version: 1.0.60
  • Feedback ID: 82cbf6bf-1d56-4d9e-8bac-2c484cf7e49a

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.11: all messages must have non-empty content except for the optional final assistant message\"}}\n    at i4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1317:6428)\n    at BP.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1334:2101)\n    at BP.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1334:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async ZvB.TG1.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:14365)\n    at async TG1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2345:5642)\n    at async ZvB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:14216)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:9271\n    at async OL0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:1690)\n    at async de (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:9241)","timestamp":"2025-07-25T15:24:46.434Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.11: all messages must have non-empty content except for the optional final assistant message\"}}\n    at i4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1317:6428)\n    at BP.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1334:2101)\n    at BP.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1334:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async ZvB.TG1.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:14365)\n    at async TG1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2345:5642)\n    at async ZvB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:14216)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:9271\n    at async OL0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:1690)\n    at async de (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:9241)","timestamp":"2025-07-25T15:25:39.115Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.11: all messages must have non-empty content except for the optional final assistant message\"}}\n    at i4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1317:6428)\n    at BP.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1334:2101)\n    at BP.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1334:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async ZvB.TG1.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:14365)\n    at async TG1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2345:5642)\n    at async ZvB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:14216)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:9271\n    at async OL0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:1690)\n    at async de (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2902:9241)","timestamp":"2025-07-25T15:34:42.466Z"}]

View original on GitHub ↗

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