One continuous five-second cinematic shot inside a quiet orbiting space station. Medium close-up of a female astronaut in a plain blue flight suit, face unobstructed, floating beside a round window showing Earth. One large clear water droplet floats slowly at eye level in front of her. She follows it with her eyes, smiles gently and says clearly in English, 'Even water flies up here.' Natural synchronized lips and subtle facial expression. The droplet drifts upward as she remains weightless; restrained camera drift, realistic skin and soft daylight. Native audio: her calm close voice over a soft steady ventilation hum. Finish the short sentence within the shot. No music, subtitles, written text, logos, advertising, helmets or scene cuts.
Kling 2.6 Pro Text to Video API
kwaivgi/kling-v2.6-pro/text-to-videoKling 2.6 Pro Text to Video transforms text prompts into 1080p cinematic videos, featuring native audiovisual synchronization, flexible 5s and 10s durations, and industry-standard aspect ratios. It adheres faithfully to complex scene directions and real-world physical dynamics while preserving spatiotemporal coherence and crisp detail stability.
747/1,000
Examples
REST API Reference
Quick Start
Submit a task and query its status. URLs using example.com or your-domain.com are placeholders; replace image and callback URLs with your own publicly accessible URLs. Output file URLs are illustrative.
Step 1: Set up authentication
Create an API key in the dashboard and attach Authorization: Bearer <API_KEY> when submitting a task.
- Submit Endpoint
- POST
https://api.vidgo.ai/api/generate/submit - Authorization Header
- Authorization: Bearer VIDGO_API_KEY
Step 2: Submit a task
POST /api/generate/submit: kwaivgi/kling-v2.6-pro/text-to-video
REQUEST_BODY=$(cat <<'JSON'
{
"model": "kwaivgi/kling-v2.6-pro/text-to-video",
"input": {
"prompt": "A slow camera pan across a sunlit garden.",
"duration": 5,
"sound": false,
"aspect_ratio": "16:9"
}
}
JSON
)
RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"Step 3: Poll for completion
Poll with task_id while status is not_started or running, and stop at finished or failed. On success, read data.files[].file_url; on failure, read data.error_message.
Status Endpoint
GET https://api.vidgo.ai/api/generate/status/{task_id}Poll with task_id while status is not_started or running, and stop at finished or failed. On success, read data.files[].file_url; on failure, read data.error_message.
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-example",
"status": "running",
"created_time": "2026-09-23T00:00:00Z"
}
}{
"code": 200,
"data": {
"task_id": "task-example",
"status": "finished",
"files": [
{
"file_type": "video",
"file_url": "https://example.com/output.mp4"
}
],
"created_time": "2026-09-23T00:00:00Z"
}
}Complete executable script
Expand to review an end-to-end script with automatic polling, error handling, and timeout safeguards.
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "kwaivgi/kling-v2.6-pro/text-to-video",
"input": {
"prompt": "A slow camera pan across a sunlit garden.",
"duration": 5,
"sound": false,
"aspect_ratio": "16:9"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
doneRequest Parameters (input object)
Place generation parameters in input, with model and optional callback_url at the request root. Use standard JSON types; unsupported input fields are rejected.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | Yes | - | Required nonblank string, 1 to 1,000 characters after trimming leading and trailing whitespace. |
| duration | integer | Yes | - | Required integer: 5 or 10 seconds. Strings and fractional durations are rejected. |
| aspect_ratio | string | Yes | - | Required: 16:9, 9:16 or 1:1. Controls the output video aspect ratio. |
| sound | boolean | Yes | - | Required boolean: true for audio, false for no audio. |
Response Fields (Status Query)
Details returned by GET /api/generate/status/{task_id}:
| Field | Type | Description |
|---|---|---|
| code | integer | HTTP/business response status code (200 indicates success). |
| data.task_id | string | Globally unique task identifier. |
| data.status | string | Task lifecycle state: not_started, running, finished, or failed. |
| data.files | array | Array of output assets containing file_url and file_type upon completion. |
| data.error_message | string | null | Error diagnostic details if the task status is failed. |
Task Lifecycle
Clients should poll status until reaching either the finished or failed terminal state:
not_startedQueued
runningGenerating
finishedReady
failedFailed
Polling & Error Handling
- Polling frequencyStart polling with a 2 to 3-second interval, gradually increasing to 5 seconds for extended takes.
- Network resiliencyTransient 5xx responses or timeouts do not signify task failure; retry status requests after a short backoff.
- Webhook callbacksProvide a top-level callback_url in your submission payload to receive completion notifications automatically.
Specifications
| Specification | Value | Description |
|---|---|---|
| Model | kwaivgi/kling-v2.6-pro/text-to-video | |
| Duration | 5 / 10 s | Required integer: 5 or 10 seconds. Strings and fractional durations are rejected. |
Kling 2.6 Pro Text to Video API Frequently Asked Questions
What is the Kling 2.6 Pro Text to Video API?
Kling 2.6 Pro Text to Video is a Kuaishou Technology model for generating cinematic video from text prompts. It creates 1080p full high-definition videos in 5-second or 10-second durations, featuring native audiovisual synchronization and flexible framing across 16:9, 9:16, and 1:1 aspect ratios. Built on advanced spatiotemporal diffusion architectures, it preserves narrative continuity and realistic physical dynamics while rendering rich visual detail. You can call it programmatically or try it from the playground above.
What types of audio does Kling 2.6 Pro Text to Video generate?
When sound is enabled, the model synthesizes context-aware audio tracks directly during inference, including ambient soundscapes, physical action sound effects, and situational Foley noise, removing the necessity of manual post-production audio editing.
Does Kling 2.6 Pro Text to Video support 10-second generations?
Yes. The endpoint supports both 5-second and 10-second output options. Selecting 10 seconds provides extended narrative continuity, elaborate character motion sequences, and sustained atmospheric flow.
Which aspect ratios are supported by Kling 2.6 Pro Text to Video?
It supports 16:9 widescreen, 9:16 vertical, and 1:1 square aspect ratios. The model renders frames natively at the selected ratio, eliminating the composition loss associated with post-generation cropping.
How is Kling 2.6 Pro Text to Video billed?
Pricing is determined by duration and audio selection: 65 credits ($0.325) for 5s without sound, 130 credits ($0.650) for 10s without sound, 120 credits ($0.600) for 5s with sound, and 240 credits ($1.200) for 10s with sound. If a task terminates due to a system error, reserved credits are automatically refunded in full.
How does Kling 2.6 Pro Text to Video maintain motion continuity?
Through deep spatiotemporal attention modeling, the architecture maintains cohesive motion trajectories across frames, preserving consistent human anatomy and environmental spatial geometry during dynamic action sequences.
What are the best practices for writing Kling 2.6 Pro Text to Video prompts?
Organize prompts into distinct layers covering character identity, specific physical actions, surrounding environment, camera trajectory, and lighting atmosphere to provide precise composition anchors for the diffusion process.