Skip to content
Docs menu

Video models

Grok Imagine

On this page

Grok Imagine — high-quality AI video generation.

modelIdgrok-imagine-image-to-video, grok-imagine-text-to-video, grok-imagine-text-to-image, grok-imagine-image-to-image, grok-imagine-extend, grok-imagine-upscale
Modalityvideo
PricingSee this model on the Pricing page for the current per-call price (with your markup).

Operations

OperationmodelIdEndpointRequired input
Image To Videogrok-imagine-image-to-videoPOST /api/v1/generate
Text To Videogrok-imagine-text-to-videoPOST /api/v1/generateprompt
Text To Imagegrok-imagine-text-to-imagePOST /api/v1/generateprompt
Image To Imagegrok-imagine-image-to-imagePOST /api/v1/generateimage_urls
Extendgrok-imagine-extendPOST /api/v1/generatetask_id, prompt, extend_at, extend_times
Upscalegrok-imagine-upscalePOST /api/v1/generatetask_id
Poll taskGET /api/v1/task/{id}?model=grok-imagine-image-to-video

Image To Video — grok-imagine-image-to-video

FieldTypeRequiredValues / example
image_urlsstring[]NoProvide one external image URL as a reference for video generation (only one image is supported). This is one of two image input options — you can either upload an external image or specify a task_id + index from a Grok-generated image below. Do not provide both image_urls and task_id at the same time.In your prompt, reference an uploaded image by typing @image(n) followed by a space (for example: @image1 a sunset over the ocean). (image URL)
task_idstringNoEnter the task_id of an image previously generated with the Grok model on you.bot. Use it together with the index below to select a specific image from that generation. When using this method, do not provide image_urls. Unlike external images, this method supports Spicy mode. Max 100 characters.
indexnumberNoWhen using a task_id, specify which image to use (Grok generates 6 images per task). This parameter only works with task_id and is ignored if image_urls is used(0-based). (range 0-5) (default: 0)
promptstringNoThe text prompt describing the desired video motion Max 5000 characters. (default: Slow cinematic push-in with gentle ambient motion, soft light shifting across the frame, subtle parallax and a shallow, dreamlike depth of field.)
modestringNoNote: When generating videos using external image inputs, Spicy mode is not supported and will automatically switch to Normal. (options: fun | normal | spicy) (default: normal)
aspect_ratiostringNoThe aspect ratio of the video. This parameter is invalid if it is a single image. (options: 2:3 | 3:2 | 1:1 | 16:9 | 9:16) (default: 2:3)
durationnumberNoThe duration of the generated video in seconds (range 6-30) (default: 6)
resolutionstringNoResolution of the generated video (options: 480p | 720p) (default: 480p)
nsfw_checkerbooleanNoA configurable parameter. Defaults to true in the Playground. (true/false) (default: true)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"grok-imagine-image-to-video","input":{"image_urls":["https://example.com/input.jpg"],"task_id":"example","index":0,"prompt":"A cinematic aerial shot of a coastal town at golden hour, gentle waves rolling onto the shore, warm light, slow camera push-in.","mode":"normal","aspect_ratio":"2:3","duration":6,"resolution":"480p","nsfw_checker":true}}'

Text To Video — grok-imagine-text-to-video

FieldTypeRequiredValues / example
promptstringYesThe text prompt describing the desired video motion Max 5000 characters. (default: A tram glides through a flooded neon city at night, reflections rippling around it, cinematic wide shot.)
aspect_ratiostringNoSpecifies the width-to-height ratio of the generated content. Controls the aspect ratio of the output video. (options: 2:3 | 3:2 | 1:1 | 9:16 | 16:9) (default: 2:3)
modestringNoOptions: fun | normal | spicy (default: normal)
durationnumberNoThe duration of the generated video in seconds (range 6-30) (default: 6)
resolutionstringNoResolution of the generated video (options: 480p | 720p) (default: 480p)
nsfw_checkerbooleanNoA configurable parameter. Defaults to true in the Playground. (true/false) (default: true)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"grok-imagine-text-to-video","input":{"prompt":"A cinematic aerial shot of a coastal town at golden hour, gentle waves rolling onto the shore, warm light, slow camera push-in.","aspect_ratio":"2:3","mode":"normal","duration":6,"resolution":"480p","nsfw_checker":true}}'

Text To Image — grok-imagine-text-to-image

FieldTypeRequiredValues / example
promptstringYesText value Max 5000 characters. (default: Cinematic portrait of a jazz drummer mid-solo in a smoky club, rim lighting, shallow depth of field.)
aspect_ratiostringNoSpecifies the width-to-height ratio of the generated content. Controls the aspect ratio of the output image (options: 2:3 | 3:2 | 1:1 | 9:16 | 16:9) (default: 3:2)
enable_probooleanNoToggle for request processing mode. false enables speed mode (prioritizes low latency); true enables quality mode (prioritizes output quality). (true/false) (default: false)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"grok-imagine-text-to-image","input":{"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","aspect_ratio":"3:2","enable_pro":false}}'

Image To Image — grok-imagine-image-to-image

FieldTypeRequiredValues / example
promptstringNoA text description specifying the desired content or style of the generated image. Max 390000 characters. (default: Restyle into a rain-soaked cyberpunk alley at midnight, wet cobblestones mirroring towering neon signage in magenta and cyan, steam curling up from the grates, moody cinematic color grade.)
image_urlsstring[]YesAn array containing up to 1 URL string pointing to reference images. In your prompt, reference the uploaded image by typing @image(n) followed by a space (for example: @image1 a sunset over the ocean). (image URL)
nsfw_checkerbooleanNoA configurable parameter. Defaults to true in the Playground. (true/false) (default: true)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"grok-imagine-image-to-image","input":{"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","image_urls":["https://example.com/input.jpg"],"nsfw_checker":true}}'

Extend — grok-imagine-extend

FieldTypeRequiredValues / example
task_idstringYessupports only you.bot AI–generated taskid Max 100 characters.
promptstringYesThe text prompt describing the desired video motion Max 5000 characters. (default: A potter's hands draw a spinning lump of clay upward into a tall vessel, water glistening on the walls as the camera orbits slowly around the wheel and afternoon light rakes across a dusty workshop.)
extend_atnumberYesExtension start time must be at least 2 seconds. (default: 2)
extend_timesstringYesExtended duration (options: 6 | 10) (default: 6)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"grok-imagine-extend","input":{"task_id":"example","prompt":"A cinematic aerial shot of a coastal town at golden hour, gentle waves rolling onto the shore, warm light, slow camera push-in.","extend_at":2,"extend_times":"6"}}'

Upscale — grok-imagine-upscale

FieldTypeRequiredValues / example
task_idstringYessupports only you.bot AI–generated taskid Max 100 characters.
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"grok-imagine-upscale","input":{"task_id":"example"}}'