Skip to main content
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",
  "function": "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"
  }
}

Overview

xAI Grok Imagine Video (grok-imagine-video) supports:
  • Text-to-videoprompt
  • Image animationfirst_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

FieldRequiredDefaultNotes
promptYesText description of the video
aspect_ratioNo1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3
resolutionNo480P or 720P
durationNo8115 seconds
first_frame_urlNoInput image URL to animate
reference_image_urlsNo[]Up to 3 reference image URLs

Authorizations

Authorization
string
header
required

Authorization: Bearer YOUR_API_KEY

Body

application/json
model
enum<string>
default:grok-imagine-video
required

Model ID. Use grok-imagine-video for this endpoint.

Available options:
grok-imagine-video
Example:

"grok-imagine-video"

function
enum<string>
required

Task type. Must be video for video generation.

Available options:
video
Example:

"video"

input
object
required
webhook
string<uri>

Optional HTTPS callback URL when the task completes, fails, or is cancelled.

Response

Async task created

data
object
required