[BUG] API Error: 400 messages: text content blocks must be non-empty
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I keep getting this error now for last two sessions. I tried logging out, clear memory etc with no avail.
API Error
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.120.content.1.text: cache_control cannot be set for empty text blocks"},"request_id":"req_011CakA42sRuCfEnvT2wUMVq"}
API Error
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CakAExpA6ZJErbrJqbtXm"}
What Should Happen?
While requesting follow up actions.
Error Messages/Logs
API Error
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.120.content.1.text: cache_control cannot be set for empty text blocks"},"request_id":"req_011CakA42sRuCfEnvT2wUMVq"}
?
API Error
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CakAExpA6ZJErbrJqbtXm"}
Steps to Reproduce
create a session.
Continue working on claude code. While submitting new request I am getting these errors.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v2.0.73+
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗