v1

latestOpenAPI 3.1.02026-07-267724480.0 KB

Create an xAI video generation job

Start a Grok image-to-video job from a prompt and one source image. Save the returned request_id and poll the query endpoint until the provider status becomes done.

post/grok/v1/videos/generations

Request body

promptstring required

Prompt describing how the source image should animate. CometAPI requires this field for this route.

aspect_ratio'1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '3:2' | '2:3'

Output aspect ratio. Combine with resolution to choose the target frame; for example 480p with 1:1 targets 480x480, 720p with 16:9 targets 1280x720, and 720p with 9:16 targets 720x1280. This endpoint does not expose an exact size field.

durationinteger

Output duration in seconds. Use an integer from 1 through 15. If omitted, CometAPI treats the request as an 8-second generation for billing and default handling.

modelstring

xAI video model id. The default example uses Grok Imagine 1.5 for image-to-video.

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

Output resolution. Use 720p for a small image-to-video test, or 1080p when you need a higher resolution tier.

sizestring

Deprecated size field. Prefer aspect_ratio and resolution.

userstring

Optional end-user identifier.

Example request

{
  "prompt": "Animate the still image with a slow camera move and natural motion.",
  "model": "grok-imagine-video-1.5"
}

Response

Request accepted.

request_idstring required

Deferred request id used for polling.

Example response

{
  "request_id": "<request_id>"
}