Skip to main content
xAIFastHigh

Grok Imagine Video

Generate videos with xAI's Grok Imagine Video model over the direct xAI API. Text-to-video and image-to-video with synchronized audio. For editing an existing clip, use xai/grok-imagine-video/edit.

1300 credits
per 8s video (default) โ€” billed per second (480p 116/s, 720p 163/s)
Text-to-video and image-to-video generation
Synchronized audio track included
480p or 720p output, 1-15 seconds
Per-second billing differentiated by resolution

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

Quick Start

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "xai/grok-imagine-video",
  "input": {
    "prompt": "a penguin walks away from the camera, towards a large snowy mountaintop in the distance",
    "duration": 8,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }
}'

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-Text prompt for video generation
imagestringNo-Input image to generate video from (image-to-video). Supports jpg, jpeg, png, webp
durationintegerNo8Duration of the video in seconds (1-15)
resolutionstringNo-Resolution of the video. When omitted, billing uses the 720p rate โ€” set it explicitly
480p720p
aspect_ratiostringNo16:9Aspect ratio of the output video ('auto' is not accepted by the direct xAI API)
16:94:31:19:163:43:22:3

How to Provide File Input

There are 3 ways to provide files for the image parameter:

Recommended

Image URL

Pass a publicly accessible URL directly. With the Storage API (POST /v1/files/upload-url) the file uploads straight to S3 (50MB per file) and you pass the returned file_url.

{
  "model": "xai/grok-imagine-video",
  "input": {
    "prompt": "your prompt here",
    "image": "https://example.com/image.jpg"
  }
}

Direct Upload (Multipart)

Attach files directly to POST /v1/predictions/upload. No separate upload step, but the bytes pass through the API server so the whole request is capped at 10MB.

curl -X POST "https://api.core.today/v1/predictions/upload" \
  -H "X-API-Key: cdt_your_api_key" \
  -F "model=xai/grok-imagine-video" \
  -F 'input={"prompt":"your prompt here"}' \
  -F "file:image=@your_file.png"
See the File Upload docs for more upload methods including Presigned URLs.

Common Parameters

Common parameters used when calling POST /v1/predictions.

ParameterTypeRequiredDefaultDescription
modelstringYes-Model identifier
inputobjectYes-Object containing the model-specific parameters from the table above
output_folderstringNo-Folder path for output files (max 256 chars, '..' not allowed)
webhook_urlstringNo-Webhook URL to call on completion
is_publicbooleanNofalseIf true, output files are also available via permanent public URLs

Examples

Text-to-Video (720p)

Generate an 8-second clip directly from a text prompt

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "xai/grok-imagine-video",
  "input": {
    "prompt": "a penguin walks away from the camera, towards a large snowy mountaintop in the distance",
    "duration": 8,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }
}'

Budget Clip (480p)

480p costs ~28% less per second than 720p

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "xai/grok-imagine-video",
  "input": {
    "prompt": "a lone astronaut walking across a red Martian desert as twin suns set on the horizon",
    "duration": 15,
    "resolution": "480p",
    "aspect_ratio": "16:9"
  }
}'

Tips & Best Practices

1Always set resolution explicitly โ€” omitting it bills at the 720p rate
2Duration ranges 1-15 seconds; cost scales linearly per second
3To edit an existing clip, use xai/grok-imagine-video/edit (this model no longer takes a video input)
4For native 1080p and higher fidelity, use xai/grok-imagine-video-1.5

Use Cases

Quick text-to-video clips for social content
Animating a still image into short motion
Iterating on video length up to 15 seconds
Vertical or square clips using explicit aspect ratios