Skip to main content

Overview

Grok Imagine Video is the official channel for xAI’s video models: requests are relayed by APIYI to the official xAI API, pricing matches xAI’s list price, and billing follows generated seconds and resolution. The API is an OpenAI Videos-compatible asynchronous task endpoint (/v1/videos) supporting text-to-video and image-to-video, and every video comes with an audio track. Three models are available:
  • grok-imagine-video: the base model, 480p / 720p
  • grok-imagine-video-1.5: the newer model, 480p / 720p / 1080p
  • grok-imagine-video-1.5-lite: lightweight 1.5, the lowest price at 480p / 720p
🔒 This channel requires the GrokOfficial group, granted on applicationGrok Imagine Video is not in the Default group. This family’s content-safety policy differs substantially from the other models on the platform, so to limit compliance risk we grant access selectively:
  • Existing customers with $1,000+ in cumulative spend: contact support, describe your use case, and we enable it after verification
  • Everyone else: apply through WeCom support, describing your use case and your content-moderation controls; we enable it once approved
A Token without the GrokOfficial group returns 503 — a permissions problem, not an outage. See Group Setup below.
⚠️ Without size, the default is 480p and 8 secondsIf you submit without a resolution or duration, the video is generated and billed at 480p, 8 seconds. For 720p / 1080p or a shorter clip, pass size (such as "1280x720") and seconds explicitly.

Video Generation API

Submit text-to-video / image-to-video tasks, with an interactive Playground.

Grok Imagine Official Images

Same GrokOfficial group — image generation priced the same as xAI, by tier.

Let an AI Agent Integrate It

Copy this prompt and paste it into Codex / Claude Code / Cursor

It fetches the plain-text version of this page first (append .md to any docs URL), then writes code for your stack — the async three-step flow, the 480p / 8-second default, billed moderation blocks, and saving the video right away are already baked into the requirements.

Integrate / troubleshoot Grok Imagine video generation (text-to-video + image-to-video) in this project.

Read the docs before writing code: fetch https://docs.apiyi.com/en/api-capabilities/grok-imagine-video/overview.md for the plain-text version of this page; …

  1. Pick one model: grok-imagine-video, grok-imagine-video-1.5, or grok-imagine-video-1.5-lite …

8 requirements in total — use the button below to copy the full version

Models & Pricing

Pricing matches xAI’s list price and is charged per second of generated video; the rate depends on model and resolution:
Model pricing is aligned with the official sites and may change when they do; the table above is for reference only, and the Model Pricing tab in the top navigation is authoritative: Model Pricing.
Billing notes and an example
  • Cost = seconds × per-second rate + input images × per-image fee. Example: a 1-second 480p image-to-video job on grok-imagine-video = 1 × $0.05 + 1 × $0.002 = $0.052 (matches the bill in our tests).
  • Defaults are billed too: without size / seconds the job runs at 480p for 8 seconds — $0.40 on grok-imagine-video.
  • Audio is not billed separately: videos include an audio track by default, and turning it off does not lower the price.
  • Moderation blocks are billed: xAI charges for videos its moderation blocks, and we bill on the same basis — see the FAQ.
  • Tiered top-up bonuses apply on top; high-volume business customers can contact sales about dedicated pricing.

Group Setup

Grok Imagine Video is not in the Default group. It lives in the GrokOfficial group (same price as xAI, i.e. the table above), shared with Grok Imagine Official Images, and access must be requested.

Who can get access

How to apply

1

Contact WeCom support

Apply through WeCom support, or email [email protected]. Say you are applying for GrokOfficial (Grok Imagine Official).
2

Describe your use case and moderation controls

Cover three things: what the videos are for, who the end users are, and what content review and human checks you run on your side. The more specific, the faster the review.
3

Switch your Token group once approved

Once approved, we enable GrokOfficial on your account. Go to the Token page in the console, switch the Token you use for this channel to GrokOfficial, and set the billing mode to Pay-as-you-go Priority or Pay-as-you-go.
What it looks like before access is granted: a Token without the GrokOfficial group returns 503 (no available channel in the current group). Retrying will not help — the group has to be enabled first.Do not use the Pay-per-request billing mode: this channel is billed per second, so a pay-per-request Token cannot be routed and also returns 503.
Compliance reminder: once access is granted, responsibility for generated content lies with the caller. Follow local laws and regulations; do not generate illegal content, content that infringes others’ likeness or intellectual property, or content inappropriate for minors. For consumer-facing distribution, add your own moderation layer. Background: Compliance notes for calling overseas models. We revoke group access when abuse is found.

Technical Specs

Endpoints

Primary domain https://api.apiyi.com, backup domain https://b.apiyi.com. Full code samples: Video Generation API.

End-to-end flow (Python)

Key Parameters

size (resolution and aspect ratio)

size uses WIDTHxHEIGHT pixels; the gateway picks the resolution tier from the shorter side and snaps the aspect ratio to the nearest supported one: You can also pass "480p" / "720p" / "1080p" directly, or skip size and send xAI’s native fields resolution (480p / 720p / 1080p) plus aspect_ratio (such as 9:16); when both are present, resolution / aspect_ratio win. With neither, the video is generated at 480p.
grok-imagine-video supports only 480p / 720p; a 1080p-class size returns 400: grok-imagine-video resolution must be one of 480p, 720p.

seconds (duration)

An integer from 1 to 15, as a string ("5") or a number (5); default 8. Out-of-range values return 400: duration must be an integer between 1 and 15. Cost scales with seconds, so use 1–2 seconds while testing.

input_reference (image-to-video)

Pass one input image to turn the job into image-to-video. Any of three forms works:
  • Public image URL: "input_reference": "https://example.com/first-frame.jpg"
  • base64 data URI: "input_reference": "data:image/jpeg;base64,/9j/4AAQ..."
  • Multipart file upload: -F "[email protected]"
For image-to-video, use prompt to describe motion and camera (such as “the cat slowly turns its head”); the output frame follows the input image. Each input image costs an extra $0.002 (grok-imagine-video) or $0.01 (1.5 / 1.5-lite).

Best Practices

1

Test prompts at 1–2 seconds and 480p

Billing is per second, so confirm the look with short, low-resolution clips before rendering the final length at 720p / 1080p. grok-imagine-video-1.5-lite has the lowest 480p / 720p rate and suits batch exploration.
2

Always pass size and seconds

Leaving them out means 480p at 8 seconds — the most common source of “why is this so expensive” and “why is it so blurry”.
3

Poll every 5–10 seconds with an overall timeout

Jobs usually finish within 20 seconds to 2 minutes. Faster polling gains nothing; cap the total at 10 minutes and log the task ID for troubleshooting if it times out.
4

Handle moderation blocks

Check error.code in the status response: moderation_blocked means the job was blocked, has no video, and was billed. Rephrase before resubmitting rather than retrying as is.
5

Store the video right away

Download from /content as soon as the job is completed; do not keep the download link long-term or hand it to end users.

Error Codes & Retries

FAQ

Almost certainly permissions: the Token group lacks GrokOfficial, or the Token’s billing mode is pay-per-request. For the former, apply via Group Setup; for the latter, switch the billing mode to Pay-as-you-go Priority or Pay-as-you-go.
Those are the defaults: without size and seconds, the job is generated and billed at 480p for 8 seconds. Pass size (such as "1280x720") and seconds explicitly.
Check the status response for error.code: "moderation_blocked". If it is there, xAI’s content moderation blocked the video: the task still reports completed, but there is no video, and it is billed (xAI charges for blocked videos too). Adjust the prompt or input image and resubmit.
No. Videos include an audio track by default, and per xAI’s pricing, turning audio off does not lower the price.
Image-to-video follows the input image’s frame. For a specific aspect ratio, crop the input image to that ratio before submitting.
This channel currently offers text-to-video and image-to-video with one input image. Video editing, extension, and similar capabilities are not open yet; this page will be updated when they are.
  • Need 1080p → grok-imagine-video-1.5 (best quality) or grok-imagine-video-1.5-lite (cheaper)
  • Batch 480p / 720p on a budget → grok-imagine-video-1.5-lite ($0.02 / $0.03 per second)
  • Already on the base model and only need 480p / 720p → grok-imagine-video