Skip to main content

Grok Imagine

In this page's examples, {BASE_URL} is https://api.uniall.ai.

Updated: 2026-06-03

This document explains how to call Grok Imagine video model. user requires using this sitestable model and OpenAI compatibilityvideo task endpoint.

1. Model

ModelscenarioBilling basis
grok-imaginetext-to-video, image-to-video, reference-image-to-video, video editing, video extensioncapability type, /Output video duration billing detail; image-to-video input image

For new integrations, use grok-imagine, input form and extra_body.operation Capability. this site's model list Model do not call.

2. Endpoint Overview

POST /v1/videos
GET /v1/videos/{task_id}
GET /v1/videos/{task_id}/content

POST /v1/videos submit task, return video task ID. poll GET /v1/videos/{task_id} Status. task completed, read response URL,/v1/videos/{task_id}/content Get Video File.

2.2 compatibility: video task endpoint

POST /v1/videos/generations
GET /v1/videos/generations/{task_id}

POST /v1/video/generations
GET /v1/video/generations/{task_id}

Endpoint, new recommended /v1/videos.

2.3 Details

Authorization: Bearer sk-***
Content-Type: application/json

3. fast

recommendedModelCapability
promptgenerate videogrok-imagineprompt+duration
oneimagegrok-imagineprompt+image+duration
multiple reference imagesgenerate videogrok-imagineprompt+images+duration
editing videogrok-imagineprompt+video+extra_body.operation=edit_video, recommended extra_body.input_video_secondsedit_video
videogrok-imagineprompt+video+duration+extra_body.operation=video_extend, recommended extra_body.input_video_secondsvideo_extend

Note: extra_body.operation Yesthis sitestableCapability. input form the platform; video editingand pass video, recommended pass extra_body.operation.

4. Parameter Reference

ParametersTypeRequiredNote
modelstringYesalways pass grok-imagine
promptstringYesvideo generation, editingor prompt
imagestring/objectimage-to-videoRequiredsingle image URL; supports {"url": "..."}
imagesstring[]multiple reference imagesRequiredmultiple reference images URL
image_url/image_urlsstring/string[]Noimage compatibility field
videostring/objectediting/ Requiredvideo URL; supports {"url": "..."}
videosstring[]Noreference video URL array, reference video Capability
sizestringNo,480p, 720p; video extension does not support Parameters
aspect_ratiostringNooutput aspect ratio; text-to-video 16:9, 1:1, 9:16, single-image-to-video auto
durationinteger/stringConditionalduration., multiple reference images and use; video editing do not pass Field
secondsstringConditionalOpenAI compatibilitydurationField; pass duration pass seconds, do notand duration pass both
extra_body.operationstringNostableCapability:text_to_video, image_to_video, reference_to_video, edit_video, video_extend
extra_body.input_video_secondsintegerediting/ recommended to passvideo billing detail duration, passpositive integer. video duration recommended to pass; pass the platform oruse value

5. duration rules, multiple reference images and pass duration. video editing do not pass duration.

scenariodurationFieldsupports valuevideo duration
text-to-videoduration or seconds1-15 integer secondsrequires
single-image-to-videoduration or seconds1-15 integer secondsrequires
reference-image-to-videoduration or seconds1-10 integer secondsrequires
video editingpass duration/secondsrecommended to pass extra_body.input_video_seconds
video extensionduration or seconds2-10 integer secondsrecommended to pass extra_body.input_video_seconds

Note:

  • recommended to use duration, "duration": 6.
  • If can onlyuse OpenAI compatibility field, pass seconds, "seconds": "6".
  • duration and seconds one of two required, do not pass both.
  • video editingand extra_body.input_video_seconds Yes video duration, Yes duration.
  • If video duration, pass extra_body.input_video_seconds; the platform video, billing detail duration.
  • billing detail userpass, Yes task / duration.

6. Capability Rules

requires pass extra_body.operation:

  • imageandvideo: text-to-video.
  • one image: image-to-video.
  • images: reference-image-to-video.
  • video: recommended pass edit_video or video_extend.

editing video:

{
"extra_body": {
"operation": "edit_video",
"input_video_seconds": 8
}
}

video:

{
"duration": 6,
"extra_body": {
"operation": "video_extend",
"input_video_seconds": 8
}
}

7. Request Examples

7.1 text-to-video

curl -X POST "{BASE_URL}/v1/videos" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{"model": "grok-imagine",
"prompt": " camera, fast, camera. ",
"size": "720p",
"aspect_ratio": "16:9",
"duration": 6}'

submitresponses:

{
"id": "task_xxx",
"task_id": "task_xxx",
"object": "video",
"model": "grok-imagine",
"status": "queued",
"progress": 0,
"created_at": 1773980459,
"seconds": "6"
}

7.2 single-image-to-video

curl -X POST "{BASE_URL}/v1/videos" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{"model": "grok-imagine",
"prompt": " camera, camera. ",
"image": "https://example.com/portrait.png",
"size": "480p",
"aspect_ratio": "auto",
"duration": 10}'

7.3 reference-image-to-video

curl -X POST "{BASE_URL}/v1/videos" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{"model": "grok-imagine",
"prompt": " @Image1 @Image2, slow camera push-in. ",
"images": ["https://example.com/person.png",
"https://example.com/street.png"],
"size": "720p",
"aspect_ratio": "4:3",
"duration": 10}'

7.4 video editing

curl -X POST "{BASE_URL}/v1/videos" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{"model": "grok-imagine",
"prompt": "to change videointo, reserved action and. ",
"video": "https://example.com/source.mp4",
"size": "720p",
"extra_body": {"operation": "edit_video",
"input_video_seconds": 8}}'

video editing do not pass duration/seconds. If video duration, recommended to pass extra_body.input_video_seconds, and; pass the platform oruse value.

7.5 video extension

curl -X POST "{BASE_URL}/v1/videos" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{"model": "grok-imagine",
"prompt": " camera, video and Orientation. ",
"video": "https://example.com/source.mp4",
"duration": 6,
"extra_body": {"operation": "video_extend",
"input_video_seconds": 8}}'

video extension duration duration, supports 2-10. If video duration, recommended to pass both extra_body.input_video_seconds.

8. Task Status And Result

After creation, save id or task_id, then poll GET /v1/videos/{task_id} until the task reaches completed or failed. See Video Generation Overview for the shared polling interval, status fields, error contract, result URL, and authenticated download flow.

9. Billing Notes

Grok video this siteuse billing detail, publicpricing Model.

scenariobilling detail
text-to-videoResolution tier, Output video duration
single-image-to-videoResolution tier, Output video duration
reference-image-to-videoResolution tier, Output video duration
video editingResolution tier, video duration, Output video duration
video extensionvideo duration, Output video duration

public " Parameters "and,:

  • video:
  • video 480P:
  • video 720P:

image-to-videoand reference-image-to-video Input image facts, Grok videoRules to change.

submit. tasksubmit balance, Yesto change value public.

10. Common Errors

to changevideo model imageEndpoint

grok-imagine call /v1/videos, do not /v1/images/generations.

editingand only pass video. editingpass: