Amux

Create xAI video

Last updated September 13, 2026

Submit a Grok Imagine video task in xAI's native shape. The prompt is optional; billing is per output second by resolution tier.

This endpoint is compatible with xAI's video generation API. If you already have xAI code, point base_url at this site — the request body and response shape match what your client sends today.

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

Authorization

header
AuthorizationstringRequired

Bearer <your Amux key> An Amux key created in the console. If you lose it, you can view it again on the keys page.

Request

application/json
modelstringRequired

Amux model id. Two models are available on this endpoint:

ModelResolutionDuration
x-ai/grok-imagine-video-1.5480p 720p 1080p1-15s
x-ai/grok-imagine-video480p 720p1-15s; 10s maximum with reference material
promptstring

Optional when material is supplied. Supplying neither returns a 400.

durationintegerDefault 8

Output length in seconds. Defaults to 8.

On x-ai/grok-imagine-video, including reference_images or

last_frame narrows the cap to 10 seconds; plain text- and

image-to-video still allow 15. Exceeding the cap 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" | "1080p"Default "480p"

Defaults to 480p (the upstream default). It is also the

pricing tier.

1080p is supported only on x-ai/grok-imagine-video-1.5.

imageobject

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

imageobject
urlstring

Image address. Must be a publicly fetchable URL.

last_frameobject

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

last_frameobject
urlstring

Last-frame image address.

reference_imagesarray<object>

Style and content reference images, up to 14.

reference_imagesarray<object>
urlstring

Reference image address.

generate_audiobooleanDefault true

Audio is generated by default. Pass false to produce output with no audio track.

moderation"low" | "auto" | "high"

Moderation strength. Omitted means the upstream default.

userstring

End-user identifier, used 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.

Supported models

ModelResolutionDurationReference image limit
x-ai/grok-imagine-video-1.5480p 720p 1080p1–15s14
x-ai/grok-imagine-video480p 720p1–15s (see below)14

⚠️ 1080p is supported only on x-ai/grok-imagine-video-1.5. Requesting it on x-ai/grok-imagine-video returns a 400 rather than a silent downgrade — with a downgrade, the mismatch would only surface after the task completed and was billed.

Exact value domains are also available from supported_parameters in GET /v1/models, which matches what is actually accepted.

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

prompt is optional when any material is supplied. This is the inverse of the MiniMax video endpoint, so no placeholder prompt is required when migrating from it. Supplying neither prompt nor material returns a 400.

Parameter behaviour

duration defaults to 8 seconds

This is the upstream default. When omitted, the output is 8 seconds long and billed as 8 seconds.

The duration cap on x-ai/grok-imagine-video varies by mode

This model supports up to 15 seconds for plain text- and image-to-video. Once the request includes reference_images or last_frame, the cap narrows to 10 seconds.

Exceeding the cap returns a synchronous 400 at submit time, not a late failure. x-ai/grok-imagine-video-1.5 has no such narrowing and supports 15 seconds across all four modes.

For image-to-video, the source image determines output size

In this mode aspect_ratio and resolution do not determine the output size — the aspect ratio always follows the supplied image. A 3:2 image yields a 3:2 video; specifying aspect_ratio: "16:9" does not change that.

Billing is unaffected: cost is computed from the requested resolution tier, independent of the actual pixel dimensions.

⚠️ The 1080p tier produces an actual height of 1088, not 1080 (H.264 macroblock alignment). This is encoder behaviour and affects neither tier selection nor billing.

Supplying input material

Unlike the other video endpoints on this site, each kind of material is its own top-level field rather than an entry in a shared array:

{
  "model": "x-ai/grok-imagine-video-1.5",
  "prompt": "Make the water crash down and slowly pan out the camera",
  "image": { "url": "https://…/waterfall.png" },
  "reference_images": [{ "url": "https://…/style.png" }]
}

⚠️ The address must be wrapped in an object ({"url": "…"}); a bare string is not accepted and returns a 400 explaining the correct form.

⚠️ reference_audios is not supported yet. That upstream field accepts preset voice identifiers (voice_id), not an audio file — the two are semantically different. Supplying it returns a 400 rather than being silently ignored.

Billing

cost = actual output seconds × resolution tier rate
     + input image count × per-image rate

Output seconds are taken from the value the upstream returns, not from the requested duration — for image-to-video the output length follows the material.

Resolution is the only tier dimension for the output charge; aspect_ratio takes effect but does not change the rate. First frame, last frame and reference images all count toward the input image total.

Cost is reserved at submit time from the requested duration and resolution, then settled against actual usage with the difference released.

Task id

The returned request_id is the Amux task id, not the upstream task handle. All retrieval paths accept only this id: GET /v1/tasks/{id} and the xAI-shaped alias 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-1.5",
    "prompt": "A red paper boat drifting down a rain puddle, camera slowly pans out",
    "duration": 8,
    "aspect_ratio": "16:9",
    "resolution": "480p"
  }'
{
  "request_id": "<string>"
}