X API media metadata: alt text up to 1000 characters for AI images
X's media metadata endpoint takes alt_text.text up to 1000 characters. Write alt text for generated images and size the image with the Sume images API first.

X's media metadata request accepts an alt_text object whose text is at most 1000 characters. That is the field to fill for a generated image, so a screen-reader user hears what the picture shows. Sume generates the image; you write the description, since the images API returns pixels and usage data, not an accessibility description.
What does the spec say about alt text?
In the X OpenAPI document, the media metadata schema has alt_text with a text string capped at 1000 characters. The same metadata object also carries a content_expiration timestamp in seconds, which is a different field and does not affect alt text.
| Field | Detail |
|---|---|
| alt_text.text | String, maxLength 1000 |
| content_expiration.timestamp_sec | Expiry timestamp in seconds |
| Media per post | 1-4 media_ids in the create-post body |
How do I write alt text for a generated image?
Describe what is visible, in plain sentences, and keep it well under the cap. Say what the picture is, such as an illustration or a product render, followed by the subject and any text that appears inside the image. Do not stuff keywords; the cap is a ceiling, not a target.
- Lead with the subject, then setting and style.
- Transcribe any words rendered in the image.
- Leave out phrases like image of; the reader already knows.
- Keep one description per image when a post has several.
How do I get the right image from Sume?
Request an aspect_ratio that suits the timeline crop, plus output_format jpeg or png. The response gives Sume-hosted image URLs; download one and upload it to X's media endpoint, then set its metadata with the alt text and finally create the post.
import json, os, urllib.request
body = {
"model": "bytedance-seed/seedream-4.5",
"prompt": "minimal poster, a paper boat on calm water, soft morning light",
"aspect_ratio": "16:9",
"output_format": "png"
}
req = urllib.request.Request(
"https://api.sume.com/v1/images",
data=json.dumps(body).encode(),
headers={
"Authorization": "Bearer " + os.environ["SUME_API_KEY"],
"Content-Type": "application/json",
},
method="POST",
)
print(urllib.request.urlopen(req).read().decode())What else should I check?
Confirm the endpoint paths and version in X's live OpenAPI file; they are the source of truth. The images guide lists the parameters Sume accepts.
Sources
Related posts
More in Integrations
- X media upload total_bytes ceiling of 16 GiB: trim long AI video first
X's media upload init accepts total_bytes up to 17179869184 (16 GiB). Why the cap rarely binds for AI clips, and how Sume video-trim keeps uploads short.
- YouTube channelBanners.insert: 6 MB JPEG or PNG limit for AI banners
YouTube's channelBanners.insert accepts a JPEG or PNG up to 6 MB (6291456 bytes). Generate a banner with Sume Images and keep the file under the cap.
- YouTube Data API containsSyntheticMedia: set it on videos.insert
YouTube Data API v3 VideoStatus has containsSyntheticMedia, a boolean for altered or synthetic media. Where to set it and how to trim a Sume clip first.
- YouTube playlistImages API: 50 MB cover images from an AI image
YouTube's playlistImages insert and update accept a JPEG or PNG up to 50 MB (52428800 bytes). Make a cover with Sume Images; the spec gives no pixel size.
Written by Sume