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.

The X API media upload initialization takes a total_bytes value with a maximum of 17,179,869,184, which is 16 GiB. An AI-generated clip is nowhere near that, so the number is not your constraint; X's own per-type media rules are. Trim the clip to the length you want to post first, since a shorter file uploads faster and fails less.
What does the spec say about total_bytes?
The OpenAPI document gives the upload init body a total_bytes integer with maximum: 17179869184. That figure is a property of the request schema. The same document does not, in the part read here, list per-type duration or resolution limits, so those need X's media documentation and should not be assumed.
| Field | Detail |
|---|---|
| total_bytes | Integer, maximum 17179869184 (16 GiB) |
| media in a post | 1-4 media_ids |
| Per-type duration limits | Not stated in the schema read; check X's media docs |
Why trim before uploading?
A short file is the cheapest fix for most upload problems: fewer chunks, less to retry, and a better fit for a feed where people scroll quickly. Sume's video-trim cuts a Sume-hosted video to a start and an end or duration (0.2-900 seconds), and a source up to 1800 seconds is accepted.
import json, os, urllib.request
body = {
"video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
"start": 5,
"end": 35,
"precision": "exact",
"output": {
"width": 1280,
"height": 720,
"fps": 30
}
}
req = urllib.request.Request(
"https://api.sume.com/v1/video-trim",
data=json.dumps(body).encode(),
headers={
"Authorization": "Bearer " + os.environ["SUME_API_KEY"],
"Content-Type": "application/json",
"Idempotency-Key": "x-trim-001",
},
method="POST",
)
print(urllib.request.urlopen(req).read().decode())What does a trim job return?
When the job is ready, GET /v1/jobs/:id/result returns a kind: video_trim result with a new video_url, duration_seconds, actual_start_seconds, precision, audio and output. Download that MP4 for the chunked upload.
What should I verify?
Read X's media upload documentation for the supported types and durations before you automate. The video trim guide lists Sume's caps and error codes.
Sources
Related posts
More in Integrations
- 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.
- YouTube watermarks.set: 10 MB JPEG or PNG for channel branding
The YouTube Data API watermarks.set method uploads a JPEG or PNG up to 10 MB as a channel watermark. Generate a transparent PNG logo mark with Sume Images.
Written by Sume