claude-code - 💡(How to fix) Fix [BUG] API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CaPUccwT4csuscDRoBot5"} [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53054Fetched 2026-04-25 06:13:36
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error de API API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CaPUccwT4csuscDRoBot5"}

Code Example

Error de API
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CaPUccwT4csuscDRoBot5"}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

revisar

Error de API API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CaPUWu97MRs2V5ExVeBSw"}

Turno fallido Intenta enviarlo de nuevo realiza una configuracion nueva

Error de API API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CaPUccwT4csuscDRoBot5"}

Turno fallido Intenta enviarlo de nuevo

What Should Happen?

No se

Error Messages/Logs

Error de API
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CaPUccwT4csuscDRoBot5"}

Steps to Reproduce

Envie una imagen y empezo a aparecer.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue can be resolved by ensuring that the text content blocks in the API request are not empty.

Guidance

  • Verify that the API request contains non-empty text content blocks, as indicated by the error message "messages: text content blocks must be non-empty".
  • Check the code that constructs the API request to ensure that it properly handles cases where the text content might be empty.
  • Review the documentation for the Anthropic API to confirm the requirements for text content blocks in API requests.
  • Test the API request with a non-empty text content block to confirm that the issue is resolved.

Notes

The issue appears to be related to a regression in the Claude Code version 2.1.119, as it worked in a previous version. However, without more information about the previous version, it's difficult to provide a more specific fix.

Recommendation

Apply workaround: Ensure that the text content blocks in the API request are not empty, as this is the most likely cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING