Grok Imagine Video icon
Video by xAI

Grok Imagine API

Generate AI video with xAI's Grok Imagine through one unified API. A single REST endpoint, async jobs, and webhooks, with no separate xAI account to manage.

Integrate Grok Imagine Video with a single API call — one key, one unified endpoint, and shared billing across every model on Apiframe.

model: "grok-imagine-video"

What's special about Grok Imagine Video

Native synchronized audio

It generates background music, sound effects, ambient audio, and lip-synced dialogue or singing in the same pass as the video, so no separate audio step is needed.

Image-to-video that stays faithful

Its strongest mode treats your source image as the first frame and animates from there, preserving the subject's identity, style, lighting, and color.

Aurora-engine motion coherence

It generates frames sequentially, keeping subjects, lighting, and camera stable across the clip, with refined physical simulation for hair, water, cloth, and micro-expressions.

A full video workflow

It covers text-to-video, image-to-video, video-to-video, video extension for chaining shots, and reference-guided generation to hold a look across clips.

Fast with variations

Clips render in well under a minute, and it can produce several creative variations at once for quick A/B testing.

Cinematic control and flexible formats

It follows camera moves, cuts, and timing cues, and outputs across many aspect ratios suited to social platforms.

Made with Grok Imagine Video

A few outputs generated through the Grok Imagine Video API on Apiframe.

A 5-second clip animating this portrait, the subject smiles, looks to camera, and says a short greeting, soft studio light.

A 5-second product clip, a slow push-in on a bottle as condensation forms, gentle rim light, light ambient sound.

A 5-second clip of this landscape coming alive, wind through the grass, drifting clouds, birds crossing, natural ambience.

A 5-second character clip, the figure turns and walks toward camera, dust kicking up, a low footstep rumble.

A 5-second sci-fi shot of a crystal-powered rocket launching from a red desert planet, roaring engine audio.

A 5-second anime-style clip of a girl on a rooftop at sunset, hair in the breeze, soft city ambience.

Overview

Endpoint
POST /v2/videos/generate
Model ID
grok-imagine-video
Params key
grokParams
Modality
Video
Provider
xAI
Avg. completion
~180s

Capabilities

Aspect ratios1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3
Durations6s, 10s, 15s
Image inputSupported
Avg. time~180s

Quick start

Send a single POST /v2/videos/generate request with your API key to generate with Grok Imagine Video. The call returns a jobId you can poll or receive via webhook.

curl -X POST https://api.apiframe.ai/v2/videos/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
        "prompt": "a cinematic sunrise over a futuristic cityscape, smooth camera push-in",
        "model": "grok-imagine-video",
        "grokParams": {
            "reference_images": [
                "https://example.com/input.jpg"
            ]
        }
    }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/videos/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a cinematic sunrise over a futuristic cityscape, smooth camera push-in",
        "model": "grok-imagine-video",
        "grokParams": {
            "reference_images": [
                "https://example.com/input.jpg"
            ]
        }
    },
)
print(response.json())  # { "jobId": "...", "status": "QUEUED" }
const response = await fetch("https://api.apiframe.ai/v2/videos/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "prompt": "a cinematic sunrise over a futuristic cityscape, smooth camera push-in",
    "model": "grok-imagine-video",
    "grokParams": {
      "reference_images": [
        "https://example.com/input.jpg"
      ]
    }
  }),
});
const { jobId } = await response.json();
console.log(jobId);

Response & job lifecycle

Generation is asynchronous. A successful submission returns 202 Accepted with a jobId. Poll GET /v2/jobs/{id} (or supply a webhook_url) until the status is COMPLETED; the result field then holds the output URL(s).

1. Submission response (202)

{
  "jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "status": "QUEUED"
}

2. Poll for the result

curl https://api.apiframe.ai/v2/jobs/JOB_ID \
  -H "X-API-Key: afk_your_api_key_here"
import requests, time

while True:
    job = requests.get(
        "https://api.apiframe.ai/v2/jobs/JOB_ID",
        headers={"X-API-Key": "afk_your_api_key_here"},
    ).json()
    if job["status"] in ("COMPLETED", "FAILED"):
        break
    time.sleep(2)
print(job["result"])
let job;
do {
  await new Promise((r) => setTimeout(r, 2000));
  job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
    headers: { "X-API-Key": "afk_your_api_key_here" },
  }).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);

Input schema

Request parameters accepted by the Grok Imagine Video endpoint. Model-specific options are nested under the params object shown below.

Parameter Type Required Default Allowed / range Description
prompt string required Text description of what to generate.
model string required "grok-imagine-video" "grok-imagine-video" The model identifier for this endpoint.
grokParams.reference_images string[] (URLs) optional Reference images

Frequently Asked Questions

Common questions about the Grok Imagine Video API.

What is Grok Imagine Video?

xAI's image-to-video and text-to-video model, powered by the Aurora engine, with version 1.5 as the current production release.

Does it generate audio?

Yes. It produces synchronized native audio in one pass, including music, sound effects, ambience, and lip-synced dialogue.

What workflows does it support?

Text-to-video, image-to-video, video-to-video, video extension, and reference-guided generation.

How long are the clips and what resolution?

Up to 15 seconds, at 480p or 720p and 24 frames per second.

How fast is it?

Clips typically render in well under a minute, and it can create several variations at once.

Where can you access it?

Through Apiframe, as well as the Grok app on X and the xAI API.

Still have questions?

Start building with the Grok Imagine Video API

Get your API key and integrate Grok Imagine Video in minutes — Pay-as-you-go.

Free credits to start
One API for every model
Webhooks, SDKs & idempotency
No provider account required

Questions? Join our Discord or contact sales.