
Generate 1080p Imagine video with the API
Generate 1080p Imagine video with the API
On grok-imagine-video-1.5, text-to-video and image-to-video accept resolution: "1080p" on POST https://api.x.ai/v1/videos/generations. Default resolution is 480p; 720p and 1080p are the other options. Reference-to-video stays capped at 720p. Use your regular XAI_API_KEY.
Text-to-video at 1080p
REQUEST_ID=$(curl -s -X POST https://api.x.ai/v1/videos/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"model": "grok-imagine-video-1.5",
"prompt": "Timelapse of a flower blooming in a sunlit garden",
"duration": 10,
"aspect_ratio": "16:9",
"resolution": "1080p"
}' | jq -r '.request_id')
while true; do
RESULT=$(curl -s "https://api.x.ai/v1/videos/$REQUEST_ID" \
-H "Authorization: Bearer $XAI_API_KEY")
STATUS=$(echo "$RESULT" | jq -r '.status')
if [ "$STATUS" = "done" ]; then
echo "$RESULT" | jq -r '.video.url'
break
elif [ "$STATUS" = "failed" ] || [ "$STATUS" = "expired" ]; then
echo "Request $STATUS"; echo "$RESULT" | jq .
break
fi
sleep 5
done
import os
from xai_sdk import Client
client = Client(api_key=os.getenv("XAI_API_KEY"))
response = client.video.generate(
prompt="Timelapse of a flower blooming in a sunlit garden",
model="grok-imagine-video-1.5",
duration=10,
aspect_ratio="16:9",
resolution="1080p",
)
print(response.url)
Higher resolution takes longer to finish. Poll until status is done, or raise the SDK timeout / interval if you wait past the default ten minutes.
Limits that still apply
- Reference-to-video (including first/last frame pins with references): max
720p. - Video editing: output matches the input, capped at
720p(a 1080p source is downsized). - Duration stays 1–15 seconds on generation. Aspect ratios:
1:1,16:9,9:16,4:3,3:4,3:2,2:3.
Silent plate option: Disable audio on Imagine video generation.
Pitfalls
- Asking for
1080pon classicgrok-imagine-videoor on reference-to-video returns a failed / precondition error — usegrok-imagine-video-1.5and text- or image-to-video for Full HD. - Temporary video URLs expire; download promptly if you need a lasting copy.
- Console API credits are a separate bill from SuperGrok's weekly pool on grok.com.