Skip to main content
POST
Create video generation
/v1/videos/generations returns a task_id immediately after submission. Generation time depends on duration and resolution, and is generally one to five minutes. Poll /v1/tasks/{task_id} for status.
The video endpoint currently supports only the grok-imagine-video model. Inference and billing use the special pricing for the Grok route.

Request URL

Text-to-video example

Successful response:
After receiving task_id, call Retrieve video task.

Reference-image-to-video example

Convert reference images to data:image/...;base64,... Data URLs first. Browser blob: URLs cannot be submitted directly; your server must read the binary data and encode it.

Parameters

Duration and resolution combinations

  • Use 720p for final output. 480p generates faster and is suitable for previews.
  • Longer durations increase generation time and price. Start with seconds: "6" to validate the workflow.
  • When changing the same prompt to 9:16 or 1:1, describe where the subject should appear in the frame to avoid cropping.

Error handling

The video endpoint also uses the OpenAI-style error wrapper. See Errors for common errors. If a 400 response reports a reference-image problem, verify that:
  • The reference image is PNG, JPEG, or WebP.
  • It uses a Data URL, not a blob: URL or regular HTTP URL.
  • Each reference image is smaller than 10 MB.
  • The request includes no more than seven reference images.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
default:grok-imagine-video
required
prompt
string
required
Maximum string length: 2500
seconds
enum<string>
required
Available options:
6,
10,
12,
16,
20
size
enum<string>
required
Available options:
1280x720,
720x1280,
1024x1024
resolution_name
enum<string>
required
Available options:
480p,
720p
preset
enum<string>
required
Available options:
normal,
fun,
spicy,
custom
input_reference
string[]
Maximum array length: 7

data:image/...;base64,... Data URL

group
string

Response

Video task submission

data
object