Agent Completion attachments: 16 full-size images fit the 500 MB cap

An Agent Completion takes up to 30 images, each up to 30 MB, in a set up to 500 MB. At full size only 16 fit; for 30 images the average must be under 16.7 MB.

5 min readSume
All posts

Sixteen full-size images fit in one Agent Completion; a seventeenth does not. The docs allow up to 30 images per request, 30 MB per image, and 500 MB for the whole set. At 30 MB each, 16 images total 480 MB and 17 would be 510 MB, which is over the limit. To send all 30, the images must average no more than about 16.7 MB (500 divided by 30).

The error you get is 413 attachment_too_large, for either an image over 30 MB or a set over 500 MB. A failed fetch of the image is a different code, 502 attachment_fetch_failed, and a bad item is 400 invalid_attachment.

The limits, side by side

From the Agent Completions page, read 2026-10-09.

Agent Completion attachment limits
LimitValueError if exceeded
Images per request30Not stated on the page (bad items are 400 invalid_attachment)
Size per image30 MB413 attachment_too_large
Total set500 MB413 attachment_too_large
Accepted typesinput_image only400 invalid_attachment
Unreachable sourceHost down, hotlink protection, non-2xx502 attachment_fetch_failed

The arithmetic for packing a set

Work from the total budget, not from the per-image maximum.

  • Maximum count at 30 MB each: floor(500 / 30) = 16 images, 480 MB used.
  • Maximum average for 30 images: 500 / 30 = 16.67 MB.
  • Mixed set: 10 images at 30 MB (300 MB) leaves 200 MB for the other 20, or 10 MB each.
  • Phone photos at 4 MB each: 30 images is 120 MB, well inside the cap.

Send URLs or asset ids, and keep it HTTPS

Each item carries either an image_url that is HTTPS or an asset_id from your workspace, never both. A non-HTTPS URL is a 400 invalid_attachment, and an unknown asset_id is 400 attachment_not_found. Sume merges attachments sent at the top level with input_image parts inside messages[] into one list, so count both when you budget.

A turn with only images is allowed: if you omit the text part, Sume tells the agent to use the attached files. And as always, generation_spend_cap_usd is required on the request, so the call fails with 400 invalid_request if you forget it, regardless of how small the images are.

Checking before you send

Sum the byte sizes on your side with a HEAD request or from your own storage metadata before building the request. If the total is over 500 MB, split the work into two completions rather than recompressing everything, and give each its own generation_spend_cap_usd so the two caps add up to the budget you intended. Because every completion starts a new thread, the second run will not remember the first; put any shared context in the instruction text or in the input object.

Sources

Related posts

More in Agents

All Agents posts

Written by Sume