Amux

Create video task

Last updated September 13, 2026

Generate with `x-ai/grok-imagine-video` in the unified shape, with `media[]` and callbacks.

Generate video with x-ai/grok-imagine-video using this site's unified request shape.

POSThttps://gateway.amux.ai/v1/tasks

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.

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.

mediaarray<object>

The unified way to supply material, as an alternative to the four dedicated fields above. Each entry looks like {{"type":"first_frame","url":"…"}}, where type is first_frame, last_frame or reference_image.

mediaarray<object>
typestring

Material role.

urlstring

Material address.

webhook_urlstring

Called back when the task reaches a terminal state, removing the need to poll.

Response

200response

The task was created; the unified task shape is returned.

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.

The only difference from the native xAI shape is notation: same model, same value domains, same billing. The unified shape adds two things:

  • media[] — the unified way to supply material, as an alternative to the image / last_frame / reference_images fields;
  • webhook_url — a callback when the task reaches a terminal state, removing the need to poll.

Prefer this endpoint when scheduling models across vendors from one request builder.

Material notation

// Native xAI shape
{ "image": { "url": "https://…/a.png" } }

// Unified shape
{ "media": [{ "type": "first_frame", "url": "https://…/a.png" }] }

type is one of first_frame, last_frame or reference_image.

Value domains and billing

Identical to the native xAI shape; not repeated here.

cURL
curl https://gateway.amux.ai/v1/tasks \
  -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"
  }'
{
  "id": "task_01M2D8FH1TKGP6VJJX1X3SYY7Q",
  "status": "queued",
  "model": "x-ai/grok-imagine-video",
  "created_at": "<string>",
  "output": {
    "images": [
      {}
    ],
    "videos": [
      {
        "index": 0,
        "url": "<string>"
      }
    ]
  },
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0,
    "output_video_seconds": 0
  },
  "cost": "0.08",
  "notes": [
    "<string>"
  ],
  "error": {
    "message": "<string>",
    "code": "<string>"
  }
}