APIMart
Grok Imagine Video model icon
Video

Grok Imagine Video API

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.

Video GenerationImage to VideoVideo Editing

Service Highlights

  • Official Discounts
  • Pay-as-you-go
  • Fast & Low Latency
Input

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.

52 / 8000 characters
8s
Output

The video link is valid for 72 hours. Download or save it promptly.

Grok Imagine Video API Pricing

Transparent pricing with no hidden fees. Pay only for what you use.

VariantTierGoldCurrent pricePlatinumDiamondOfficialYour savings
grok-imagine-videoReference image (each)0.016Credits(~$0.0016)/pic0.0152Credits(~$0.0015)/pic0.0144Credits(~$0.0014)/pic0.02Credits(~$0.002)/pic20%
Reference video (per source second)0.08Credits(~$0.008)/sec0.076Credits(~$0.0076)/sec0.072Credits(~$0.0072)/sec0.1Credits(~$0.01)/sec20%
480P0.4Credits(~$0.04)/sec0.38Credits(~$0.038)/sec0.36Credits(~$0.036)/sec0.5Credits(~$0.05)/sec20%
720P0.56Credits(~$0.056)/sec0.532Credits(~$0.0532)/sec0.504Credits(~$0.0504)/sec0.7Credits(~$0.07)/sec20%

* Actual costs are subject to final output.

xAI Grok Imagine Video API for Text to Video, Image to Video and Video Editing

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

Grok Imagine Video API Example: Text to Video and Image to Video

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.

  1. 1

    Authenticate Grok Imagine Video API requests

    Save the key you created above in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.

  2. 2

    Submit a Grok video task

    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.

  3. 3

    Get the Grok Imagine Video result

    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.

POST /v1/videos/generations
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"
  }'

Grok Imagine Video API Parameters

ParameterTypeRequiredDefaultDescription
modelstringRequiredDefault: grok-imagine-videogrok-imagine-video. Use grok-imagine-video-1.5 for 1080p output; video editing works only with grok-imagine-video.
promptstringRequiredDefault: —Video description or editing instruction, 1 to 8,000 characters after trimming spaces.
durationintegerOptionalDefault: 8Output length, a whole number from 1 to 15 seconds. Generation only.
resolutionstringOptionalDefault: 480p480p or 720p. Generation only.
aspect_ratiostringOptionalDefault: autoauto, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2 or 2:3. Generation only.
image_urlsarrayOptionalDefault: —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.urlstringOptionalDefault: —Public HTTPS URL of the source video for editing. Send only model, prompt, video and optional nsfw_check in an edit request.
nsfw_checkbooleanOptionalDefault: falseSet true to moderate the prompt and input images before the task is submitted.