[BUG]API Error: 400 messages: text content blocks must be non-empty

Open 💬 13 comments Opened May 26, 2026 by bigceejay727

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?

When submitting an image with no accompanying text in Claude Code's chat,
the API throws: "400 messages: text content blocks must be non-empty"

A fallback text block should be added when only an image is submitted.

Steps to reproduce:

  1. Open Claude Code chat
  2. Attach an image without typing any text
  3. Submit

Expected: Request succeeds with a default prompt
Actual: API Error 400 - text content blocks must be non-empty

What Should Happen?

API Error 400 when sending image with no text in chat

Error Messages/Logs

API Error: 400 messages: text content blocks must be non-empty

Steps to Reproduce

please help

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Opus

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

<img width="1460" height="723" alt="Image" src="https://github.com/user-attachments/assets/2d1fd15f-0321-407a-8f96-565d306725f7" />

View original on GitHub ↗

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