curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-imagine-video-r2v \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "The character runs across a snowy field under the northern lights",
"reference_images": [
"https://example.com/character.png"
]
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-xai-r2v-001",
"model_id": "xai/grok-imagine-video-r2v",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-xai-r2v-001"
}
}
}{
"code": 400,
"message": "Invalid parameters: parameter 'image' is required"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Grok Imagine Video R2V
[Core Function] Grok Imagine Video R2V generates a video from a text prompt while preserving the subjects shown in up to 7 reference images. [Strengths] It excels at keeping character/subject identity consistent across a newly generated scene driven by the prompt. [Best For] Highly recommended for: character-driven video, placing a specific subject into a new scene, and blending features from multiple references. [Limitations] Do NOT use this model to simply animate a single image as-is (use Image-to-Video), or for clips longer than 10 seconds or resolutions above 720p; duration is capped at 10s and resolution at 480p/720p. [Routing] Use this model when the user provides reference images of a subject and wants a new action/scene described by a prompt. To simply animate a single image as-is, use Image-to-Video.
curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-imagine-video-r2v \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "The character runs across a snowy field under the northern lights",
"reference_images": [
"https://example.com/character.png"
]
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-xai-r2v-001",
"model_id": "xai/grok-imagine-video-r2v",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-xai-r2v-001"
}
}
}{
"code": 400,
"message": "Invalid parameters: parameter 'image' is required"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Authorizations
API Key authentication. Format: Bearer YOUR_API_KEY.
Body
xAI Grok Imagine reference-to-video request. Generates a video from a prompt while preserving the subjects from up to 7 reference images. Duration is capped at 10 seconds.
Text description of the video to generate
1"The character runs across a snowy field under the northern lights"
Reference images (1-7) whose subjects are preserved in the generated video. Each item is a publicly accessible image URL or a base64 data URI.
1 - 7 elements1["https://example.com/character.png"]
Video duration in seconds (max 10 when using reference images)
1 <= x <= 1010
Video aspect ratio
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 "16:9"
Video resolution
480p, 720p "720p"