ModelsPricingEnterprise
500+ AI Model API, All In One API.Just In CometAPI
Models API
Developer
Quick StartDocumentationAPI Dashboard
Company
About usEnterprise
Resources
AI ModelsBlogChangelogSupport
Terms of ServicePrivacy Policy
© 2026 CometAPI · All rights reserved
Home/Models/xAI/Grok Imagine Video
X

Grok Imagine Video

Per Second:$0.04
Generate videos from text prompts, animate still images, or edit existing videos with natural language. The API supports configurable duration, aspect ratio, and resolution for generated videos — with the SDK handling the asynchronous polling automatically.
New
Commercial Use
Playground
Overview
Features
Pricing
API

📘 Technical Specifications of Grok Imagine Video

SpecificationDetails
Model IDgrok-imagine-video
ProviderxAI
TypeVideo generation & editing AI
Input TypesText (prompt); optional image or video Text prompts (natural language); optional image input (image→video); optional video_url for editing existing clips. Editing input video max durations differ by endpoint — reported ~8.7s for some editing flows.
Output Types.mp4 video via temporary URL
Duration Range (generate)1–15 seconds
Resolution480p, 720p (configurable)
Aspect Ratios1:1, 16:9, 9:16
Edit SupportYes — animates & modifies videos up to 8.7s
ModerationContent moderation included
PricingCharged per second, varies by resolution

🚀 What is Grok Imagine Video?

Grok Imagine Video is xAI’s advanced video generation and editing AI model exposed through CometAPI. It lets developers generate short, custom videos from natural language prompts and optionally animate still images or edit existing clips. The model supports configurable output length, resolution, and aspect ratio, with built-in content moderation to ensure policy compliance.

🧠Main features (what differentiates Grok Imagine)

  • Native audio + lip-sync: Generates synchronized ambient audio, effects, and short speech / narration with approximate lip synchronization.
  • Image→Video / prompt editing: Animate a still or edit existing footage via text prompts (remove/replace objects, retime, restyle).
  • Fast iteration & low latency: Designed for quick feedback loops suitable for creative workflows and product prototyping.
  • Production API: Imagine API exposes programmatic endpoints for batch generation, integration into editing pipelines, and enterprise controls.
  • Multiple “modes” / styles: User-facing modes (reported examples: Normal / Fun / Spicy or similar presets) to bias outputs for style or permissiveness (note: “Spicy” mode historically enabled NSFW).
Model (company)Max res (public)Max clip len (public)Native audio?StrengthsCaveats
Grok Imagine (xAI)720p6–15sYesFast iteration, strong cost/latency, integrated editing, native audio720p cap; moderation concerns; varying real-world fidelity
Sora (OpenAI)720p–1080p (depends on tier)short (6–15s)YesHigh visual fidelity; strong integration with OpenAI stackMore expensive; constrained moderation/controls
Veo (Google DeepMind)Up to 1080p+short (varies)YesStrong photorealism, stable motionHigher cost; less public experimentation
Runway Gen-4.51080p+short (varies)YesIndustry adoption for creative workflows, high fidelityCostlier; focused on creative tooling
Vidu / Kling / Pika (various specialists)up to 1080pshort (varies)MixedSome offer niche features (Smart Cuts, multi-shot chaining)Varied audio support; differing API maturity

⚠️ Limitations

  • Maximum video length is capped at 15 seconds.
  • Editing retains input video length (≤ 8.7s).
  • Generated URLs are ephemeral — download promptly.

How to access and integrate Grok Imagine Video

Step 1: Sign Up for API Key

Log in to cometapi.com. If you are not our user yet, please register first. Sign into your CometAPI console. Get the access credential API key of the interface. Click “Add Token” at the API token in the personal center, get the token key: sk-xxxxx and submit.

Step 2: Send Requests to Grok Imagine Video API

Select the “grok-imagine-video” endpoint to send the API request and set the request body. The request method and request body are obtained from our website API doc. Our website also provides Apifox test for your convenience. Replace <YOUR_API_KEY> with your actual CometAPI key from your account. Where to call it: GROKVideo Generation and Video Edit.

Step 3: Send Requests to Grok Imagine Video API

Enter text or upload an image(You can optionally provide a source image to animate.). The Grok Imagine AI API analyzes your input and prepares the content for url. Both text-to-video and image-to-video conversion are supported.

The source image can be provided as:

  • A public URL pointing to an image
  • A base64-encoded data URI( e.g., data:image/jpeg;base64,<YOUR_BASE64_IMAGE>)

Step 4: Retrieve and Verify Results

Process the API response to get the generated answer. After processing, the API responds with the task status and output data. It returns a request_id immediately upon submission; use the GET endpoint to check status and retrieve the generated video. Video editing is asynchronous, you may need to poll this endpoint multiple times until the task is complete. Please download promptly.

FAQ

How do I generate a video using grok-imagine-video API?

You send a POST request with model 'grok-imagine-video' including a text prompt and optional image/video source; it returns a task ID, then poll this ID until the video status is 'done'.

What input formats does grok-imagine-video accept?

It accepts a natural language prompt and optional image URLs (or base64 images) for animation; for editing, a video URL is provided.

What are the maximum video duration and resolution options?

The model supports video generation up to 15 seconds and resolutions up to 720p with configurable aspect ratios like 16:9 or 1:1.

Can I animate a still image into a video with this model?

Yes, you can animate a still image into motion based on your prompt, using image URLs or encoded images in the request.

Does grok-imagine-video support editing existing videos?

Yes — provide the source video URL and your edit instructions; the output keeps the original video’s duration and resolution.

How does moderation work in grok-imagine-video outputs?

Generated videos are subject to content moderation; flagged content may be filtered or blocked during generation.

Is the video generation asynchronous?

Yes, the API returns a request ID which you poll to check when the video is ready for download.

How should I handle expired video URLs?

Downloaded videos should be saved quickly; temporary URLs may expire and become inaccessible after generation.

Features for Grok Imagine Video

Explore the key features of Grok Imagine Video, designed to enhance performance and usability. Discover how these capabilities can benefit your projects and improve user experience.

Pricing for Grok Imagine Video

Explore competitive pricing for Grok Imagine Video, designed to fit various budgets and usage needs. Our flexible plans ensure you only pay for what you use, making it easy to scale as your requirements grow. Discover how Grok Imagine Video can enhance your projects while keeping costs manageable.

Pricing Overview

CategoryItemPrice
Input PricingTextN/A (Free)
Image$0.0016
Video per second$0.008
Output Pricing480p$0.04
(Per second by resolution)720p$0.056

Note: When generating video via API, you are charged per second. You will also be charged when using video or images as input.

Sample code and API for Grok Imagine Video

Access comprehensive sample code and API resources for Grok Imagine Video to streamline your integration process. Our detailed documentation provides step-by-step guidance, helping you leverage the full potential of Grok Imagine Video in your projects.
POST
/grok/v1/videos/generations
Python
JavaScript
Curl
import os
import time
import requests

# Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
COMETAPI_KEY = os.environ.get("COMETAPI_KEY") or "<YOUR_COMETAPI_KEY>"
BASE_URL = "https://api.cometapi.com/grok/v1"

headers = {
    "Authorization": f"Bearer {COMETAPI_KEY}",
    "Content-Type": "application/json",
}

# ============================================================
# Step 1: Create Video Generation Task
# ============================================================
print("Step 1: Creating video generation task...")

create_payload = {
    "model": "grok-imagine-video",
    "prompt": "A glowing crystal-powered rocket launching from the red dunes of Mars, ancient alien ruins lighting up in the background as it soars into a sky full of unfamiliar constellations",
    "duration": 10,
    "aspect_ratio": "16:9",
    "resolution": "720p",
}

create_response = requests.post(
    f"{BASE_URL}/videos/generations", headers=headers, json=create_payload
)

create_result = create_response.json()
print(f"Create response: {create_result}")

# Extract task ID from the response
task_id = create_result.get("request_id") or create_result.get("id")
if not task_id:
    print("Error: Failed to get task ID from response")
    exit(1)

print(f"Task ID: {task_id}")

# ============================================================
# Step 2: Poll for Task Status
# ============================================================
print("
Step 2: Polling task status...")

while True:
    query_response = requests.get(
        f"{BASE_URL}/videos/{task_id}", headers=headers
    )
    query_result = query_response.json()

    data = query_result.get("data", {})
    status = data.get("status", "unknown")
    progress = data.get("progress", "0%")
    print(f"Status: {status}, Progress: {progress}")

    if status in ["FAILURE", "failed"]:
        print("Video generation failed!")
        print(f"Reason: {data.get('fail_reason')}")
        exit(1)

    if status == "SUCCESS":
        video_url = data.get("data", {}).get("video", {}).get("url")
        print(f"Video generation completed!")
        print(f"Video URL: {video_url}")
        break

    time.sleep(10)

Python Code Example

import os
import time
import requests

# Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
COMETAPI_KEY = os.environ.get("COMETAPI_KEY") or "<YOUR_COMETAPI_KEY>"
BASE_URL = "https://api.cometapi.com/grok/v1"

headers = {
    "Authorization": f"Bearer {COMETAPI_KEY}",
    "Content-Type": "application/json",
}

# ============================================================
# Step 1: Create Video Generation Task
# ============================================================
print("Step 1: Creating video generation task...")

create_payload = {
    "model": "grok-imagine-video",
    "prompt": "A glowing crystal-powered rocket launching from the red dunes of Mars, ancient alien ruins lighting up in the background as it soars into a sky full of unfamiliar constellations",
    "duration": 10,
    "aspect_ratio": "16:9",
    "resolution": "720p",
}

create_response = requests.post(
    f"{BASE_URL}/videos/generations", headers=headers, json=create_payload
)

create_result = create_response.json()
print(f"Create response: {create_result}")

# Extract task ID from the response
task_id = create_result.get("request_id") or create_result.get("id")
if not task_id:
    print("Error: Failed to get task ID from response")
    exit(1)

print(f"Task ID: {task_id}")

# ============================================================
# Step 2: Poll for Task Status
# ============================================================
print("\nStep 2: Polling task status...")

while True:
    query_response = requests.get(
        f"{BASE_URL}/videos/{task_id}", headers=headers
    )
    query_result = query_response.json()

    data = query_result.get("data", {})
    status = data.get("status", "unknown")
    progress = data.get("progress", "0%")
    print(f"Status: {status}, Progress: {progress}")

    if status in ["FAILURE", "failed"]:
        print("Video generation failed!")
        print(f"Reason: {data.get('fail_reason')}")
        exit(1)

    if status == "SUCCESS":
        video_url = data.get("data", {}).get("video", {}).get("url")
        print(f"Video generation completed!")
        print(f"Video URL: {video_url}")
        break

    time.sleep(10)

JavaScript Code Example

// Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
const api_key = process.env.COMETAPI_KEY || "<YOUR_COMETAPI_KEY>";
const base_url = "https://api.cometapi.com/grok/v1";

const headers = {
  "Authorization": `Bearer ${api_key}`,
  "Content-Type": "application/json",
};

// ============================================================
// Step 1: Create Video Generation Task
// ============================================================
console.log("Step 1: Creating video generation task...");

const createPayload = {
  model: "grok-imagine-video",
  prompt: "A glowing crystal-powered rocket launching from the red dunes of Mars, ancient alien ruins lighting up in the background as it soars into a sky full of unfamiliar constellations",
  duration: 10,
  aspect_ratio: "16:9",
  resolution: "720p",
};

const createResponse = await fetch(`${base_url}/videos/generations`, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(createPayload),
});

const createResult = await createResponse.json();
console.log("Create response:", JSON.stringify(createResult, null, 2));

const taskId = createResult?.request_id || createResult?.id;
if (!taskId) {
  console.log("Error: Failed to get task ID from response");
  process.exit(1);
}

console.log(`Task ID: ${taskId}`);

// ============================================================
// Step 2: Poll for Task Status
// ============================================================
console.log("\nStep 2: Polling task status...");

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

while (true) {
  const queryResponse = await fetch(`${base_url}/videos/${taskId}`, {
    method: "GET",
    headers: headers,
  });

  const queryResult = await queryResponse.json();
  const data = queryResult?.data || {};
  const status = data?.status || "unknown";
  const progress = data?.progress || "0%";
  console.log(`Status: ${status}, Progress: ${progress}`);

  if (["FAILURE", "failed"].includes(status)) {
    console.log("Video generation failed!");
    console.log(`Reason: ${data?.fail_reason}`);
    process.exit(1);
  }

  if (status === "SUCCESS") {
    const videoUrl = data?.data?.video?.url;
    console.log("Video generation completed!");
    console.log(`Video URL: ${videoUrl}`);
    break;
  }

  await sleep(10000);
}

Curl Code Example

#!/bin/bash

# Get your CometAPI key from https://api.cometapi.com/console/token
# Export it as: export COMETAPI_KEY="your-key-here"

BASE_URL="https://api.cometapi.com/grok/v1"

# ============================================================
# Step 1: Create Video Generation Task
# ============================================================
echo "Step 1: Creating video generation task..."

CREATE_RESPONSE=$(curl -s --location --request POST "${BASE_URL}/videos/generations" \
  --header "Authorization: Bearer $COMETAPI_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '{
    "model": "grok-imagine-video",
    "prompt": "A glowing crystal-powered rocket launching from the red dunes of Mars, ancient alien ruins lighting up in the background as it soars into a sky full of unfamiliar constellations",
    "duration": 10,
    "aspect_ratio": "16:9",
    "resolution": "720p"
  }')

echo "Create response: $CREATE_RESPONSE"

# Extract task ID using jq (install with: brew install jq)
TASK_ID=$(echo "$CREATE_RESPONSE" | jq -r '.request_id // .id')

if [ "$TASK_ID" == "null" ] || [ -z "$TASK_ID" ]; then
  echo "Error: Failed to get task ID from response"
  exit 1
fi

echo "Task ID: $TASK_ID"

# ============================================================
# Step 2: Poll for Task Status
# ============================================================
echo ""
echo "Step 2: Polling task status..."

while true; do
  QUERY_RESPONSE=$(curl -s --location --request GET "${BASE_URL}/videos/${TASK_ID}" \
    --header "Authorization: Bearer $COMETAPI_KEY")

  STATUS=$(echo "$QUERY_RESPONSE" | jq -r '.data.status')
  PROGRESS=$(echo "$QUERY_RESPONSE" | jq -r '.data.progress')
  echo "Status: $STATUS, Progress: $PROGRESS"

  if [ "$STATUS" == "FAILURE" ] || [ "$STATUS" == "failed" ]; then
    echo "Video generation failed!"
    echo "$QUERY_RESPONSE" | jq -r '.data.fail_reason'
    exit 1
  fi

  if [ "$STATUS" == "SUCCESS" ]; then
    VIDEO_URL=$(echo "$QUERY_RESPONSE" | jq -r '.data.data.video.url')
    echo "Video generation completed!"
    echo "Video URL: $VIDEO_URL"
    break
  fi

  sleep 10
done

More Models

O

Sora 2 Pro

Per Second:$0.24
Sora 2 Pro is our most advanced and powerful media generation model, capable of generating videos with synchronized Audio. It can create detailed, dynamic video clips from natural language or images.
O

Sora 2

Per Second:$0.08
Super powerful video generation model, with sound effects, supports chat format.
M

mj_fast_video

Per Request:$0.6
Midjourney video generation
D

Doubao-Seedance-2-0

D

Doubao-Seedance-2-0

Coming soon
Input:$60/M
Output:$240/M
Seedance 2.0 is ByteDance’s next-generation multimodal video foundation model focused on cinematic, multi-shot narrative video generation. Unlike single-shot text-to-video demos, Seedance 2.0 emphasizes reference-based control (images, short clips, audio), coherent character/style consistency across shots, and native audio/video synchronization — aiming to make AI video useful for professional creative and previsualization workflows.
G

Veo 3.1 Pro

Per Second:$0.25
Veo 3.1-Pro refers to the high-capability access/configuration of Google’s Veo 3.1 family — a generation of short-form, audio-enabled video models that add richer native audio, improved narrative/editing controls and scene-extension tools.
G

Veo 3.1

Per Second:$0.05
Veo 3.1 is Google’s incremental-but-significant update to its Veo text-and-image→video family, adding richer native audio, longer and more controllable video outputs, and finer editing and scene-level controls.

Related Blog

How to Delete Grok Imagine Videos in 2026: Complete Step-by-Step Guide
Apr 15, 2026
grok-imagine-video

How to Delete Grok Imagine Videos in 2026: Complete Step-by-Step Guide

To permanently delete a Grok Imagine video, open Grok (grok.com or the X app), go to the Imagine tab or your profile > Files, locate the video (often auto-saved as a favorite), hover or tap the heart icon to unsave it, then use the three-dot menu > “Delete Post” and confirm. A warning appears: “You won’t be able to view this content again.” For bulk deletion or full history, go to Settings > Data Controls > Delete files/assets or conversations. Note: xAI retains data for up to 30 days per its privacy policy. For developers seeking reliable, API-driven video generation with stronger data controls, CometAPI provides unified access to 500+ models without Grok’s paywall restrictions.
How to Get Grok Imagine for Free: Access, Pricing, and Alternatives
Mar 25, 2026
grok-imagine-video

How to Get Grok Imagine for Free: Access, Pricing, and Alternatives

Grok Imagine Video is not free on official xAI/Grok platforms as of March 2026 (free tier removed due to high demand and misuse concerns), but you can access it affordably — or with free starter credits — via third-party aggregators like CometAPI. CometAPI offers the model at just $0.04 per second (480p), with new users often receiving $1–$5 in free credits upon signup.
What is Seedance 2.0? A Comprehensive Analysis
Mar 24, 2026
seedance-2-0

What is Seedance 2.0? A Comprehensive Analysis

Seedance 2.0 is a next-generation multimodal AI video generation model developed by ByteDance that can generate high-quality, cinematic videos from text, images, audio, and reference videos. It features audio-video joint generation, motion stability, and reference-based editing, and has rapidly climbed global benchmarks like the Artificial Analysis leaderboard, positioning itself among the top AI video models in 2026.
What is Grok 4.2: Features, Architecture and Comparisons
Mar 12, 2026
grok-4-2

What is Grok 4.2: Features, Architecture and Comparisons

Grok 4.2 is xAI’s public-beta flagship in the Grok 4 family: a multi-agent, tool-enabled generation model with industry-leading throughput, a giant 2,000,000-token agent mode context window, and specialized API variants such as grok-4.20-multi-agent-beta-0309, grok-4.20-beta-0309-reasoning, and grok-4.20-beta-0309-non-reasoning. It’s optimized for fast, agentic workflows (real-time X data / tool calling), is available in Web, iOS/Android and early API channels eg CometAPI, and is aimed at users needing fast, live-data aware assistants rather than the deepest long-form reasoning.
How to Use Grok 4.2 API in 2026
Mar 12, 2026
grok-4-2

How to Use Grok 4.2 API in 2026

Grok 4.2 is xAI’s latest multi-agent reasoning model that combines four cooperating agents and new agentic tool-calling features to deliver much faster, lower-hallucination inference for enterprise workloads. To call it today most developers either (a) use the official xAI REST/gRPC endpoints or (b) call it through an aggregator like CometAPI (single REST endpoint,post https://api.cometapi.com/v1/responsess) which simplifies keys, billing, and multi-model switching.