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

Status Closed — not planned
Maintainer reply None cached
Activity 14 comments · opened May 26, 2026 · closed Jul 21, 2026

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 ↗

14 Comments

bigceejay727 · 3 months ago

I need help and I'm not a real coder

github-actions[bot] · 3 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/50010
  2. https://github.com/anthropics/claude-code/issues/57918
  3. https://github.com/anthropics/claude-code/issues/54314

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

fsc-eriker · 3 months ago

You might want to update the title of this bug report. It shows up as simply "[BUG]" in search results, so even people who are looking for this precise problem will likely miss it in the results. (Just a bystander here; I can't fix this myself even if I knew how to summarize your report.)

yhy2049 · 3 months ago

同样的问题,桌面版 Pro 会员用户。会话突然卡死,报 API Error: 400 messages: text content blocks must be non-empty,完全无法继续使用。希望官方尽快修复。

bigceejay727 · 3 months ago
You might want to update the title of this bug report. It shows up as simply "[BUG]" in search results, so even people who are looking for this precise problem will likely miss it in the results. (Just a bystander here; I can't fix this myself even if I knew how to summarize your report.)

Claude told me to submit it as a [BUG]

bigceejay727 · 3 months ago
Found 3 possible duplicate issues: 1. API 400 error when submitting image-only message (empty text content block) #50010 2. [[BUG] 400 "text content blocks must be non-empty" when pasting screenshot-only messages #57918](https://github.com/anthropics/claude-code/issues/57918) 3. [[BUG] API 400 text content blocks must be non-empty after pasting an image with Enter, contaminates session permanently #54314](https://github.com/anthropics/claude-code/issues/54314) This issue will be automatically closed as a duplicate in 3 days. If your issue is a duplicate, please close it and 👍 the existing issue instead To prevent auto-closure, add a comment or 👎 this comment 🤖 Generated with Claude Code

so do nothing for 3 days and I will be able to resume my session?

bigceejay727 · 3 months ago
同样的问题,桌面版 Pro 会员用户。会话突然卡死,报 API Error: 400 messages: text content blocks must be non-empty,完全无法继续使用。希望官方尽快修复。

Yes, this happened before and I had to start a whole new session. I have too much information in this session to take that route again

fsc-eriker · 3 months ago
Claude told me to submit it as a [BUG]

That should remain the _beginning_ of the bug title but you should add details. Imagine if every bug in https://github.com/anthropics/claude-code/issues had the same title. It would be absolutely useless for finding bugs you are interested in. Look at some of the others there to see how to properly summarize the topic of the bug report in the title.

bigceejay727 · 3 months ago
> Claude told me to submit it as a [BUG] That should remain the _beginning_ of the bug title but you should add details. Imagine if every bug in https://github.com/anthropics/claude-code/issues had the same title. It would be absolutely useless for finding bugs you are interested in. Look at some of the others there to see how to properly summarize the topic of the bug report in the title.

understood!! I have changed it

bigceejay727 · 3 months ago
> Claude told me to submit it as a [BUG] That should remain the _beginning_ of the bug title but you should add details. Imagine if every bug in https://github.com/anthropics/claude-code/issues had the same title. It would be absolutely useless for finding bugs you are interested in. Look at some of the others there to see how to properly summarize the topic of the bug report in the title.

Now that I have changed the title. Do you have any input on how to fix the problem?

fsc-eriker · 3 months ago

This seems to be a duplicate, the duplicate candidates suggest some workarounds like /rewind or /compact but no way to avoid this bug. Since this is a duplicate, the recommended action is to upvote one of the earlier questions and allow this bug to be closed automatically when it ages, but since there are several existing reports, I can't say for sure which one.

burnyang02-beep · 2 months ago

someone know this bug had been fixed?

bigceejay727 · 2 months ago
someone know this bug had been fixed?

Yes, they have fixed it

github-actions[bot] · 1 month ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.