Skip to content
中文

Kling 2.6 API documentation

Integrate Kling 2.6 with your VezAPI key. The operations below share the same authentication and account balance.

Base URL: https://api.vezapi.com
Send Authorization: Bearer YOUR_VEZAPI_KEY. Use a unique Idempotency-Key for each submission; reuse it only when checking the same request.

Kling 2.6 Image to Video

POST/api/v1/jobs/createTask

Model IDs: kling-2.6/image-to-video

ParameterTypeDescription & constraints
model
required
string

Name of the model used for the generation task. Required field. - This endpoint must use the `kling-2.6/image-to-video` model

Values: "kling-2.6/image-to-video"

Default: "kling-2.6/image-to-video"

callBackUrl
optional
string

Callback URL to receive notifications when the generation task is completed. Optional configuration, recommended for production environments. - After the task is completed, the system will POST the task status and results to this URL - The callback content includes the generated resource URL and task-related information - Your callback endpoint needs to support receiving POST requests with JSON payloads - You can also choose to call the task details endpoint to actively poll the task status - To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification) for signature verification implementation

input
optional
object

Input parameters for the generation task

input.prompt
required
string

Text prompt (max 2,500 characters).

maxLength: 2500

input.image_urls
required
array

Image URLs for video generation. (Uploaded file URLs, not file content; supported types: image/jpeg, image/png; maximum file size: 10.0MB)

maxItems: 1

input.sound
required
boolean

Required. This parameter specifies whether the generated video contains sound (boolean: true/false)

input.duration
required
string

Required. Video duration (unit: seconds)

Values: "5", "10"

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "kling-2.6/image-to-video",
  "input": {
    "prompt": "In a bright rehearsal room, sunlight streams through the windows, and a standing microphone is placed in the center of the room. [Campus band female lead singer] stands in front of the microphone with her eyes closed, and other members stand around her. [Campus band female lead singer, singing loudly] Lead vocal: \"I will do my best to heal you, with all my heart and soul...\" The background is a cappella harmonies, and the camera slowly pans around the band members.",
    "image_urls": [
      "https://example.com/input.png"
    ],
    "sound": false,
    "duration": "5"
  }
}'
Responses and errors

HTTP 200

Request successful

ParameterTypeDescription & constraints
code
optional
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description upon failure

data
required
object
data.taskId
required
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Kling 2.6 Text to Video

POST/api/v1/jobs/createTask

Model IDs: kling-2.6/text-to-video

ParameterTypeDescription & constraints
model
required
string

Name of the model used for the generation task. Required field. - This endpoint must use the `kling-2.6/text-to-video` model

Values: "kling-2.6/text-to-video"

Default: "kling-2.6/text-to-video"

callBackUrl
optional
string

Callback URL to receive notifications when the generation task is completed. Optional configuration, recommended for production environments. - After the task is completed, the system will POST the task status and results to this URL - The callback content includes the generated resource URL and task-related information - Your callback endpoint must support receiving POST requests with JSON payloads - You can also choose to call the task details endpoint to actively poll the task status - To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification) for signature verification implementation

input
optional
object

Input parameters for the generation task

input.prompt
required
string

Text prompt (max 2,500 characters).

maxLength: 2500

input.sound
required
boolean

Required. This parameter specifies whether the generated video contains sound (boolean: true/false)

input.aspect_ratio
required
string

Required. This parameter defines the video aspect ratio

Values: "1:1", "16:9", "9:16"

input.duration
required
string

Required. Video duration (unit: seconds)

Values: "5", "10"

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "kling-2.6/text-to-video",
  "input": {
    "prompt": "Scene: A fashion live-streaming sales setting, with clothes hanging on racks and the host'\''s figure reflected in a full-length mirror. Lines: [African female host] turns around to showcase the hoodie'\''s cut. [African female host, in a cheerful tone] says: \"360-degree flawless tailoring, slimming and versatile.\" She then [African female host] leans closer to the camera. [African female host, in a lively tone] says: \"Double-sided fleece fabric, $30 off immediately when you order now.\"",
    "sound": false,
    "aspect_ratio": "1:1",
    "duration": "5"
  }
}'
Responses and errors

HTTP 200

Request Successful

ParameterTypeDescription & constraints
code
optional
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description upon failure

data
required
object
data.taskId
required
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Task status and callbacks

For asynchronous tasks, keep the returned taskId. Query GET /api/v1/jobs/recordInfo?taskId=... or provide callBackUrl when creating the task. Only the account that created a task can access it or derive new resources from it.

A timeout can mean the submission was accepted. Inspect the existing request in your dashboard; do not create another task automatically. Callback delivery is retried and may arrive more than once. Deduplicate with X-VezAPI-Event-Id.

Files, logs and billing

Generated media normally follows a 14-day provider lifetime; uploaded files expire after 24 hours. Save the files you need before expiration. VezAPI streams registered files without keeping a permanent media library. Request logs are retained for two calendar months.

Credits are reserved before submission. Final deductions match actual discounted consumption one for one. Unknown usage pauses new paid requests. If available funds cannot cover final usage while protecting other reservations, settlement stays pending until funded; model usage cannot make the wallet negative. Time-based inputs require server-side metadata reads; a failed read prevents submission.