Amux

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.

POSThttps://gateway.amux.ai/v1/videos/generations

Authorization

header
AuthorizationstringRequired

Bearer <your Amux key> An API key issued by this site.

Request

application/json
modelstringRequired

Fixed to x-ai/grok-imagine-video.

promptstring

Optional when material is supplied; supplying neither returns a 400.

durationintegerDefault 8

Output 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.

imageobject

First frame image. Supplying it selects image-to-video mode.

imageobject
urlstring

First frame address; must be a publicly reachable URL.

last_frameobject

Last frame image. Supplied together with image, it pins both ends.

last_frameobject
urlstring

Last frame address; must be a publicly reachable URL.

reference_imagesarray<object>

Style and content reference images, up to 14.

reference_imagesarray<object>
urlstring

Reference image address; must be a publicly reachable URL.

generate_audiobooleanDefault true

Audio 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.

userstring

End-user identifier for abuse tracing. Send a hash rather than the raw value.

Response

200response

The task was created.

400response

Invalid request (value outside its domain, unsupported material combination, or neither prompt nor material supplied).

402response

Insufficient balance to reserve the cost of this task.

Value domains for this model

Resolution480p 720p
Duration1–15 seconds for plain text- and image-to-video; 10 seconds when reference_images or last_frame is present.
Reference imagesUp to 14
PromptOptional 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:

ModeRequired fields
Text to videoprompt only
Image to videoimage (first frame)
Reference to videoreference_images
First and last frameimage + 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
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>"
}