[BUG] Conversation breaks(throws 400) after image encoding error
Resolved 💬 5 comments Opened Jan 11, 2026 by paocg01-ops Closed Feb 26, 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?
Claude Code Agent
Terminal: VSCode terminal
Bug Description
Conversation breaks(throws 400) after image encoding error
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.18.content.1.image.source.base64.data: Image does not match the provided media type image/png"},"request_id":"req_011CX1CkXwBv6rT1SnpzMsgw"}
What Should Happen?
Expected Behavior
Working as normal
Actual Behavior
Throws 400 error for each prompt
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.18.content.1.image.source.base64.data: Image does not match the provided media type image/png"},"request_id":"req_011CX1CkXwBv6rT1SnpzMsgw"}
Steps to Reproduce
Take a broken image file and make the text part of your context.
send the prompt.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.5
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗