Create Video Generation Task (Old)
Overview
grok-imagine
scenario:
- text-to-video
- single-image-to-video
Rules:
- only
prompt-> text-to-video prompt + image-> image-to-video
Endpoint
POST /v1/video/generations
Query Parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | No | Bearer {your_token} |
Request Body Parameters
| Field | Type | Required | Title | Description |
|---|---|---|---|---|
model | string | Yes | Public model name | |
prompt | string | Yes | prompt | Structure Yes Required, recommended to pass |
image | string | Yes | single source image URL | image-to-video |
duration | string | Yes | , | allowed values:6, 10 |
size | string | Yes | output resolution | allowed values:480p, 720p |
aspect_ratio | string | Yes | output aspect ratio | allowed values:16:9, 1:1, 9:16 |
Request Examples
text-to-video
{
"model": "grok-imagine",
"prompt": " camera, fast, camera. ",
"size": "720p",
"aspect_ratio": "16:9",
"duration": 6
}
curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{"model": "grok-imagine",
"prompt": " camera, fast, camera. ",
"size": "720p",
"aspect_ratio": "16:9",
"duration": 6}'
single-image-to-video
{
"model": "grok-imagine",
"prompt": " camera, camera. ",
"image": "https://example.com/portrait.png",
"size": "480p",
"aspect_ratio": "9:16",
"duration": 10
}
curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{"model": "grok-imagine",
"prompt": " camera, camera. ",
"image": "https://example.com/portrait.png",
"size": "480p",
"aspect_ratio": "9:16",
"duration": 10}'
Response Fields
| Field | Type | Required | Title | Description |
|---|
Response Examples
Example 1
{}