Post Grok Imagine videos to X
generated, saved, scheduled
The Grok Imagine API makes the clip. It does not post it. Here is the missing half: keep the MP4 before its link expires and schedule it to X as a native video, with one OpenTweet key and no X developer account.
Card required, cancel any time.
The short answer
Start a job with POST https://api.x.ai/v1/videos/generations, poll GET /v1/videos/{request_id} until status is done, and download video.url right away, because it is temporary. Upload the MP4 to POST https://opentweet.io/api/v1/upload, then send the returned URL in media_urls to POST /api/v1/posts with a scheduled_date. Clips cost from $0.02 a second on grok-imagine-video-1.5-lite.
Grok Imagine is one of the most searched AI video tools right now: on Google Trends over the last three months, "grok imagine" drew roughly four times the interest of "twitter bot", and "grok imagine api" is a rising query. Accounts that post video through the OpenTweet API already published 832 native videos in the last 30 days. The step people get stuck on is not the generation; it is getting the clip onto X on a schedule.
Grok Imagine video models and what a clip costs
List prices per generated second from docs.x.ai, read November 5, 2026. xAI notes that resolution also changes the total, so treat these as the floor and log usage.cost_in_usd_ticks from each job.
| Model | Price | 8 s clip | 15 s clip | Notes |
|---|---|---|---|---|
grok-imagine-video-1.5-lite | $0.020/s | $0.16 | $0.30 | Text- and image-to-video. 1080p is upscaled from 720p. The default for a daily account. |
grok-imagine-video | $0.050/s | $0.40 | $0.75 | Older model, up to 720p. Adds video editing and extension. |
grok-imagine-video-1.5 | $0.080/s | $0.64 | $1.20 | Native 1080p, lip-synced speech. 10 requests a second. For hero clips. |
A month of three 8-second clips a day (90 clips) is about $14.40 on 1.5 Lite, $36 on grok-imagine-video and $57.60 on 1.5, before resolution. Posting them is a flat OpenTweet plan with no per-post fee.
From prompt to scheduled X video in Python
Generate, wait, copy the MP4 to OpenTweet storage, schedule. Run it from cron or a worker; generation can take several minutes.
import os, time, requests
XAI = {"Authorization": f"Bearer {os.environ['XAI_API_KEY']}"}
OT = {"Authorization": f"Bearer {os.environ['OPENTWEET_API_KEY']}"}
def make_video(prompt, seconds=8, ratio="9:16", res="720p"):
r = requests.post("https://api.x.ai/v1/videos/generations", headers=XAI, json={
"model": "grok-imagine-video-1.5-lite", # $0.02/s; swap for 1.5 when quality matters
"prompt": prompt,
"duration": seconds, # 1 to 15
"aspect_ratio": ratio, # 9:16 fills a phone screen
"resolution": res, # 480p, 720p or 1080p
})
r.raise_for_status()
request_id = r.json()["request_id"]
while True: # usually a few minutes
job = requests.get(f"https://api.x.ai/v1/videos/{request_id}", headers=XAI).json()
if job["status"] == "done":
url = (job.get("video") or {}).get("url")
if not url:
raise RuntimeError("blocked by moderation (respect_moderation false)")
return url
if job["status"] == "failed":
raise RuntimeError(job.get("error"))
time.sleep(5)
def keep(temp_url):
"""xAI links are temporary. Copy the MP4 to OpenTweet before scheduling."""
mp4 = requests.get(temp_url, timeout=120).content
r = requests.post("https://opentweet.io/api/v1/upload", headers=OT,
files={"file": ("clip.mp4", mp4, "video/mp4")})
r.raise_for_status()
return r.json()["url"]
clip = keep(make_video(
"A paper boat sails down a rain-soaked city street at night, neon reflections, "
"slow push-in, ends on the boat drifting into a storm drain"))
requests.post("https://opentweet.io/api/v1/posts", headers=OT, json={
"text": "Tiny voyage, big city. (AI-generated with Grok Imagine)",
"media_urls": [clip],
"scheduled_date": "2026-11-06T15:00:00Z", # or "publish_now": True
}).raise_for_status()The same four calls with curl
# 1. Start the job
curl -s https://api.x.ai/v1/videos/generations \
-H "Authorization: Bearer $XAI_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"grok-imagine-video-1.5-lite","prompt":"...","duration":8,"aspect_ratio":"9:16"}'
# -> {"request_id":"a3d1008e-..."}
# 2. Poll until "status":"done", then read .video.url
curl -s https://api.x.ai/v1/videos/a3d1008e-... -H "Authorization: Bearer $XAI_API_KEY"
# 3. Save the clip to OpenTweet (returns a stored URL)
curl -s -o clip.mp4 "<video.url>"
curl -s https://opentweet.io/api/v1/upload -H "Authorization: Bearer $OPENTWEET_API_KEY" \
-F "file=@clip.mp4;type=video/mp4"
# 4. Schedule it
curl -s https://opentweet.io/api/v1/posts -H "Authorization: Bearer $OPENTWEET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"...","media_urls":["<stored url>"],"scheduled_date":"2026-11-06T15:00:00Z"}'Uploads take MP4 or MOV up to 20MB, and a 15-second clip is well under that. Every field is in the API reference; the X side of media uploads is in upload media to the X API.
Made the clip in the Grok app? Schedule it without code
- Download the video from Grok as an MP4.
- In OpenTweet, open the composer, attach the MP4 and write the post.
- Pick a time, or drop it into a weekly slot on the calendar. It posts as a native X video, not a link.
Using Claude, ChatGPT or Cursor? Connect the OpenTweet MCP server and ask: "Upload clip.mp4 and schedule it for 3pm tomorrow with this caption." It uses the upload and create-post tools.
Six ways the pipeline breaks
Scheduling the xAI link
video.url is temporary. A post scheduled for tonight fetches it tonight, and it may be gone. Upload the MP4 first, or use xAI storage_options (kept up to 30 days).
Empty video URL
If respect_moderation comes back false, the job is done but video.url is empty. Log the prompt and skip the slot instead of posting text alone.
Horizontal clips on mobile
The default ratio is 16:9. Most X video is watched on phones; 9:16 or 1:1 takes more of the screen.
The hook is in the audio
Feed video starts muted. Make the first second visual and say what happens in the post text.
Same prompt, every day
X's rules ban duplicate or substantially similar posts. Rotate subjects and keep a list of what already ran.
Waiting in a web request
Generation takes up to several minutes. Run it in a job or cron, never inside a request that times out at 60 seconds.
Which plan fits a video account
Video posts count like any other post. No per-video fee.
| Setup | Limit | Plan |
|---|---|---|
| One account, a few clips a day | Up to 20 posts a day | Pro, $19.99/mo |
| Clips plus text posts, or 3 themed accounts | Up to 100 posts a day, 3 X accounts | Advanced, $29/mo |
| A network of video accounts | Up to 300 posts a day, 10 X accounts | Agency, $49/mo |
Don't pass AI video off as real. X's authenticity rule bans fabricated media of real people shared as authentic when it can cause confusion or harm. A realistic clip of a real person or event should say "AI-generated" in the post. More in does X allow AI-generated content.
Label a fully automated account. If no person reviews the posts, turn on X's Automated label. See X automation rules.
Planning to earn from it? Original Content Rewards pays for original posts, not reposted ones. Check the bar in how to qualify for Original Content Rewards.
Frequently asked questions
Can Grok Imagine post videos to X automatically?
Not on its own. The Grok Imagine API returns an MP4 and stops there; it has no publish or schedule step. To post on a schedule, send the file to a posting layer: upload it to POST https://opentweet.io/api/v1/upload, then create the post with the returned URL in media_urls and a scheduled_date. OpenTweet posts it as a native X video through a normal X login, so you do not need an X developer account.
How much does the Grok Imagine video API cost?
xAI lists three video models, billed per generated second: grok-imagine-video-1.5-lite at $0.020, grok-imagine-video at $0.050 and grok-imagine-video-1.5 at $0.080 (docs.x.ai pricing, read November 5, 2026). An 8-second clip is $0.16, $0.40 or $0.64. xAI says resolution also affects the total, so read usage.cost_in_usd_ticks on each finished job instead of budgeting from the list price.
How long can a Grok Imagine video be?
Between 1 and 15 seconds, set with the duration field (default 8). Resolution is 480p (the default), 720p or 1080p; on 1.5 Lite, 1080p is upscaled from 720p. Aspect ratios include 16:9 (the default), 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9 and 5:2. Image-to-video always keeps the input image's ratio.
Why did my scheduled Grok video fail to post?
Usually because the post pointed at xAI's link. The API returns video.url as a temporary URL and xAI's docs say to download it promptly; a scheduled post fetches its media at publish time, hours later. Copy the MP4 first: upload it to OpenTweet (stored for you) or ask xAI to store it with storage_options. Also check respect_moderation: when it is false, the video URL comes back empty.
Do Grok Imagine videos have sound?
Yes, by default. The 1.5 and 1.5 Lite models generate an audio track with lip-synced speech. xAI's generation guide shows "generate_audio": false for silent clips. X plays video muted in the feed until someone taps, so put the hook in the first frame and in the post text, not only in the audio.
Do I have to label AI-generated video on X?
X has no per-post AI label you must add. Its authenticity rule bans fabricated media of real people or events shared as real when it can cause confusion or harm, and allows non-deceptive AI media. A realistic clip of a real person or a news event should say it is AI-generated. A fully automated account should also turn on X's Automated account label. Details in our answer on whether X allows AI-generated content.
What is the upload size limit for videos on OpenTweet?
Up to 20MB per video through the dashboard composer and the upload endpoint, in MP4 or MOV. A 15-second Grok clip fits easily. For bigger files, host the MP4 yourself on a public HTTPS URL and pass that URL in media_urls; OpenTweet fetches it at publish time, so the link has to stay live until then.
Running a whole account on AI video? See the AI video account build guide. Want Grok itself to post? See give Grok Bot the ability to post to X.
Everything you can build on X with OpenTweet
Post to X from your code, a watcher, or an AI agent. Start anywhere in the cluster.
OpenTweet vs the X API
Post, schedule, and automate X without a developer account or the $200/mo minimum.
X DM outreach, human-approved
Find and qualify leads, AI-draft DMs, approve each one, and drip-send from your own account via API or MCP.
Post to X without an API
The clean, account-safe way to post to X from your code or an AI agent.
Twitter MCP Server
Give Claude, Cursor, and OpenClaw the ability to post to X. 44 tools included.
Developer docs
Quickstart, API keys, MCP setup, and the REST reference for posting to X from code or an agent.
Cross-posting reference
One call posts to X, Bluesky and LinkedIn. The platforms field, per-network results, and why a network gets skipped.
Social media API for AI agents
Three ways an agent can post to X, Bluesky and LinkedIn, and the trade-offs of each.
LinkedIn MCP server
Post and schedule to a LinkedIn profile from Claude or Cursor through the official LinkedIn API.
XMCP vs OpenTweet
X's official MCP server bills per API call and cannot schedule. Compare it with the flat-fee hosted MCP.
MCP for AI agents
Connect your AI client to X in under two minutes, no X developer account.
Developer API and keys
REST endpoints, one bearer key, and usage tracking. Build on OpenTweet.
OpenTweet for AI agents
The posting layer for autonomous agents and automations that live on X.
Build an AI Twitter persona
Give your AI agent its own X account. Setup, cadence, and the rules that keep it safe.
Best MCP servers for social media
The 2026 ranked list. How the hosted OpenTweet MCP compares with the official X MCP and others.
Best API to post to X
Seven options priced at real volumes, and why links decide the bill.
Cheapest way to post to X via code
Flat fee vs pay-per-use. Why the $0.20 per-link fee flips the math past ~145 link posts a month.
X API pricing 2026
Every pay-per-use X API endpoint price from docs.x.com in one searchable table.
Bluesky posting API
Post and schedule to Bluesky with one REST call and OAuth, and cross-post to X and LinkedIn in the same request.
Automate LinkedIn posts
Post to LinkedIn from an AI agent, n8n or a script through the official Posts API, with one REST or MCP call.
Your next Grok clip, on X at the right time
Connect X, create a key, and add four lines to your generator.