xAI
Grok Imagine
grok-imagine/text-to-video
xAI's creative generation model, supporting image-to-image editing and style guidance, with up to 9 reference images to control composition and characters; called through the unified HiAPI.ai interface
Try grok-imagine/text-to-video
Input
Showcases
View all showcasesOutput
videoPricing
grok-imagine/text-to-video per second
| Specifications | Unit Price |
|---|---|
| 480P | $0.0114 |
| 720P | $0.0214 |
| 1080P | $0.05714 |
Positioning Overview
grok-imagine/text-to-video is the text-to-video line within xAI's Grok Imagine series, accessible through the unified HiAPI.ai interface. A single text prompt is all it takes to generate a short video. It offers three motion styles—fun, normal, and spicy—supports durations of 6 to 30 seconds, and lets you choose between 480p, 720p, and 1080p quality, with aspect ratios covering landscape, portrait, and square. It is suited for developers who need to quickly produce social media clips, advertising concept prototypes, or animated storyboard previews and integrate them into their products.
Core Highlights
- Three motion modes to adjust video style — The fun, normal, and spicy tiers correspond to stronger creative expression, balanced output, and more intense motion respectively, so the same prompt can switch tempo according to placement needs.
- Duration and resolution combine as needed — A single generation supports durations of 6 to 30 seconds, with resolution options of 480p, 720p, and 1080p, letting you balance generation speed, quality, and cost yourself.
- Multiple aspect ratios adapt to mainstream placements at once — Five built-in aspect ratios—16:9, 9:16, 1:1, 3:2, and 2:3—let landscape, portrait, and square assets be used without secondary cropping.
Capability Description
Direct text-to-video generation: Pass in a prompt of up to 5000 characters to get a video, with no reference images or storyboard assets required—ideal for quickly producing clips from scratch.
Controllable generation parameters: Duration, resolution, aspect ratio, and motion mode are all explicit input parameters, so developers can set them statically or send them dynamically in requests based on business scenarios.
Adjustable motion style: The mode parameter affects the motion style and intensity of the footage, allowing you to switch between creative expression and dynamic movement depending on the content type.
Use Cases
- Social media operators: generate portrait clips from a single line of copy — Generate portrait assets at a 9:16 ratio with a shorter duration for direct use on short-video platforms or in feed advertising.
- Advertising creative teams: batch-produce script concept videos — Generate prompts for different creative directions into 6- to 30-second clips for internal pitch comparisons and creative previews.
- Product developers: integrate text-to-video capabilities into apps — Connect to generation capabilities through the unified interface so end users can input a description and get a downloadable video clip.
Limitations and Selection Advice
A single generation is limited to 6 to 30 seconds and cannot produce longer shots at once; long narratives need to be split into multiple segments and stitched together. Although prompts support Chinese, English descriptions yield more stable visual results, so multilingual content requires your own evaluation. The combination of resolution and duration affects generation time; to prioritize speed, choose 480p and shorter durations. For scenarios that need reference-image-guided visuals or audio-video synchronization, use the image-to-video line or tools with audio capabilities instead.
What's new
View changelog →- New model New models: grok-imagine-image-2.0/text-to-image and grok-im…
Frequently asked questions
View all FAQs →-
What is the standard Grok Imagine route best for?
It suits high-volume ideation, social assets, landscapes, and cinematic scenes. Current 1k and 2k output share one flat price.
-
How does standard differ from Quality?
Standard emphasizes speed and a low flat price. Quality is a separate model route focused on material, detail, and light, with tiered 1k/2k pricing.
-
Which ratios are available?
Thirteen landscape, square, and portrait ratios ranging from 2:1 and 20:9 to 1:2.
-
Does this page accept references?
No. Use grok-imagine/image-to-image for reference editing.
Create a generation task
https://api.hiapi.ai/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: grok-imagine/text-to-video
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for grok-imagine/text-to-video and route default — see the parameter table below.
modestringOptionalDefault: "normal"Generation mode controlling the motion style and intensity: fun is more creative, normal is balanced, spicy is more dynamic. Default is normal.
funnormalspicypromptstringRequiredminLength 1maxLength 5000A text prompt describing the desired video scene and motion; English works best, up to 5000 characters.
durationintegerOptionalDefault: 6min 6max 30Video duration in seconds; cost is calculated per second. Default is 6 seconds.
resolutionstringOptionalDefault: "480p"Output video resolution: 720p offers higher quality, 480p generates faster and costs less, and 1080p offers the highest quality. Default is 480p.
480p720p1080paspect_ratiostringOptionalDefault: "2:3"Output video aspect ratio. Default is 2:3.
2:33:21:116:99:16callbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/text-to-video",
"input": {
"mode": "normal",
"prompt": "…",
"duration": 6,
"resolution": "480p",
"aspect_ratio": "2:3"
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "grok-imagine/text-to-video",
input: {
"mode": "normal",
"prompt": "…",
"duration": 6,
"resolution": "480p",
"aspect_ratio": "2:3"
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "grok-imagine/text-to-video",
"input": {
"mode": "normal",
"prompt": "…",
"duration": 6,
"resolution": "480p",
"aspect_ratio": "2:3"
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.ai/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →Related Models
View all models →Same Type
-
Veo 3.1 Lite Google $0.060 /second -
Wan 2.7 Video Alibaba $0.100 /second -
HeyGen Avatar V HeyGen $0.150 /second -
Kling 4.0 Kuaishou $0.330 /second -
FLUX 3 Max Black Forest Labs $0.061 /second -
Vidu Q4 Preview Vidu $0.051 /second -
HappyHorse 1.1 Alibaba $0.160 /second -
Kling AI Avatar Kuaishou -- -
Grok Imagine 1.5 xAI $0.011 /second -
PixVerse V6 PixVerse $0.036 /second -
Kandinsky 6.0 Pro $1.93 /video -
HappyHorse 1.0 Alibaba $0.168 /second