Media requirements and long video uploads (Premium)
Property Requirement Max images 4 per tweet Formats JPEG, PNG, WebP, GIF Max file size 5 MB (images), 15 MB (GIFs) Min dimensions 4 x 4 px Max dimensions 8192 x 8192 px Recommended 1200 x 675 px (16:9)
Type Ratio Dimensions Landscape 16:9 1200 x 675 px Square 1:1 1200 x 1200 px Portrait 4:5 1080 x 1350 px
Property Requirement Max per tweet 1 (consumes all 4 image slots) Max file size 15 MB Max dimensions 1280 x 1080 px Behavior Auto-plays in timeline
Property Requirement Max videos 1 per tweet Formats MP4, MOV Max file size 512 MB Max duration 140 seconds (2 min 20 sec) standard; up to ~10 minutes with Premium long video (see below) Min duration 0.5 seconds Min dimensions 32 x 32 px Max dimensions 1920 x 1200 px Frame rate 40 fps max Bitrate 25 Mbps max
By default, X limits API video uploads to 140 seconds . If the connected X account has an active X Premium subscription, you can enable long video uploads (over 140 seconds) by setting platformSpecificData.longVideo: true.
Note: Not all Premium accounts have API long-video access, as X may require separate allowlisting.
curl JavaScript Python
curl -X POST https://zernio.com/api/v1/posts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Long video upload (Premium)",
"mediaItems": [
{"type": "video", "url": "https://cdn.example.com/long-video.mp4"}
],
"platforms": [{
"platform": "twitter",
"accountId": "YOUR_ACCOUNT_ID",
"platformSpecificData": {
"longVideo": true
}
}],
"publishNow": true
}' const { post } = await zernio.posts. createPost ({
content: 'Long video upload (Premium)' ,
mediaItems: [{ type: 'video' , url: 'https://cdn.example.com/long-video.mp4' }],
platforms: [{
platform: 'twitter' ,
accountId: 'YOUR_ACCOUNT_ID' ,
platformSpecificData: {
longVideo: true
}
}],
publishNow: true
});
console. log ( 'Tweet posted!' , post._id); result = client.posts.create_post(
content = "Long video upload (Premium)" ,
media_items = [{ "type" : "video" , "url" : "https://cdn.example.com/long-video.mp4" }],
platforms = [{
"platform" : "twitter" ,
"accountId" : "YOUR_ACCOUNT_ID" ,
"platformSpecificData" : { "longVideo" : True }
}],
publish_now = True
)
post = result.post
print ( f "Tweet posted! { post[ '_id' ] } " )
Property Recommended Resolution 1280 x 720 px (720p) Aspect ratio 16:9 (landscape) or 1:1 (square) Frame rate 30 fps Codec H.264 Audio AAC, 128 kbps