curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-video-1.5",
"prompt": "Animate this product photo into a cinematic commercial video with a subtle camera push-in",
"image": "https://example.com/product.jpg",
"duration": 10,
"aspect_ratio": "16:9"
}'
import requests
task = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "grok-video-1.5",
"prompt": "Animate this product photo into a cinematic commercial video",
"image": "https://example.com/product.jpg",
"duration": 15,
"aspect_ratio": "16:9",
},
).json()
print(task["id"])
{
"id": "video_abc123def456",
"object": "generation.task",
"model": "grok-video-1.5",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
Grok Video
Grok Video 1.5 Generation
Generate video from exactly one required first-frame image using grok-video-1.5
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-video-1.5",
"prompt": "Animate this product photo into a cinematic commercial video with a subtle camera push-in",
"image": "https://example.com/product.jpg",
"duration": 10,
"aspect_ratio": "16:9"
}'
import requests
task = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "grok-video-1.5",
"prompt": "Animate this product photo into a cinematic commercial video",
"image": "https://example.com/product.jpg",
"duration": 15,
"aspect_ratio": "16:9",
},
).json()
print(task["id"])
{
"id": "video_abc123def456",
"object": "generation.task",
"model": "grok-video-1.5",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
중국 본토 사용자 안내: 중국 본토 사용자는
https://toapis.cn 를 API 엔드포인트(Base URL)로 사용해 주세요. 본 문서의 예시에서 https://toapis.com 을 https://toapis.cn 로 바꿔 주세요.- Supports image-to-video only; text-to-video is not supported.
- Requires exactly one public first-frame image URL.
- Supports durations from
1to15seconds; default is8. - Supports
480pand720p. - Async task API: poll video task status with the returned task ID.
Do not pass base64 image data. Upload local files with the Upload 이미지 API, then pass the returned public URL in
image.Authorizations
string
필수
All API requests require Bearer Token authentication.
Authorization: Bearer YOUR_API_KEY
Body
string
기본값:"grok-video-1.5"
필수
Use
grok-video-1.5.string
필수
Describe the motion, camera movement, and visual direction for the reference image.
string
필수
Pass exactly one required public first-frame image URL.
- Maximum:
1 - Supported URL schemes:
http://,https://
integer
기본값:"8"
Video duration.Supported range:
1–15 secondsstring
기본값:"720p"
Video resolution. Supported values:
480p, 720p.string
기본값:"16:9"
Video aspect ratio. Supported values:
1:1, 16:9, 9:16, 3:2, 2:3.Pricing
| Billing unit | Price |
|---|---|
| Generated second | $0.01 / second |
응답
string
Task identifier for polling video status.
string
Object type, always
generation.task.string
모델 name used for the task.
string
Task status:
queued, in_progress, completed, or failed.Create a video task
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-video-1.5",
"prompt": "Animate this product photo into a cinematic commercial video with a subtle camera push-in",
"image": "https://example.com/product.jpg",
"duration": 10,
"aspect_ratio": "16:9"
}'
import requests
task = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "grok-video-1.5",
"prompt": "Animate this product photo into a cinematic commercial video",
"image": "https://example.com/product.jpg",
"duration": 15,
"aspect_ratio": "16:9",
},
).json()
print(task["id"])
{
"id": "video_abc123def456",
"object": "generation.task",
"model": "grok-video-1.5",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
Query task status
Use the returnedid with Video Task 상태.