Kling
Kling is Kuaishou's video generation model family. Like other video models, you create a task via POST /v1/videos and then poll for the result (OpenAI Video style responses). Model names map 1:1 to the upstream (kling-v3, kling-v2-6, etc.) — the platform provides no aliases.
Endpoints
- Create task:
POST $URL/v1/videos - Query task:
GET $URL/v1/videos/{task_id}
Supported Models
| Model Name | Notes | Resolutions |
|---|---|---|
kling-v3 | 3.0 flagship | 720p / 1080p / 4k |
kling-v2-6 | 2.6 standard | 720p / 1080p |
kling-v2-5-turbo | 2.5 fast | 720p / 1080p |
kling-v2-1-master | 2.1 master | 720p / 1080p |
kling-v2-master | 2.0 master | 720p / 1080p |
- The resolution tier is controlled by
mode:std→ 720P,pro→ 1080P,4k→ 4K; 4K is currently only available onkling-v3— other models return 400 for4k;kling-v3andkling-v2-6support audio generation (metadata.sound); the audio tier is billed higher than the silent tier;- The 1.x series (
kling-v1/kling-v1-6) is not available.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name from the table above |
prompt | string | Yes | Video content description |
resolution 🆕 | string | No | Resolution tier (recommended): "720p"(default) / "1080p" / "4k" (4k only for kling-v3). Conflicting mode returns 400 |
mode | string | No | Resolution tier (legacy, compatible): std=720p / pro=1080p / 4k, default std |
audio 🆕 | string | No | Audio generation (official style): "off"(default) / "native". Supported on kling-v3 / kling-v2-6 with higher audio-tier pricing |
metadata.sound | string | No | Audio generation (legacy, compatible): "on" / "off", equivalent to audio |
aspect_ratio 🆕 | string | No | Aspect ratio (official style): 16:9 / 9:16 / 1:1, default 16:9 |
settings 🆕 | object | No | Official settings container fully compatible: settings.resolution / settings.audio / settings.duration / settings.aspect_ratio |
seconds | string | No | Output duration in seconds, e.g. "5", "10". Default "5" |
size | string | No | Aspect ratio: 16:9 / 9:16 / 1:1 (dimensions like 1920x1080 are also accepted and mapped to a ratio). Default 16:9 |
image | string | No | Reference image URL (image-to-video) |
images | array | No | Reference image URLs |
metadata.sound | string | No | Generate audio: "on" / "off" (kling-v3 / kling-v2-6 bill the audio tier higher; only these two models support audio) |
Request Example
Text-to-video
curl $URL/v1/videos \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3",
"prompt": "A cat wearing sunglasses walking on a neon street",
"mode": "std",
"seconds": "5",
"metadata": { "sound": "on" }
}'import time
import requests
url = "$URL/v1/videos"
headers = {"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}
payload = {"model": "kling-v3", "prompt": "A cat on a neon street", "mode": "std", "seconds": "5", "metadata": {"sound": "on"}}
task = requests.post(url, json=payload, headers=headers).json()
task_id = task["id"]
while True:
result = requests.get(f"{url}/{task_id}", headers=headers).json()
if result["status"] in ("completed", "failed"):
break
time.sleep(8)
print(result)Image-to-video
curl $URL/v1/videos \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3",
"prompt": "Make the person in the frame turn and walk toward the camera",
"image": "https://example.com/ref.png",
"mode": "std",
"seconds": "5"
}'Response Fields
Both create and query return the same structure (OpenAI Video style):
| Field | Type | Description |
|---|---|---|
id | string | Task ID |
model | string | Model actually used |
status | string | Task status (see below) |
created_at | integer | Creation timestamp (seconds) |
seconds 🆕 | string | Requested generation duration in seconds (consistent with billing) |
video_url 🆕 | string | Video URL after completion (only when completed, same as metadata.url) |
resolution 🆕 | string | Billed resolution tier: 720p / 1080p / 4k (echoed from submission, consistent with billing) |
mode 🆕 | string | Tier echo: std / pro / 4k |
aspect_ratio 🆕 | string | Aspect ratio echo: 16:9 / 9:16 / 1:1 |
audio 🆕 | bool | Whether audio was generated (consistent with billing audio tier) |
error.message | string | Failure reason (only when failed) |
Task Status
| Status | Meaning | Action |
|---|---|---|
queued | Queued | Keep polling |
in_progress | Generating | Keep polling |
completed | Success | Get the video URL from the response and download it soon |
failed | Failed | Check error.message |
Poll every 5-10 seconds
Video URLs expire after a while — download and save them as soon as the task completes.
Response Example
{ "id": "task_xxxxxxxx", "model": "kling-v3", "status": "in_progress", "created_at": 1785000000 }After completion:
{ "id": "task_xxxxxxxx", "model": "kling-v3", "status": "completed", "created_at": 1785000000, "video_url": "https://.../kling-v3-xxxx.mp4" }Native Protocol Passthrough (advanced)
Raw Kling-format passthrough (the platform handles auth / channel selection / task management, fields pass through verbatim):
| Operation | Method & Path |
|---|---|
| Text-to-video | POST $URL/kling/v1/videos/text2video |
| Image-to-video | POST $URL/kling/v1/videos/image2video |
| Query task | GET $URL/kling/v1/videos/{action}/{task_id} |
Submissions still go through platform task management (polling) and return a platform task_id. The body is the native Kling format (model_name / duration / mode pass through directly). The omni reference path (/kling/v1/videos/omni-video) requires omni-series models, which are not available yet.
curl $URL/kling/v1/videos/text2video \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_name": "kling-v3",
"prompt": "A cat wearing sunglasses walking on a neon street",
"mode": "std",
"duration": "5"
}'FAQ
Q: How long does a task take?
Usually 1-3 minutes, longer for complex tasks. Poll the query endpoint; tasks stuck over 20 minutes are auto-failed.
Q: Do video links expire?
Yes. Download and store the video soon after generation completes.
