Generate AI videos from images or text
Video generation is asynchronous. You'll receive a task ID and can poll for status or use webhooks.
/api/kling/image-to-video| Parameter | Type | Required | Description |
|---|---|---|---|
| imageUrl | string | Yes | URL of the source image |
| prompt | string | No | Motion description for the video |
| duration | number | No | Video duration in seconds: 5 or 10. Default: 5 |
| mode | string | No | Generation mode: std or pro. Default: std |
curl -X POST https://your-domain.com/api/kling/image-to-video \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/my-image.png",
"prompt": "Camera slowly zooms in, birds flying in background",
"duration": 5,
"mode": "std"
}'{
"success": true,
"data": {
"taskId": "task_xyz789abc",
"status": "processing",
"estimatedTime": 120,
"creditsUsed": 50
}
}/api/kling/status?taskId={taskId}{
"success": true,
"data": {
"taskId": "task_xyz789abc",
"status": "processing",
"progress": 45
}
}{
"success": true,
"data": {
"taskId": "task_xyz789abc",
"status": "completed",
"videoUrl": "https://storage.example.com/videos/task_xyz789abc.mp4",
"duration": 5,
"createdAt": "2026-02-04T12:00:00Z"
}
}| Status | Description |
|---|---|
| queued | Task is waiting in queue |
| processing | Video is being generated |
| completed | Video is ready for download |
| failed | Generation failed (check error message) |