[Bug] Anthropic API Error: Image does not match provided media type
Resolved 💬 30 comments Opened Nov 19, 2025 by razurang Closed Jul 9, 2026
💡 Likely answer: A maintainer (localden, collaborator)
responded on this thread — see the highlighted reply below.
Bug Description
Playwright MCP took screenshots in png format, but while API call, it's looking for image/JPEG format, it was working before, but now it's getting this error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","messag
e":"messages.5.content.28.image.source.base64.data: Image does not match the
provided media type image/jpeg"},"request_id":"req_011CVHseGP3vaiaFfNqeY4gQ"}
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 2.0.46
- Feedback ID: de2e8417-f5f2-4035-ad13-183b406bfcb2
Errors
[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/razu/.local/share/claude/versions/2.0.46 (expected in multi-process scenarios)\n at aq0 (/$bunfs/root/claude:2532:1516)\n at P4A (/$bunfs/root/claude:2532:1194)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-19T20:17:38.589Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/razu/.local/share/claude/versions/2.0.46 (expected in multi-process scenarios)\n at aq0 (/$bunfs/root/claude:2532:1516)\n at N4A (/$bunfs/root/claude:2530:12601)\n at async tp8 (/$bunfs/root/claude:2530:13807)\n at async Ux (/$bunfs/root/claude:2532:236)\n at async <anonymous> (/$bunfs/root/claude:2532:12383)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-19T20:17:48.464Z"},{"error":"Error: Could not load the \"sharp\" module using the darwin-arm64 runtime\nPossible solutions:\n- Ensure optional dependencies can be installed:\n npm install --include=optional sharp\n- Ensure your package manager supports multi-platform installation:\n See https://sharp.pixelplumbing.com/install#cross-platform\n- Add platform-specific dependencies:\n npm install --os=darwin --cpu=arm64 sharp\n- Consult the installation documentation:\n See https://sharp.pixelplumbing.com/install\n at <anonymous> (/$bunfs/root/claude:339:36615)\n at <anonymous> (/$bunfs/root/claude:11:356)\n at <anonymous> (/$bunfs/root/claude:340:88)\n at <anonymous> (/$bunfs/root/claude:11:356)\n at <anonymous> (/$bunfs/root/claude:340:79804)\n at <anonymous> (/$bunfs/root/claude:11:356)\n at <anonymous> (/$bunfs/root/claude:340:80999)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-19T20:24:23.949Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.5.content.28.image.source.base64.data: Image does not match the provided media type image/jpeg\"},\"request_id\":\"req_011CVHseGP3vaiaFfNqeY4gQ\"}\n at generate (/$bunfs/root/claude:390:20036)\n at makeRequest (/$bunfs/root/claude:732:5434)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-19T20:24:26.333Z"}]
30 Comments
After this API error, if you send a new message, you get the same API error again with a new request_id. That means the Claude Code session is dead, and you can’t continue. You’re stuck. You have to open a new session to use Claude Code again.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I'm experiencing the same issue while using the Figma MCP and attempting to capture a screenshot.
Also related: https://github.com/anthropics/claude-code/issues/11908
I am getting the same thing with chrome devtools mcp
I'd consider this a critical/blocker bug because it crashes our current sessions and then we need to start over again, the experience is way subpar now...
Edit: Since I really need this working and can't wait until they fix it, I made some scripts to downgrade/restore claude code in the meantime. It doesn't happen with 2.0.44...
https://github.com/anthropics/claude-code/issues/11908#issuecomment-3554847291
Seeing this with version 2.0.46
Same here in 2.0.47, affets all our image gen mcps.
Downgrading to 2.0.30 with
claude install 2.0.30helps if someone needs to bypass itIm seeing the same error with both Playright MCP and Chrome Devtools MCP.
Both occur when taking an image.
@MilesNorton
thanks you. i can continue with the work.
Same errors here using the playwright MCP server to take screenshots of webpages.
Claude Code Version: 2.0.47
I've also started getting this error while trying to use Figma's MCP (which I've used many times before). Both in Claude Code in terminal, and also when using Sonnet 4.5 as the selected agent in Cursor.
I have the same issues with claude code :(
+1 here. Same issue.
This is a pretty significant blocker and pretty bad for anyone who has become reliant on the MCP. I exported a screenshot to my working directory manually, but I cannot use the metadata it fetches successfully since the screenshot call is required. Curious if there is a way to remove or bypass that requirement.
I figured out a temporary solution, and it worked for me.
Ask Claude Code to change the screenshot format from PNG to JPEG for Playwright MCP, and it will update the necessary code in
screenshot.js. Then restart Claude Code. If Claude Code tries to take a screenshot with Playwright MCP, simply press Esc and tell it to take the screenshot in JPEG format. That’s it — it will look for the JPG format and should work again.Let me know if it works for you as well.
Thank you.
Edit your ~/.claude.json where your mcp config is set:
Tried this for Figma's MCP and unfortunately it didn't work @corby.
Version: 2.0.50 seems to have fixed it, at least for Figma's MCP.
I was still getting this error in 2.0.50.
Add this code to force the tool to use jpeg format, this resolves it for both Playwrite and Chrome Dev Tools
Chrome Dev Tools MCP
.claude/hooks/chromedevtools-screenshot-guard.py.claude/settings.jsonPlaywrite MCP
Credit to @Sceat for this discovery
See full details here
@Humni well credit to Claude, he found that by himself 😆
@Humni will give this a try. It has been driving me nuts.
Seeing this bug when Claude attempts to read an image, even without using an MCP. Example:
⏺ Read(temp/article-sessions/issue-82/images/raw/PFH18HSPVMC_06.jpg)
⎿ Read image (230.4KB)
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_
request_error","message":"messages.3.cont
ent.21.image.source.base64.data: Image
does not match the provided media type
image/jpeg"},"request_id":"req_011CVjEtb4
8ua18B11gWXgjQ"}
Still seeing the issue on 2.0.56.
Ran into this today with 2.0.59
Claude gets stuck and you can't tell it to skip or bypass the image, so you have to /clear the conversation and start all over again.
Claude should gracefully bypass the image, report to the user the file name and issue and allow the user to fix it, skip it and continue, etc.
In my case it was images with the wrong extension, something simple enough that Claude should have been able to skip, bypass or deal with.
``
API Error: 400``f"type": "error", "error": {"type":"invalid_request_error","
message": "messages. 13. content.5. image.source.base64.data:
Image does not match the provided media type
image/jpeg"}, "request_id": "req_011CVo58ve6dbpwnDwL46v56"}
Have you tried rewinding to an earlier checkpoint? It has helped me in the past when Claude froze after an MCP error.
Confirming this issue on v2.0.71
I encountered the exact same "soft-lock" loop today.
Claude Code read a file named logo.png which apparently had a mismatching MIME type (likely a WebP or JPEG saved with a .png extension).
The API returned a 400 error: Invalid request error: image does not match the provided media type image/png.
When I tried to issue a command to fix it (e.g., do not read images or /clear), Claude Code seemingly re-sent the corrupted context history before processing the new command, triggering the 400 error again immediately.
I was unable to recover the session and had to kill the process.
Environment:
Claude Code v2.0.71
OS: Mac
Error: messages.x.content.x.image.source.base64.data: Image does not match the provided media type image/png
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Still finding the same issue here!
This issue arose for me because I changed the mac default screenshot format from PNG to jpeg. Claude is assuming that anything pasted is a PNG. It needs to check.
The same happens anytime you use the iOS app with Claude code. Uploading an image shatters the session
Three separate things were going on here. The MCP compression regression was fixed in v2.0.50, wrong-extension images from Read/paste/iOS in v2.1.116, and the session soft-lock in v2.1.142. No reports since May so closing this out. Reopen with version +
--debugif it shows up on 2.1.142 or later.