Create video task (xAI shape)

The vendor-shaped entry point for Grok Imagine. If you already have xAI code, point base_url at this site — the request body and response shape match what your client sends today.

This endpoint is asynchronous: submitting returns a task id, and the result is retrieved by polling. That is the upstream API's own contract, not a limitation of this site.

Task id

The returned request_id is the Amux task id, not the upstream task handle. The upstream handle is not exposed: it would reveal which service fulfilled the call, and no endpoint on this site accepts it.

All retrieval paths accept only this id. GET /v1/tasks/{id} and the xAI-shaped alias below read the same task.

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 endpoint on this site, so no placeholder prompt is required when migrating from it.

post/v1/videos/generations

Request

  • Base URL: https://gateway.amux.ai
  • URL: https://gateway.amux.ai/v1/videos/generations
  • Auth: HTTP bearer

Request body

modelstring required

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.

durationinteger

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'

No effect for image-to-video: the output aspect ratio follows the supplied image.

resolution'480p' | '720p' | '1080p'

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

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

generate_audioboolean

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.

Example request

{
  "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"
}

Response

The task was created.

request_idstring

The Amux task id. All retrieval paths accept only this value.

Changes

No recorded changes to this operation across all 1 revision of this API.