Skip to main content
POST
/
v3
/
async
/
kling-v1.6-t2v
KLING V1.6 Text-to-Video
curl --request POST \
  --url https://api.highwayapi.ai/v3/async/kling-v1.6-t2v \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "mode": "<string>",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "duration": 123,
  "guidance_scale": 123
}
'
import requests

url = "https://api.highwayapi.ai/v3/async/kling-v1.6-t2v"

payload = {
"mode": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"duration": 123,
"guidance_scale": 123
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
mode: '<string>',
prompt: '<string>',
negative_prompt: '<string>',
duration: 123,
guidance_scale: 123
})
};

fetch('https://api.highwayapi.ai/v3/async/kling-v1.6-t2v', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/kling-v1.6-t2v",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => '<string>',
'prompt' => '<string>',
'negative_prompt' => '<string>',
'duration' => 123,
'guidance_scale' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.highwayapi.ai/v3/async/kling-v1.6-t2v"

payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/kling-v1.6-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.highwayapi.ai/v3/async/kling-v1.6-t2v")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"mode\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "task_id": "<string>"
}
KLING V1.6 Text-to-Video is an AI text-to-video generation model developed by the Kuaishou AI team. It can transform text descriptions into dynamic 5-second 720p videos, delivering high-quality visual output with enhanced motion and semantic understanding capabilities.
This is an asynchronous API and will only return the asynchronous task’s task_id. You should use this task_id to request the Get Task Result API to retrieve the video generation result.

Request Headers

Content-Type
string
required
Enum value: application/json
Authorization
string
required
Bearer authentication format: Bearer {{API Key}}.

Request Body

mode
string
Video generation mode.Supported:
  • Standard: Fast generation, lower cost, generates 720p videos.
Default value: Standard.
prompt
string
required
The prompt text used to guide generation.Value range: 1 <= x <= 2000.
negative_prompt
string
Negative prompt, used to indicate content that the model should avoid generating.Value range: 0 <= x <= 2000.
duration
integer
Duration of the generated video (in seconds). Default value: 5.
Optional values: 5, 10
guidance_scale
float
Guidance strength parameter, which controls how closely the generated content adheres to the prompt.Value range: 0 <= x <= 1. Default value: 0.5.

Response

task_id
string
required
The task_id of the asynchronous task. You should use this task_id to request the Get Task Result API to obtain the generation result.