claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] API Error: 400 The request body is not valid JSON: str is not valid UTF-8: surrogates not allowed: line 1 column 1 (char 0)

Open syeddas-dev opened this issue 5 months ago • 4 comments

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 I am trying to attach and image both PNG and JPEG to the chat . Throwing this error API Error: 400 The request body is not valid JSON: str is not valid UTF-8: surrogates not allowed: line 1 column 1 (char 0)

What Should Happen?

Claude should parse the image and take action

Error Messages/Logs


Steps to Reproduce

NA

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

Claude Code v2.1.178

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

syeddas-dev avatar Jun 16 '26 03:06 syeddas-dev

Image

keep getting the same issue

uzairansaruzi avatar Jun 21 '26 21:06 uzairansaruzi

Yes. Facing this same issue.

slice-dharamd avatar Jul 01 '26 15:07 slice-dharamd

same issue here too

asecuesu avatar Jul 03 '26 15:07 asecuesu

I'm getting this issue regularly without an image attachment

ChrisLivettEH avatar Jul 06 '26 00:07 ChrisLivettEH

Since yesterday I am getting this issue when I attach pdf

sareer1337 avatar Jul 08 '26 17:07 sareer1337

Closing as a duplicate of #69781 — please follow and 👍 that issue instead so we can track it in one place. If you think this was closed in error, comment here and we'll reopen.

🤖 Generated with Claude Code

bcherny avatar Aug 16 '26 02:08 bcherny

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Oct 03 '26 14:10 github-actions[bot]