Create video
Last updated September 13, 2026
Generate with `x-ai/grok-imagine-video` in xAI's native shape; existing xAI clients work as-is.
Generate video with x-ai/grok-imagine-video using the native xAI request shape. Existing xAI
clients only need to point base_url at this site; request and response parsing
need no change.
https://gateway.amux.ai/v1/videos/generationsAuthorization
headerAuthorizationstringRequiredBearer <your Amux key> An API key issued by this site.
Request
application/jsonmodelstringRequiredFixed to x-ai/grok-imagine-video.
promptstringOptional when material is supplied; supplying neither returns a 400.
durationintegerDefault 8Output length in seconds, defaulting to 8.
⚠️ With reference material the cap is 10 seconds; exceeding it returns a synchronous 400 at submit time.
aspect_ratio"1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3"Default "16:9"⚠️ No effect for image-to-video: the output aspect ratio follows the supplied image.
resolution"480p" | "720p"Default "480p"The pricing tier, defaulting to 480p (the upstream default).
No 1080p — that tier exists only on x-ai/grok-imagine-video-1.5 and returns a 400 here.
imageobjectFirst frame image. Supplying it selects image-to-video mode.
›imageobject
urlstringFirst frame address; must be a publicly reachable URL.
last_frameobjectLast frame image. Supplied together with image, it pins both ends.
›last_frameobject
urlstringLast frame address; must be a publicly reachable URL.
reference_imagesarray<object>Style and content reference images, up to 14.
›reference_imagesarray<object>
urlstringReference image address; must be a publicly reachable URL.
generate_audiobooleanDefault trueAudio is generated by default. Pass false to produce output with no audio track.
moderation"low" | "auto" | "high"Moderation strength. The upstream default applies when omitted.
userstringEnd-user identifier for abuse tracing. Send a hash rather than the raw value.
Response
200responseThe task was created.
400responseInvalid request (value outside its domain, unsupported material combination, or neither prompt nor material supplied).
402responseInsufficient balance to reserve the cost of this task.
Value domains for this model
| Resolution | 480p 720p |
| Duration | 1–15 seconds for plain text- and image-to-video; 10 seconds when reference_images or last_frame is present. |
| Reference images | Up to 14 |
| Prompt | Optional when any material is supplied |
⚠️ This model has no 1080p. That tier exists only on
x-ai/grok-imagine-video-1.5; requesting it here returns a 400 rather than a
silent downgrade.
The parameter table above is narrowed to this model — every entry is one it actually accepts. Values outside the domain return 400 with the accepted values, never a silent substitution.
Four generation modes
The mode is determined by the material supplied; no separate declaration is needed:
| Mode | Required fields |
|---|---|
| Text to video | prompt only |
| Image to video | image (first frame) |
| Reference to video | reference_images |
| First and last frame | image + last_frame |
⚠️ For image-to-video, aspect_ratio and resolution do not determine the
output size — the aspect ratio always follows the supplied image. Billing is
unaffected and still uses the requested resolution tier.
Billing
cost = actual output seconds × resolution tier rate
+ input image count × per-image rate
Output is billed per second (each resolution tier has its own rate); input images are billed per image, with first frame, last frame and reference images all counted. The authoritative per-tier rates are on the model detail and pricing pages, which read the price table directly.
Output seconds come from the value the upstream returns, not the requested
duration. Cost is reserved at submit time from the request and settled against
actual usage, with the difference released.
Retrieval
The returned request_id is the Amux task id. The
xAI-shaped retrieval and the
unified retrieval read the same task.
curl https://gateway.amux.ai/v1/videos/generations \
-H "Authorization: Bearer $AMUX_API_KEY" \
-d '{
"model": "x-ai/grok-imagine-video",
"prompt": "A red paper boat drifting down a rain puddle, camera slowly pans out",
"duration": 8,
"resolution": "480p"
}'{
"request_id": "<string>"
}