curl --request POST \
--url https://api.shuyou.ai/v1/predictions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-imagine-video",
"input": {
"prompt": "A cinematic shot of a majestic lion in the savannah at golden hour",
"aspect_ratio": "16:9",
"resolution": "720P",
"duration": 8
}
}
'{
"data": {
"task_id": "2c4d50261173430290971a2395a3b607",
"task_status": "processing"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}xAI
Grok Imagine Video
Create asynchronous video tasks with grok-imagine-video via POST /v1/predictions.
POST
/
v1
/
predictions
curl --request POST \
--url https://api.shuyou.ai/v1/predictions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-imagine-video",
"input": {
"prompt": "A cinematic shot of a majestic lion in the savannah at golden hour",
"aspect_ratio": "16:9",
"resolution": "720P",
"duration": 8
}
}
'{
"data": {
"task_id": "2c4d50261173430290971a2395a3b607",
"task_status": "processing"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}Overview
xAI Grok Imagine Video (grok-imagine-video) supports:
- Text-to-video —
prompt - Image animation —
first_frame_url(720p+, prefer 16:9 or 9:16; other ratios may be cropped) - Reference images — up to 3 URLs in
reference_image_urls
Input parameters
| Field | Required | Default | Notes |
|---|---|---|---|
prompt | Yes | — | Text description of the video |
aspect_ratio | No | — | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 |
resolution | No | — | 480P or 720P |
duration | No | 8 | 1–15 seconds |
first_frame_url | No | — | Input image URL to animate |
reference_image_urls | No | [] | Up to 3 reference image URLs |
Authorizations
Authorization: Bearer YOUR_API_KEY
Body
application/json
Model ID. Use grok-imagine-video for this endpoint.
Available options:
grok-imagine-video Example:
"grok-imagine-video"
Show child attributes
Show child attributes
Optional HTTPS callback URL when the task completes, fails, or is cancelled.
Response
Async task created
Show child attributes
Show child attributes