[BUG] Invalid API Request: Empty Message Content Violation
Resolved 💬 2 comments Opened Jun 17, 2025 by jhoe123 Closed Nov 30, 2025
Bug Description
API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.45: all messages
must have non-empty content except for the optional final assistant message"}}
Environment Info
- Platform: linux
- Terminal: wsl-Ubuntu-20.04
- Version: 1.0.25
- Feedback ID: 1b8c652b-d14a-4e2e-9dc5-bbd98aaec7f4
Errors
[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.45: all messages must have non-empty content except for the optional final assistant message\"}}\n at h6.generate (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1300:12578)\n at Sw.makeStatusError (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:2082)\n at Sw.makeRequest (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async GE2.E11.showErrors (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:22049)\n at async E11 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:12215)\n at async GE2 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:21895)\n at async file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17115\n at async ft1 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:5163)\n at async Xu (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17085)","timestamp":"2025-06-17T13:03:59.657Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.45: all messages must have non-empty content except for the optional final assistant message\"}}\n at h6.generate (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1300:12578)\n at Sw.makeStatusError (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:2082)\n at Sw.makeRequest (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async GE2.E11.showErrors (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:22049)\n at async E11 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:12215)\n at async GE2 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:21895)\n at async file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17115\n at async ft1 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:5163)\n at async Xu (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17085)","timestamp":"2025-06-17T13:04:59.929Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.45: all messages must have non-empty content except for the optional final assistant message\"}}\n at h6.generate (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1300:12578)\n at Sw.makeStatusError (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:2082)\n at Sw.makeRequest (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async GE2.E11.showErrors (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:22049)\n at async E11 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:12215)\n at async GE2 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:21895)\n at async file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17115\n at async ft1 (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:5163)\n at async Xu (file:///home/jhoemar/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17085)","timestamp":"2025-06-17T13:08:41.106Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"
Note: Error logs were truncated.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗