创建文生视频任务
curl --request POST \
--url https://ai.alad.com/kling/v1/videos/text2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "一只猫在金色夕阳下穿过向日葵花田",
"model_name": "kling-v2-5-turbo",
"negative_prompt": "<string>",
"mode": "std",
"duration": "5",
"aspect_ratio": "16:9",
"cfg_scale": 0.5,
"multi_shot": false,
"multi_prompt": [
{
"index": 123,
"prompt": "<string>",
"duration": "<string>"
}
],
"sound": "off",
"camera_control": {
"config": {
"horizontal": 123,
"vertical": 123,
"pan": 123,
"tilt": 123,
"roll": 123,
"zoom": 123
}
},
"watermark_info": {
"enabled": true
},
"callback_url": "<string>",
"external_task_id": "<string>"
}
'import requests
url = "https://ai.alad.com/kling/v1/videos/text2video"
payload = {
"prompt": "一只猫在金色夕阳下穿过向日葵花田",
"model_name": "kling-v2-5-turbo",
"negative_prompt": "<string>",
"mode": "std",
"duration": "5",
"aspect_ratio": "16:9",
"cfg_scale": 0.5,
"multi_shot": False,
"multi_prompt": [
{
"index": 123,
"prompt": "<string>",
"duration": "<string>"
}
],
"sound": "off",
"camera_control": { "config": {
"horizontal": 123,
"vertical": 123,
"pan": 123,
"tilt": 123,
"roll": 123,
"zoom": 123
} },
"watermark_info": { "enabled": True },
"callback_url": "<string>",
"external_task_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '一只猫在金色夕阳下穿过向日葵花田',
model_name: 'kling-v2-5-turbo',
negative_prompt: '<string>',
mode: 'std',
duration: '5',
aspect_ratio: '16:9',
cfg_scale: 0.5,
multi_shot: false,
multi_prompt: [{index: 123, prompt: '<string>', duration: '<string>'}],
sound: 'off',
camera_control: {
config: {horizontal: 123, vertical: 123, pan: 123, tilt: 123, roll: 123, zoom: 123}
},
watermark_info: {enabled: true},
callback_url: '<string>',
external_task_id: '<string>'
})
};
fetch('https://ai.alad.com/kling/v1/videos/text2video', 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://ai.alad.com/kling/v1/videos/text2video",
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([
'prompt' => '一只猫在金色夕阳下穿过向日葵花田',
'model_name' => 'kling-v2-5-turbo',
'negative_prompt' => '<string>',
'mode' => 'std',
'duration' => '5',
'aspect_ratio' => '16:9',
'cfg_scale' => 0.5,
'multi_shot' => false,
'multi_prompt' => [
[
'index' => 123,
'prompt' => '<string>',
'duration' => '<string>'
]
],
'sound' => 'off',
'camera_control' => [
'config' => [
'horizontal' => 123,
'vertical' => 123,
'pan' => 123,
'tilt' => 123,
'roll' => 123,
'zoom' => 123
]
],
'watermark_info' => [
'enabled' => true
],
'callback_url' => '<string>',
'external_task_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://ai.alad.com/kling/v1/videos/text2video"
payload := strings.NewReader("{\n \"prompt\": \"一只猫在金色夕阳下穿过向日葵花田\",\n \"model_name\": \"kling-v2-5-turbo\",\n \"negative_prompt\": \"<string>\",\n \"mode\": \"std\",\n \"duration\": \"5\",\n \"aspect_ratio\": \"16:9\",\n \"cfg_scale\": 0.5,\n \"multi_shot\": false,\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"sound\": \"off\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"watermark_info\": {\n \"enabled\": true\n },\n \"callback_url\": \"<string>\",\n \"external_task_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ai.alad.com/kling/v1/videos/text2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"一只猫在金色夕阳下穿过向日葵花田\",\n \"model_name\": \"kling-v2-5-turbo\",\n \"negative_prompt\": \"<string>\",\n \"mode\": \"std\",\n \"duration\": \"5\",\n \"aspect_ratio\": \"16:9\",\n \"cfg_scale\": 0.5,\n \"multi_shot\": false,\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"sound\": \"off\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"watermark_info\": {\n \"enabled\": true\n },\n \"callback_url\": \"<string>\",\n \"external_task_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.alad.com/kling/v1/videos/text2video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"一只猫在金色夕阳下穿过向日葵花田\",\n \"model_name\": \"kling-v2-5-turbo\",\n \"negative_prompt\": \"<string>\",\n \"mode\": \"std\",\n \"duration\": \"5\",\n \"aspect_ratio\": \"16:9\",\n \"cfg_scale\": 0.5,\n \"multi_shot\": false,\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"sound\": \"off\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"watermark_info\": {\n \"enabled\": true\n },\n \"callback_url\": \"<string>\",\n \"external_task_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "860260753860210752",
"task_id": "860260753860210752",
"object": "video",
"model": "kling-v2-5-turbo",
"status": "<string>",
"progress": 0,
"created_at": 1773130665
}Kuaishou
Kling 2.5 Turbo 文生视频
使用 kling-v2-5-turbo 模型从文本提示词生成视频。
POST
/
kling
/
v1
/
videos
/
text2video
创建文生视频任务
curl --request POST \
--url https://ai.alad.com/kling/v1/videos/text2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "一只猫在金色夕阳下穿过向日葵花田",
"model_name": "kling-v2-5-turbo",
"negative_prompt": "<string>",
"mode": "std",
"duration": "5",
"aspect_ratio": "16:9",
"cfg_scale": 0.5,
"multi_shot": false,
"multi_prompt": [
{
"index": 123,
"prompt": "<string>",
"duration": "<string>"
}
],
"sound": "off",
"camera_control": {
"config": {
"horizontal": 123,
"vertical": 123,
"pan": 123,
"tilt": 123,
"roll": 123,
"zoom": 123
}
},
"watermark_info": {
"enabled": true
},
"callback_url": "<string>",
"external_task_id": "<string>"
}
'import requests
url = "https://ai.alad.com/kling/v1/videos/text2video"
payload = {
"prompt": "一只猫在金色夕阳下穿过向日葵花田",
"model_name": "kling-v2-5-turbo",
"negative_prompt": "<string>",
"mode": "std",
"duration": "5",
"aspect_ratio": "16:9",
"cfg_scale": 0.5,
"multi_shot": False,
"multi_prompt": [
{
"index": 123,
"prompt": "<string>",
"duration": "<string>"
}
],
"sound": "off",
"camera_control": { "config": {
"horizontal": 123,
"vertical": 123,
"pan": 123,
"tilt": 123,
"roll": 123,
"zoom": 123
} },
"watermark_info": { "enabled": True },
"callback_url": "<string>",
"external_task_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '一只猫在金色夕阳下穿过向日葵花田',
model_name: 'kling-v2-5-turbo',
negative_prompt: '<string>',
mode: 'std',
duration: '5',
aspect_ratio: '16:9',
cfg_scale: 0.5,
multi_shot: false,
multi_prompt: [{index: 123, prompt: '<string>', duration: '<string>'}],
sound: 'off',
camera_control: {
config: {horizontal: 123, vertical: 123, pan: 123, tilt: 123, roll: 123, zoom: 123}
},
watermark_info: {enabled: true},
callback_url: '<string>',
external_task_id: '<string>'
})
};
fetch('https://ai.alad.com/kling/v1/videos/text2video', 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://ai.alad.com/kling/v1/videos/text2video",
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([
'prompt' => '一只猫在金色夕阳下穿过向日葵花田',
'model_name' => 'kling-v2-5-turbo',
'negative_prompt' => '<string>',
'mode' => 'std',
'duration' => '5',
'aspect_ratio' => '16:9',
'cfg_scale' => 0.5,
'multi_shot' => false,
'multi_prompt' => [
[
'index' => 123,
'prompt' => '<string>',
'duration' => '<string>'
]
],
'sound' => 'off',
'camera_control' => [
'config' => [
'horizontal' => 123,
'vertical' => 123,
'pan' => 123,
'tilt' => 123,
'roll' => 123,
'zoom' => 123
]
],
'watermark_info' => [
'enabled' => true
],
'callback_url' => '<string>',
'external_task_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://ai.alad.com/kling/v1/videos/text2video"
payload := strings.NewReader("{\n \"prompt\": \"一只猫在金色夕阳下穿过向日葵花田\",\n \"model_name\": \"kling-v2-5-turbo\",\n \"negative_prompt\": \"<string>\",\n \"mode\": \"std\",\n \"duration\": \"5\",\n \"aspect_ratio\": \"16:9\",\n \"cfg_scale\": 0.5,\n \"multi_shot\": false,\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"sound\": \"off\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"watermark_info\": {\n \"enabled\": true\n },\n \"callback_url\": \"<string>\",\n \"external_task_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ai.alad.com/kling/v1/videos/text2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"一只猫在金色夕阳下穿过向日葵花田\",\n \"model_name\": \"kling-v2-5-turbo\",\n \"negative_prompt\": \"<string>\",\n \"mode\": \"std\",\n \"duration\": \"5\",\n \"aspect_ratio\": \"16:9\",\n \"cfg_scale\": 0.5,\n \"multi_shot\": false,\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"sound\": \"off\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"watermark_info\": {\n \"enabled\": true\n },\n \"callback_url\": \"<string>\",\n \"external_task_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.alad.com/kling/v1/videos/text2video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"一只猫在金色夕阳下穿过向日葵花田\",\n \"model_name\": \"kling-v2-5-turbo\",\n \"negative_prompt\": \"<string>\",\n \"mode\": \"std\",\n \"duration\": \"5\",\n \"aspect_ratio\": \"16:9\",\n \"cfg_scale\": 0.5,\n \"multi_shot\": false,\n \"multi_prompt\": [\n {\n \"index\": 123,\n \"prompt\": \"<string>\",\n \"duration\": \"<string>\"\n }\n ],\n \"sound\": \"off\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"vertical\": 123,\n \"pan\": 123,\n \"tilt\": 123,\n \"roll\": 123,\n \"zoom\": 123\n }\n },\n \"watermark_info\": {\n \"enabled\": true\n },\n \"callback_url\": \"<string>\",\n \"external_task_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "860260753860210752",
"task_id": "860260753860210752",
"object": "video",
"model": "kling-v2-5-turbo",
"status": "<string>",
"progress": 0,
"created_at": 1773130665
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
正向文本提示词,最长 2500 字符。
Maximum string length:
2500示例:
"一只猫在金色夕阳下穿过向日葵花田"
模型名称
可用选项:
kling-v2-5-turbo 示例:
"kling-v2-5-turbo"
负向文本提示词,最长 2500 字符。
Maximum string length:
2500std:标准模式(性价比高)。pro:专业模式(更高画质)。
可用选项:
std, pro 视频时长(秒),3-15 秒。
可用选项:
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 示例:
"5"
生成视频的画面比例(宽:高)。
可用选项:
16:9, 9:16, 1:1 示例:
"16:9"
提示词相关性(0-1),值越大模型自由度越小。kling-v2.x 模型不支持此参数。
必填范围:
0 <= x <= 1是否生成多镜头视频。为 true 时 prompt 无效,需使用 multi_prompt。
分镜方式。multi_shot 为 true 时必填。
可用选项:
customize, intelligence 分镜信息(1-6 个)。multi_shot 为 true 且 shot_type 为 customize 时必填。
Show child attributes
Show child attributes
是否同步生成音效。仅 V2.6 及以上版本支持。
可用选项:
on, off 运镜控制参数。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
任务状态回调通知 URL
自定义任务 ID,同一账号下须唯一。
⌘I

