Skip to content
中文

Kling 3.0 API documentation

Integrate Kling 3.0 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 3.0

POST/api/v1/jobs/createTask

Model IDs: kling-3.0/video

ParameterTypeDescription & constraints
model
required
string

The model name. Must be kling-3.0/video.

Values: "kling-3.0/video"

Default: "kling-3.0/video"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll 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
optional
string

Required when multi_shots is false. Up to 2,500 characters.

input.image_urls
optional
array

First and last frame image URLs. Optional; not required when using kling_elements. When multi_shots is false: if length is 2, index 0 is the first frame and index 1 is the last frame; if length is 1, the array item serves as the first frame. When multi_shots is true: only the first frame is supported.

input.sound
required
boolean

Required. Whether to generate audio (speech, sound effects, ambience) with the video. Affects price.

input.duration
required
string

Required. Video duration in seconds, 3–15 (string, e.g. "5"). In multi-shot mode, output length and billing follow the sum of multi_prompt[].duration (3–15 s); set duration to the same total.

Values: "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"

input.aspect_ratio
optional
string

Optional when image_urls is provided (the output follows the first frame's aspect ratio). For text-to-video, set it explicitly: 16:9, 9:16 or 1:1.

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

input.mode
required
string

Required. Generation mode. std has standard resolution, pro has higher resolution, 4K has 4K resolution. Resolution mapping: - **std mode**: 16:9 (1280×720), 9:16 (720×1280), 1:1 (720×720) - **pro mode**: 16:9 (1920×1080), 9:16 (1080×1920), 1:1 (1080×1080) - **4K mode**: 16:9 (3840×2160), 9:16 (2160×3840), 1:1 (2160×2160)

Values: "std", "pro", "4K"

input.multi_shots
required
boolean

Required. Whether to use multi-shot mode. true enables multi-shot mode, false enables single-shot mode.

input.multi_prompt
optional
array

Shot prompts. Takes effect when multi_shots is true. Used to describe the text and duration of each shot. Supports up to 5 shots. Each shot duration is 1-12 seconds. If you need to use elements, add them after the prompt.

input.multi_prompt[].prompt
required
string

Prompt text for this shot, a maximum of 500 characters per shot. Each @element will occupy 37 characters.

maxLength: 500

input.multi_prompt[].duration
required
integer

Duration of this shot in seconds. Range: 1-12.

minimum: 1

maximum: 12

input.kling_elements
optional
array

Referenced elements. Detailed information about elements referenced in the prompt. A single task can reference a maximum of three elements.

maxItems: 3

input.kling_elements[].name
required
string

Element name, used in prompt with @ prefix (e.g., @element_dog)

input.kling_elements[].description
required
string

Element description

input.kling_elements[].element_input_urls
required
array

Either 2–4 images (JPG/PNG, up to 10 MB each) or 1 video (MP4/MOV).

input.kling_elements[].element_input_audio_urls
optional
array

Optional. List of audio material URLs for characters. The audio duration must be between 5 and 30 seconds.

input.kling_elements[].start_time
optional
integer

Start time for video character material capture (in milliseconds). Only effective when uploading videos through element_input_urls. If not uploaded, it defaults to 0.

input.kling_elements[].end_time
optional
integer

End time for video character material capture (in milliseconds). Only effective when uploading videos through element_input_urls. Must be greater than start_time, and the difference between end_time and start_time must be within 3000 to 8000 milliseconds.

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-3.0/video",
  "input": {
    "prompt": "In a bright rehearsal room, sunlight streams through the window@element_dog",
    "sound": true,
    "duration": "5",
    "aspect_ratio": "16:9",
    "mode": "pro",
    "multi_shots": false
  }
}'
Responses and errors

HTTP 200

Request successful

ParameterTypeDescription & constraints
data
optional
object
data.code
required
string

Response status code - **200**: Success - Request has been processed successfully - **401**: Unauthorized - Authentication credentials are missing or invalid - **402**: Insufficient Credits - Account does not have enough credits to perform the operation - **404**: Not Found - The requested resource or endpoint does not exist - **422**: Validation Error - The request parameters failed validation checks - **429**: Rate Limited - Request limit has been exceeded for this resource - **433**: Request Limit - Sub-key Usage Exceeds Limit - **455**: Service Unavailable - System is currently undergoing maintenance - **500**: Server Error - An unexpected error occurred while processing the request - **501**: Generation Failed - Content generation task failed - **505**: Feature Disabled - The requested feature is currently disabled

data.msg
required
string

Response message, error description when failed

data.taskId
optional
string

Task ID, can be used with Get Task Details endpoint to query 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.