The Grok Imagine API for video on APIMart runs xAI's grok-imagine-video model: text to video, image to video from one or more reference images, and editing of an existing clip. Clips last 1–15 seconds at 480p or 720p, and you pay per second of output.
Generate from a prompt, with optional reference images to guide the result.
Review the prompt and input images before submission. Flagged requests create no task and incur no charge.
The video link is valid for 72 hours. Download or save it promptly.
Transparent pricing with no hidden fees. Pay only for what you use.
| Variant | Tier | GoldCurrent price | Platinum | Diamond | Official | Your savings |
|---|---|---|---|---|---|---|
grok-imagine-video | Reference image (each) | 0.016Credits(~$0.0016)/pic | 0.0152Credits(~$0.0015)/pic | 0.0144Credits(~$0.0014)/pic | 0.02Credits(~$0.002)/pic | 20% |
| Reference video (per source second) | 0.08Credits(~$0.008)/sec | 0.076Credits(~$0.0076)/sec | 0.072Credits(~$0.0072)/sec | 0.1Credits(~$0.01)/sec | 20% | |
| 480P | 0.4Credits(~$0.04)/sec | 0.38Credits(~$0.038)/sec | 0.36Credits(~$0.036)/sec | 0.5Credits(~$0.05)/sec | 20% | |
| 720P | 0.56Credits(~$0.056)/sec | 0.532Credits(~$0.0532)/sec | 0.504Credits(~$0.0504)/sec | 0.7Credits(~$0.07)/sec | 20% |
* Actual costs are subject to final output.
One endpoint, three modes: send a prompt for text to video, add image_urls to animate stills, or pass video.url to edit footage you already have. Need 1080p? Grok Imagine Video 1.5 has its own page; this page covers the base grok-imagine-video model, the only one that supports video editing.
50K+
Active Users
99.9%
Uptime
2x
Faster
—
Cost Savings
Call the Grok Imagine Video API on APIMart with one POST request. Generation is asynchronous: submit a task, then poll the task endpoint to get the video URL.
Save the key you created above in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.
POST /v1/videos/generations with model grok-imagine-video, your prompt, duration, resolution and aspect_ratio. Add image_urls for image to video, or send video.url alone to edit a clip. The task ID is in data[0].task_id.
Poll GET /v1/tasks/{task_id} until status is completed, then read the video URL from data.result.videos[0].url[0] and save it before expires_at. A failed task returns its reason in data.error.message and costs nothing.
See the Grok Imagine Video API reference for every field, response and error code.
curl -X POST https://api.apimart.ai/v1/videos/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video",
"prompt": "A slow dolly-in on a ceramic coffee mug on a wooden table as steam rises, warm morning light through a window, shallow depth of field",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}'import os
import time
import requests
API_BASE = "https://api.apimart.ai"
headers = {"Authorization": f"Bearer {os.environ['APIMART_API_KEY']}"}
# 1. Submit the generation task
payload = {
"model": "grok-imagine-video",
"prompt": "A slow dolly-in on a ceramic coffee mug on a wooden table as steam rises, warm morning light through a window, shallow depth of field",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
resp = requests.post(f"{API_BASE}/v1/videos/generations", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
task_id = resp.json()["data"][0]["task_id"]
# 2. Poll the task until it finishes
for _ in range(200):
task_resp = requests.get(f"{API_BASE}/v1/tasks/{task_id}", headers=headers, timeout=30)
task_resp.raise_for_status()
task = task_resp.json()["data"]
if task["status"] == "completed":
print(task["result"]["videos"][0]["url"][0])
break
if task["status"] == "failed":
raise RuntimeError(task.get("error", {}).get("message", "generation failed"))
time.sleep(10)
else:
raise TimeoutError(f"task {task_id} did not finish in time")curl -X POST https://api.apimart.ai/v1/videos/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-video",
"prompt": "The woman in the photo turns toward the camera and smiles as the wind moves her hair, slow push-in, soft daylight",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"image_urls": [
"https://example.com/portrait.jpg"
]
}'TASK_ID="task_xxx" # replace with the task_id returned by the POST request
curl "https://api.apimart.ai/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $APIMART_API_KEY"| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Required | Default: grok-imagine-video | grok-imagine-video. Use grok-imagine-video-1.5 for 1080p output; video editing works only with grok-imagine-video. |
prompt | string | Required | Default: — | Video description or editing instruction, 1 to 8,000 characters after trimming spaces. |
duration | integer | Optional | Default: 8 | Output length, a whole number from 1 to 15 seconds. Generation only. |
resolution | string | Optional | Default: 480p | 480p or 720p. Generation only. |
aspect_ratio | string | Optional | Default: auto | auto, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2 or 2:3. Generation only. |
image_urls | array | Optional | Default: — | Public HTTPS image URLs for Grok image to video. Order is kept and each image is billed. Omit the field for text to video instead of sending an empty array. |
video.url | string | Optional | Default: — | Public HTTPS URL of the source video for editing. Send only model, prompt, video and optional nsfw_check in an edit request. |
nsfw_check | boolean | Optional | Default: false | Set true to moderate the prompt and input images before the task is submitted. |
What the grok-imagine-video model accepts and returns, taken from the APIMart API reference
Typical jobs for text to video, image to video and video editing
Three steps from sign-up to your first Grok video
Sign up with email, Google or GitHub. You can add an organization for your team at any time.
Add funds to your account. The balance works across every model on the platform, including Grok Imagine Video.
Create a key in the dashboard and use it in the Authorization header of every request.
Real feedback from creators and developers worldwide. These reviews describe experiences with the Grok Imagine Video series.
“The simplicity is brilliant - just a prompt and you get usable video output. Great for rapid prototyping.”
Alex Morgan
Creative Director
“Grok Imagine Video on APIMart has changed our content pipeline. We produce far more video content with the same team.”
Sarah Kim
Marketing Manager
“The video quality is impressive. Great motion coherence and visual fidelity from the text-to-video engine.”
James Wilson
Full-Stack Developer
“We integrated it into our SaaS platform in under a day. The minimal interface made it incredibly easy.”
Lisa Chen
CTO, StartupAI
“As an indie filmmaker, this tool has been a game-changer for creating concept visualizations and storyboard animations.”
Marco Rivera
Independent Filmmaker
“Reliable infrastructure on APIMart combined with Grok's video quality has made it our default for short clips.”
Emily Zhang
DevOps Engineer
Calling, pricing and model choice for grok-imagine-video
It is APIMart's access to xAI's grok-imagine-video model, the video side of the Grok Imagine API. One endpoint handles text to video, image to video from reference images and editing of an existing video, producing 1–15 second clips at 480p or 720p.
Both models share the same endpoint, prompt limit, 1–15 second duration and reference-image support. grok-imagine-video outputs 480p or 720p and is the only one that can edit an existing video. grok-imagine-video-1.5 adds 1080p output but has no video editing, and it has its own page on APIMart. Prices differ by model and resolution; check each page's pricing table.
Send POST /v1/videos/generations with your API key, model grok-imagine-video and a prompt, then read data[0].task_id from the response. Poll GET /v1/tasks/{task_id} until status is completed and read the video from data.result.videos[0].url[0]. The cURL and Python examples on this page follow that flow, and the full reference is on docs.apimart.ai.
model and prompt are required; prompt can be up to 8,000 characters. For generation you can add duration (1–15 seconds, default 8), resolution (480p or 720p, default 480p), aspect_ratio (auto, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2 or 2:3, default auto) and image_urls. For editing, send video.url instead. nsfw_check is optional in both modes.
Add one or more public HTTPS image URLs in image_urls together with your prompt. With one image, the model animates that still; with several, you can describe each one's role in the prompt, for example the first image as the subject and the second as the style. Leave image_urls out entirely for text to video; do not send an empty array.
Yes, with grok-imagine-video only. Send model, prompt and video.url (a public HTTPS video URL), plus nsfw_check if you want moderation. Do not send duration, resolution, aspect_ratio or image_urls; the platform reads the length of the source video. grok-imagine-video-1.5 does not support editing.
You pay per second of output video at the rate for the chosen resolution, plus a small fee per reference image; editing is billed per second of source video. At Gold member rates in October 2026, an 8-second 480p clip costs 8 × $0.04 = $0.32, a 10-second 720p image to video clip with one reference image costs 10 × $0.056 + $0.0016 = $0.5616, and editing a 6-second clip costs 6 × ($0.056 + $0.008) = $0.384. The pricing table on this page always shows current rates, and the final charge is the cost field of the finished task.
Generation is asynchronous, so the time depends on clip length, resolution and queue load rather than a fixed number of seconds. Poll the task every few seconds and resume polling with the saved task ID if your process restarts. Download or copy the result before the time in expires_at, because result URLs expire.
Describe the subject, the action, the camera move and the lighting in that order, for example a slow dolly-in on a ceramic mug as steam rises in warm morning light. For image to video, describe the motion you want rather than repeating what is already in the picture. Test ideas as short 480p clips, then render the version you keep at 720p.
A failed task returns status failed with a reason in data.error.message, and its cost is 0. HTTP 429 means requests are arriving too quickly: wait for the Retry-After time or back off before retrying. To avoid paying twice when a network error interrupts a submission, resend it with the same Idempotency-Key and request body.
No. The xAI Grok Imagine Video API has no free quota on APIMart. It is pay-as-you-go and billed per second of generated video, failed tasks are not charged, and every price on this page is 20% off.
Yes. The pricing table on this page shows the Gold member price, 20% off the original rate. Platinum and Diamond members save more, up to 28%. You only pay for successful requests.
Sign up for APIMart, open the API Keys page in your dashboard and create a key. The same key calls the Grok Imagine Video API and every other model on the platform, with pay-as-you-go billing and no subscription. Keep the key on your server, not in browser code.
Grok Imagine is xAI's name for its image and video generation, and grok-imagine-video is the xAI video model this page calls. You may also see it written as Grok Imagine AI, GrokImagine or Grok I2V for the image to video mode. Grok image models such as grok-imagine-image are separate and have their own pages.
Explore more models in the same category.

Wan 3.0 Video
Wan 3.0 is Alibaba's all-in-one video model for text-to-video, first-frame, first-and-last-frame and multimodal reference generation. It accepts image, video, audio and document references and outputs 2–30 second videos at 480P, 720P or 1080P.

Seedance 2.5
Seedance 2.5 is ByteDance's audio-video model for text-to-video, multimodal reference, editing, extension and first-last-frame control. Generate up to 30 seconds in one job with up to 30 images, 10 videos and 10 audio clips as references, at up to 1080p.

Flux 3 Video
FLUX 3 Video by Black Forest Labs supports text-to-video, image-to-video with ordered keyframes and video continuation. It generates 5–20 second HD or FHD clips with synchronized audio in seven aspect ratios.

MiniMax H3
MiniMax H3 is MiniMax's video model for text-to-video, image-to-video with first and last frames, and multimodal reference-to-video using images, videos and audio. It outputs 4–15 second clips at 2K or 768P with an audio track.