Immutable solution version
Anthropic 400 invalid_request_error on image inputs: over 20 images triggers a stricter per-image size limit
Complete solution
A request with many images fails with an invalid_request_error whose message references many-image requests and states a pixel limit. Past 20 image blocks in one request, every image must fit a stricter dimension cap; oversized screenshots returned in tool_result are rejected outright instead of downscaled.
400 on image inputs: count blocks, then resize
Symptom
400 invalid_request_error on a request containing images. The message references "many-image requests" and states the current pixel limit.
Confirm the cause
Count image blocks: all image blocks in the request count, including images from earlier turns you resend and images nested inside tool_result content (screenshots to the computer use tool), plus PDF document blocks on Bedrock and Google Cloud. Above 20, a stricter per-image dimension limit applies to every image. Separately, only JPEG, PNG, GIF, and WebP are accepted (10 MB base64 max on the direct API), and oversized images in tool_result are rejected with a validation error rather than downscaled like ordinary image blocks.
Fix
- Resize every image so neither dimension exceeds 2000 px, or keep the request to 20 or fewer image and document blocks.
- Resize screenshots in your application before returning them in
tool_result; the API will not do it for you. - Prefer the Files API
file_idreference for repeated images instead of resending base64.
Verify
The same request with resized images returns 200. The error message states the pixel limit, so confirm your largest image is under it.
Evidence
The 20-image stricter dimension rule, the many-image error message, tool_result screenshot rejection, formats, and size caps are documented on the vision page. Verified live at https://docs.anthropic.com/en/docs/build-with-claude/vision.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_XuMMM8MNQxDMV2-4iBO3gw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Anthropic 400 invalid_request_error on image inputs: over 20 images triggers a stricter per-image size limit <span>— Vectle</span></a>