X API image 5 MB limit: pick a Sume output format

X allows JPG, PNG, GIF and WEBP images up to 5 MB on every account. Sume outputs png, jpeg or webp, with no target file size field in the docs.

4 min readSume
All posts

X accepts JPG, PNG, GIF and WEBP images of at most 5 MB for tweet_image and dm_image, and Premium does not raise that. Sume outputs png, jpeg or webp, but the docs pages I read list no target-file-size parameter, so you check the byte size of each file before upload.

The X spec is from its Media best practices page, read 2026-10-01. Sume facts are from Image API and Video frames.

What does X require for an image?

Supported types are JPG, PNG, GIF and WEBP, and the size must be 5 MB or less. The default and Premium tables both show 5 MB for images. Animated GIFs have a separate 15 MB limit.

X image limits, from the X best practices page, read 2026-10-01.
CategoryTypesMax size
tweet_image, dm_imageJPG, PNG, GIF, WEBP5 MB
tweet_gif, dm_gifAnimated GIF15 MB

Which output formats does Sume offer?

The image catalog lists output_format values of png, jpeg and webp. All three are on X's accepted list. Stills pulled from video with video-frames can be jpeg (the default) or png, with an optional max_edge clamp of 16 to 2160.

How do I keep a file under 5 MB?

The docs give size levers, not a byte target. For custom sizes on the GPT image model, both edges must be multiples of 16, the maximum edge is 3840, the aspect ratio at most 3:1, and the pixel count 655,360 to 8,294,400. A smaller image_size and a lossy format such as jpeg or webp tend to give smaller files, but the docs do not promise a size, so measure.

What should I do if a file is over the cap?

Regenerate at a smaller size or switch format, then check the size again before upload. If you upload via the chunked flow, follow the v2 upload steps. Images are checked again when attached to a Post.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume