Kling V2.6 Pro текст-в-видео
curl --request POST \
--url https://api.highwayapi.ai/v3/async/kling-v2.6-pro-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"sound": true,
"prompt": "<string>",
"duration": 123,
"cfg_scale": 123,
"aspect_ratio": "<string>",
"negative_prompt": "<string>"
}
'import requests
url = "https://api.highwayapi.ai/v3/async/kling-v2.6-pro-t2v"
payload = {
"sound": True,
"prompt": "<string>",
"duration": 123,
"cfg_scale": 123,
"aspect_ratio": "<string>",
"negative_prompt": "<string>"
}
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({
sound: true,
prompt: '<string>',
duration: 123,
cfg_scale: 123,
aspect_ratio: '<string>',
negative_prompt: '<string>'
})
};
fetch('https://api.highwayapi.ai/v3/async/kling-v2.6-pro-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-v2.6-pro-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([
'sound' => true,
'prompt' => '<string>',
'duration' => 123,
'cfg_scale' => 123,
'aspect_ratio' => '<string>',
'negative_prompt' => '<string>'
]),
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-v2.6-pro-t2v"
payload := strings.NewReader("{\n \"sound\": true,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"cfg_scale\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\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-v2.6-pro-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"sound\": true,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"cfg_scale\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/kling-v2.6-pro-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 \"sound\": true,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"cfg_scale\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Видео
Kling V2.6 Pro текст-в-видео
POST
/
v3
/
async
/
kling-v2.6-pro-t2v
Kling V2.6 Pro текст-в-видео
curl --request POST \
--url https://api.highwayapi.ai/v3/async/kling-v2.6-pro-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"sound": true,
"prompt": "<string>",
"duration": 123,
"cfg_scale": 123,
"aspect_ratio": "<string>",
"negative_prompt": "<string>"
}
'import requests
url = "https://api.highwayapi.ai/v3/async/kling-v2.6-pro-t2v"
payload = {
"sound": True,
"prompt": "<string>",
"duration": 123,
"cfg_scale": 123,
"aspect_ratio": "<string>",
"negative_prompt": "<string>"
}
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({
sound: true,
prompt: '<string>',
duration: 123,
cfg_scale: 123,
aspect_ratio: '<string>',
negative_prompt: '<string>'
})
};
fetch('https://api.highwayapi.ai/v3/async/kling-v2.6-pro-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-v2.6-pro-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([
'sound' => true,
'prompt' => '<string>',
'duration' => 123,
'cfg_scale' => 123,
'aspect_ratio' => '<string>',
'negative_prompt' => '<string>'
]),
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-v2.6-pro-t2v"
payload := strings.NewReader("{\n \"sound\": true,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"cfg_scale\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\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-v2.6-pro-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"sound\": true,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"cfg_scale\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/kling-v2.6-pro-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 \"sound\": true,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"cfg_scale\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Это асинхронный API, который возвращает только
task_id асинхронной задачи.
Это асинхронный API, который возвращает только task_id асинхронной задачи. Используйте этот task_id для запроса API получения результата задачи, чтобы получить результат генерации.
Заголовки запроса
string
обязательно
Перечисляемое значение:
application/jsonstring
обязательно
Формат аутентификации Bearer: Bearer {{API 密钥}}.
Тело запроса
boolean
по умолчанию:true
Генерировать ли аудио одновременно с генерацией видео.
string
обязательно
Текст позитивного промпта для генерации видео; не более 2500 символов.
integer
по умолчанию:5
Длительность генерируемого медиа (в секундах)Допустимые значения:
5, 10number
Управляет гибкостью генерации видео: чем выше значение, тем точнее сгенерированный моделью контент соответствует промпту.Диапазон значений: [0, 1]
string
по умолчанию:"1:1"
Соотношение сторон генерируемого видеоДопустимые значения:
16:9, 9:16, 1:1string
Негативный промпт; длина не должна превышать 2500 символов.
Информация об ответе
string
обязательно
Используйте task_id для запроса API получения результата задачи, чтобы получить сгенерированный вывод.
⌘I