DocsAPIVideos

Video Generation API

Generate AI videos from images or text

Asynchronous Processing

Video generation is asynchronous. You'll receive a task ID and can poll for status or use webhooks.

Create Video Task

POST/api/kling/image-to-video

Request Body

ParameterTypeRequiredDescription
imageUrlstringYesURL of the source image
promptstringNoMotion description for the video
durationnumberNoVideo duration in seconds: 5 or 10. Default: 5
modestringNoGeneration mode: std or pro. Default: std

Example Request

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"
  }'

Example Response

{
  "success": true,
  "data": {
    "taskId": "task_xyz789abc",
    "status": "processing",
    "estimatedTime": 120,
    "creditsUsed": 50
  }
}

Check Task Status

GET/api/kling/status?taskId={taskId}

Example Response (Processing)

{
  "success": true,
  "data": {
    "taskId": "task_xyz789abc",
    "status": "processing",
    "progress": 45
  }
}

Example Response (Complete)

{
  "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"
  }
}

Task Status Values

StatusDescription
queuedTask is waiting in queue
processingVideo is being generated
completedVideo is ready for download
failedGeneration failed (check error message)

Credit Costs

Standard (5s)
Standard quality, 5 second video
50
Standard (10s)
Standard quality, 10 second video
100
Pro (5s)
High quality, 5 second video
100
Pro (10s)
High quality, 10 second video
200