Generate video and track jobs
Video generation is asynchronous. A successful submission means the job was accepted, not that the final video is ready.
Endpoints
POST /v1/videos
GET /v1/videos/{task_id}
Text to video
curl -X POST http://localhost:9890/v1/videos \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_GATEWAY_KEY" \
-d '{
"model": "agnes-video-v2.0",
"prompt": "a cinematic orange cat walking through a rainy neon street",
"width": 1152,
"height": 768,
"num_frames": 121,
"frame_rate": 24
}'
Image to video
{
"model": "agnes-video-v2.0",
"prompt": "slow head turn, subtle background movement, natural motion",
"image": "https://example.com/input.jpg",
"width": 1152,
"height": 768,
"num_frames": 121,
"frame_rate": 24
}
Start and end frames
{
"model": "agnes-video-v2.0",
"prompt": "smoothly transition from the first frame to the second",
"images": [
"https://example.com/frame_start.jpg",
"https://example.com/frame_end.jpg"
],
"mode": "keyframes",
"width": 1152,
"height": 768,
"num_frames": 121,
"frame_rate": 24
}
Poll job status
curl -H "Authorization: Bearer YOUR_GATEWAY_KEY" \
http://localhost:9890/v1/videos/TASK_ID
Poll at a reasonable interval until the job completes or fails. Do not create a high-frequency polling loop.
Common durations
| Frames | Approximate duration at 24 fps |
|---|---|
| 81 | 3.4 seconds |
| 121 | 5 seconds |
| 161 | 6.7 seconds |
| 241 | 10 seconds |
| 441 | 18.4 seconds |
num_frames follows 8n+1 and is capped at 441. Validate with 81 or 121 frames before increasing resolution or duration.