Skip to main content
POST
Grok Imagine

Headers

Authorization
string

Body

application/json
model
enum<string>
required

Model name. Must be grok_imagine.

Available options:
grok_imagine
prompt
string
required

Text prompt describing the video. Max 5000 characters.

Maximum string length: 5000
image_url
string<uri>

Optional reference image URL — a single image. If provided, runs image-to-video; otherwise text-to-video. For multiple reference images use grok_imagine_refs.

duration
integer
default:6

Video duration in seconds (6-30).

Required range: 6 <= x <= 30
resolution
enum<string>
default:720p

Output resolution.

Available options:
480p,
720p,
1080p
ratio
enum<string>
default:auto

Aspect ratio. Text-to-video only; ignored when image_url is provided. auto lets the model pick (the request is sent without an aspect ratio).

Available options:
auto,
1:1,
16:9,
9:16,
3:2,
2:3
custom_callback_url
string<uri>

Optional. A publicly accessible HTTPS URL. When the task status changes (processing / success / failed), GoEnhance sends a POST request to this URL. The request body is identical to the response of GET /api/v1/jobs/detail. If your server does not respond with HTTP 200, the notification is retried up to 3 times, with a 3-second timeout per attempt.

Example:

"https://your-server.com/goenhance/callback"

Response

code
integer
required
msg
string
required
data
object
required