Image to video
curl --request POST \
--url https://models.kapon.cloud/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"aspect_ratio": "<string>",
"callback_url": "<string>",
"camera_control": {
"config": {
"horizontal": 123,
"pan": 123,
"roll": 123,
"tilt": 123,
"vertical": 123,
"zoom": 123
},
"type": "<string>"
},
"cfg_scale": 123,
"duration": "<string>",
"dynamic_masks": [
{
"mask": "<string>",
"trajectories": [
{
"x": 123,
"y": 123
}
]
}
],
"element_list": [
{
"element_id": 123
}
],
"external_task_id": "<string>",
"image": "<string>",
"image_tail": "<string>",
"mode": "<string>",
"model_name": "<string>",
"multi_prompt": [
{
"duration": "<string>",
"index": 123,
"prompt": "<string>"
}
],
"multi_shot": true,
"negative_prompt": "<string>",
"prompt": "<string>",
"shot_type": "<string>",
"sound": "<string>",
"static_mask": "<string>",
"voice_list": [
{
"voice_id": "<string>"
}
],
"watermark_info": {
"enabled": true
}
}
'import requests
url = "https://models.kapon.cloud/kling/v1/videos/image2video"
payload = {
"aspect_ratio": "<string>",
"callback_url": "<string>",
"camera_control": {
"config": {
"horizontal": 123,
"pan": 123,
"roll": 123,
"tilt": 123,
"vertical": 123,
"zoom": 123
},
"type": "<string>"
},
"cfg_scale": 123,
"duration": "<string>",
"dynamic_masks": [
{
"mask": "<string>",
"trajectories": [
{
"x": 123,
"y": 123
}
]
}
],
"element_list": [{ "element_id": 123 }],
"external_task_id": "<string>",
"image": "<string>",
"image_tail": "<string>",
"mode": "<string>",
"model_name": "<string>",
"multi_prompt": [
{
"duration": "<string>",
"index": 123,
"prompt": "<string>"
}
],
"multi_shot": True,
"negative_prompt": "<string>",
"prompt": "<string>",
"shot_type": "<string>",
"sound": "<string>",
"static_mask": "<string>",
"voice_list": [{ "voice_id": "<string>" }],
"watermark_info": { "enabled": True }
}
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({
aspect_ratio: '<string>',
callback_url: '<string>',
camera_control: {
config: {horizontal: 123, pan: 123, roll: 123, tilt: 123, vertical: 123, zoom: 123},
type: '<string>'
},
cfg_scale: 123,
duration: '<string>',
dynamic_masks: [{mask: '<string>', trajectories: [{x: 123, y: 123}]}],
element_list: [{element_id: 123}],
external_task_id: '<string>',
image: '<string>',
image_tail: '<string>',
mode: '<string>',
model_name: '<string>',
multi_prompt: [{duration: '<string>', index: 123, prompt: '<string>'}],
multi_shot: true,
negative_prompt: '<string>',
prompt: '<string>',
shot_type: '<string>',
sound: '<string>',
static_mask: '<string>',
voice_list: [{voice_id: '<string>'}],
watermark_info: {enabled: true}
})
};
fetch('https://models.kapon.cloud/kling/v1/videos/image2video', 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://models.kapon.cloud/kling/v1/videos/image2video",
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([
'aspect_ratio' => '<string>',
'callback_url' => '<string>',
'camera_control' => [
'config' => [
'horizontal' => 123,
'pan' => 123,
'roll' => 123,
'tilt' => 123,
'vertical' => 123,
'zoom' => 123
],
'type' => '<string>'
],
'cfg_scale' => 123,
'duration' => '<string>',
'dynamic_masks' => [
[
'mask' => '<string>',
'trajectories' => [
[
'x' => 123,
'y' => 123
]
]
]
],
'element_list' => [
[
'element_id' => 123
]
],
'external_task_id' => '<string>',
'image' => '<string>',
'image_tail' => '<string>',
'mode' => '<string>',
'model_name' => '<string>',
'multi_prompt' => [
[
'duration' => '<string>',
'index' => 123,
'prompt' => '<string>'
]
],
'multi_shot' => true,
'negative_prompt' => '<string>',
'prompt' => '<string>',
'shot_type' => '<string>',
'sound' => '<string>',
'static_mask' => '<string>',
'voice_list' => [
[
'voice_id' => '<string>'
]
],
'watermark_info' => [
'enabled' => true
]
]),
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://models.kapon.cloud/kling/v1/videos/image2video"
payload := strings.NewReader("{\n \"aspect_ratio\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"pan\": 123,\n \"roll\": 123,\n \"tilt\": 123,\n \"vertical\": 123,\n \"zoom\": 123\n },\n \"type\": \"<string>\"\n },\n \"cfg_scale\": 123,\n \"duration\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"external_task_id\": \"<string>\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"mode\": \"<string>\",\n \"model_name\": \"<string>\",\n \"multi_prompt\": [\n {\n \"duration\": \"<string>\",\n \"index\": 123,\n \"prompt\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"shot_type\": \"<string>\",\n \"sound\": \"<string>\",\n \"static_mask\": \"<string>\",\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"watermark_info\": {\n \"enabled\": true\n }\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://models.kapon.cloud/kling/v1/videos/image2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aspect_ratio\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"pan\": 123,\n \"roll\": 123,\n \"tilt\": 123,\n \"vertical\": 123,\n \"zoom\": 123\n },\n \"type\": \"<string>\"\n },\n \"cfg_scale\": 123,\n \"duration\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"external_task_id\": \"<string>\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"mode\": \"<string>\",\n \"model_name\": \"<string>\",\n \"multi_prompt\": [\n {\n \"duration\": \"<string>\",\n \"index\": 123,\n \"prompt\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"shot_type\": \"<string>\",\n \"sound\": \"<string>\",\n \"static_mask\": \"<string>\",\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"watermark_info\": {\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://models.kapon.cloud/kling/v1/videos/image2video")
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 \"aspect_ratio\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"pan\": 123,\n \"roll\": 123,\n \"tilt\": 123,\n \"vertical\": 123,\n \"zoom\": 123\n },\n \"type\": \"<string>\"\n },\n \"cfg_scale\": 123,\n \"duration\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"external_task_id\": \"<string>\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"mode\": \"<string>\",\n \"model_name\": \"<string>\",\n \"multi_prompt\": [\n {\n \"duration\": \"<string>\",\n \"index\": 123,\n \"prompt\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"shot_type\": \"<string>\",\n \"sound\": \"<string>\",\n \"static_mask\": \"<string>\",\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"watermark_info\": {\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"data": {
"created_at": 123,
"final_balance_deduction": {},
"final_unit_deduction": "<string>",
"platform_id": "<string>",
"task_id": "<string>",
"task_info": {
"external_task_id": "<string>"
},
"task_result": {
"videos": [
{
"duration": "<string>",
"id": "<string>",
"url": "<string>",
"watermark_url": "<string>"
}
]
},
"task_status": "<string>",
"task_status_msg": "<string>",
"updated_at": 123,
"watermark_info": {
"enabled": true
}
},
"data_list": [
{
"created_at": 123,
"final_balance_deduction": {},
"final_unit_deduction": "<string>",
"platform_id": "<string>",
"task_id": "<string>",
"task_info": {
"external_task_id": "<string>"
},
"task_result": {
"videos": [
{
"duration": "<string>",
"id": "<string>",
"url": "<string>",
"watermark_url": "<string>"
}
]
},
"task_status": "<string>",
"task_status_msg": "<string>",
"updated_at": 123,
"watermark_info": {
"enabled": true
}
}
],
"message": "<string>",
"request_id": "<string>"
}Legacy 视频生成
图生视频(Legacy)
接口与可灵官网一致;支持首帧驱动、动态笔刷、运镜控制
POST
/
kling
/
v1
/
videos
/
image2video
Image to video
curl --request POST \
--url https://models.kapon.cloud/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"aspect_ratio": "<string>",
"callback_url": "<string>",
"camera_control": {
"config": {
"horizontal": 123,
"pan": 123,
"roll": 123,
"tilt": 123,
"vertical": 123,
"zoom": 123
},
"type": "<string>"
},
"cfg_scale": 123,
"duration": "<string>",
"dynamic_masks": [
{
"mask": "<string>",
"trajectories": [
{
"x": 123,
"y": 123
}
]
}
],
"element_list": [
{
"element_id": 123
}
],
"external_task_id": "<string>",
"image": "<string>",
"image_tail": "<string>",
"mode": "<string>",
"model_name": "<string>",
"multi_prompt": [
{
"duration": "<string>",
"index": 123,
"prompt": "<string>"
}
],
"multi_shot": true,
"negative_prompt": "<string>",
"prompt": "<string>",
"shot_type": "<string>",
"sound": "<string>",
"static_mask": "<string>",
"voice_list": [
{
"voice_id": "<string>"
}
],
"watermark_info": {
"enabled": true
}
}
'import requests
url = "https://models.kapon.cloud/kling/v1/videos/image2video"
payload = {
"aspect_ratio": "<string>",
"callback_url": "<string>",
"camera_control": {
"config": {
"horizontal": 123,
"pan": 123,
"roll": 123,
"tilt": 123,
"vertical": 123,
"zoom": 123
},
"type": "<string>"
},
"cfg_scale": 123,
"duration": "<string>",
"dynamic_masks": [
{
"mask": "<string>",
"trajectories": [
{
"x": 123,
"y": 123
}
]
}
],
"element_list": [{ "element_id": 123 }],
"external_task_id": "<string>",
"image": "<string>",
"image_tail": "<string>",
"mode": "<string>",
"model_name": "<string>",
"multi_prompt": [
{
"duration": "<string>",
"index": 123,
"prompt": "<string>"
}
],
"multi_shot": True,
"negative_prompt": "<string>",
"prompt": "<string>",
"shot_type": "<string>",
"sound": "<string>",
"static_mask": "<string>",
"voice_list": [{ "voice_id": "<string>" }],
"watermark_info": { "enabled": True }
}
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({
aspect_ratio: '<string>',
callback_url: '<string>',
camera_control: {
config: {horizontal: 123, pan: 123, roll: 123, tilt: 123, vertical: 123, zoom: 123},
type: '<string>'
},
cfg_scale: 123,
duration: '<string>',
dynamic_masks: [{mask: '<string>', trajectories: [{x: 123, y: 123}]}],
element_list: [{element_id: 123}],
external_task_id: '<string>',
image: '<string>',
image_tail: '<string>',
mode: '<string>',
model_name: '<string>',
multi_prompt: [{duration: '<string>', index: 123, prompt: '<string>'}],
multi_shot: true,
negative_prompt: '<string>',
prompt: '<string>',
shot_type: '<string>',
sound: '<string>',
static_mask: '<string>',
voice_list: [{voice_id: '<string>'}],
watermark_info: {enabled: true}
})
};
fetch('https://models.kapon.cloud/kling/v1/videos/image2video', 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://models.kapon.cloud/kling/v1/videos/image2video",
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([
'aspect_ratio' => '<string>',
'callback_url' => '<string>',
'camera_control' => [
'config' => [
'horizontal' => 123,
'pan' => 123,
'roll' => 123,
'tilt' => 123,
'vertical' => 123,
'zoom' => 123
],
'type' => '<string>'
],
'cfg_scale' => 123,
'duration' => '<string>',
'dynamic_masks' => [
[
'mask' => '<string>',
'trajectories' => [
[
'x' => 123,
'y' => 123
]
]
]
],
'element_list' => [
[
'element_id' => 123
]
],
'external_task_id' => '<string>',
'image' => '<string>',
'image_tail' => '<string>',
'mode' => '<string>',
'model_name' => '<string>',
'multi_prompt' => [
[
'duration' => '<string>',
'index' => 123,
'prompt' => '<string>'
]
],
'multi_shot' => true,
'negative_prompt' => '<string>',
'prompt' => '<string>',
'shot_type' => '<string>',
'sound' => '<string>',
'static_mask' => '<string>',
'voice_list' => [
[
'voice_id' => '<string>'
]
],
'watermark_info' => [
'enabled' => true
]
]),
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://models.kapon.cloud/kling/v1/videos/image2video"
payload := strings.NewReader("{\n \"aspect_ratio\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"pan\": 123,\n \"roll\": 123,\n \"tilt\": 123,\n \"vertical\": 123,\n \"zoom\": 123\n },\n \"type\": \"<string>\"\n },\n \"cfg_scale\": 123,\n \"duration\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"external_task_id\": \"<string>\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"mode\": \"<string>\",\n \"model_name\": \"<string>\",\n \"multi_prompt\": [\n {\n \"duration\": \"<string>\",\n \"index\": 123,\n \"prompt\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"shot_type\": \"<string>\",\n \"sound\": \"<string>\",\n \"static_mask\": \"<string>\",\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"watermark_info\": {\n \"enabled\": true\n }\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://models.kapon.cloud/kling/v1/videos/image2video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aspect_ratio\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"pan\": 123,\n \"roll\": 123,\n \"tilt\": 123,\n \"vertical\": 123,\n \"zoom\": 123\n },\n \"type\": \"<string>\"\n },\n \"cfg_scale\": 123,\n \"duration\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"external_task_id\": \"<string>\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"mode\": \"<string>\",\n \"model_name\": \"<string>\",\n \"multi_prompt\": [\n {\n \"duration\": \"<string>\",\n \"index\": 123,\n \"prompt\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"shot_type\": \"<string>\",\n \"sound\": \"<string>\",\n \"static_mask\": \"<string>\",\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"watermark_info\": {\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://models.kapon.cloud/kling/v1/videos/image2video")
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 \"aspect_ratio\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"camera_control\": {\n \"config\": {\n \"horizontal\": 123,\n \"pan\": 123,\n \"roll\": 123,\n \"tilt\": 123,\n \"vertical\": 123,\n \"zoom\": 123\n },\n \"type\": \"<string>\"\n },\n \"cfg_scale\": 123,\n \"duration\": \"<string>\",\n \"dynamic_masks\": [\n {\n \"mask\": \"<string>\",\n \"trajectories\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"element_list\": [\n {\n \"element_id\": 123\n }\n ],\n \"external_task_id\": \"<string>\",\n \"image\": \"<string>\",\n \"image_tail\": \"<string>\",\n \"mode\": \"<string>\",\n \"model_name\": \"<string>\",\n \"multi_prompt\": [\n {\n \"duration\": \"<string>\",\n \"index\": 123,\n \"prompt\": \"<string>\"\n }\n ],\n \"multi_shot\": true,\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"shot_type\": \"<string>\",\n \"sound\": \"<string>\",\n \"static_mask\": \"<string>\",\n \"voice_list\": [\n {\n \"voice_id\": \"<string>\"\n }\n ],\n \"watermark_info\": {\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"data": {
"created_at": 123,
"final_balance_deduction": {},
"final_unit_deduction": "<string>",
"platform_id": "<string>",
"task_id": "<string>",
"task_info": {
"external_task_id": "<string>"
},
"task_result": {
"videos": [
{
"duration": "<string>",
"id": "<string>",
"url": "<string>",
"watermark_url": "<string>"
}
]
},
"task_status": "<string>",
"task_status_msg": "<string>",
"updated_at": 123,
"watermark_info": {
"enabled": true
}
},
"data_list": [
{
"created_at": 123,
"final_balance_deduction": {},
"final_unit_deduction": "<string>",
"platform_id": "<string>",
"task_id": "<string>",
"task_info": {
"external_task_id": "<string>"
},
"task_result": {
"videos": [
{
"duration": "<string>",
"id": "<string>",
"url": "<string>",
"watermark_url": "<string>"
}
]
},
"task_status": "<string>",
"task_status_msg": "<string>",
"updated_at": 123,
"watermark_info": {
"enabled": true
}
}
],
"message": "<string>",
"request_id": "<string>"
}
请求参数
示例响应
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model_name | string | 否 | 模型名称,默认 kling-v1。可选:kling-v1、kling-v1-5、kling-v1-6、kling-v2-master、kling-v2-1、kling-v2-1-master、kling-v2-5-turbo、kling-v2-6、kling-v3 |
image | string | 条件必填 | 首帧图片 URL 或 Base64;与尾帧至少提供一个,只有支持尾帧独立生成的模型可省略 |
image_tail | string | 否 | 尾帧图片 URL 或 Base64 |
prompt | string | 否 | 文本提示词 |
multi_shot | boolean | 否 | 是否多镜头,默认false,3.0支持 |
shot_type | string | 条件必填 | customize/intelligence |
multi_prompt | array | 条件必填 | 自定义分镜 {index,prompt,duration};最多6段,总时长须一致 |
element_list | array | 否 | 3.0主体引用 [{"element_id":...}],最多3个,与voice_list互斥 |
negative_prompt | string | 否 | 负向文本提示词 |
voice_list | array | 否 | 语音列表(仅 kling-v2-6 支持,最多2个) |
sound | string | 否 | 是否生成声音:on/off(按对应模型声音能力使用) |
cfg_scale | number | 否 | 生成自由度 [0, 1],仅 kling-v1/kling-v1-5/kling-v1-6 支持 |
mode | string | 否 | 生成模式:std、pro;3.0额外支持4k,默认 std |
static_mask | string | 否 | 静态笔刷涂抹区域 |
dynamic_masks | array | 否 | 动态笔刷配置列表(最多6组) |
camera_control | object | 否 | 摄像机运动控制 |
aspect_ratio | string | 否 | 画面纵横比:16:9、9:16、1:1,默认 16:9 |
duration | string | 否 | 视频时长字符串:3.0支持3~15,其他模型按其支持范围,默认 5 |
watermark_info | object | 否 | 是否生成含水印结果 |
callback_url | string | 否 | 回调通知地址 |
external_task_id | string | 否 | 自定义任务ID |
重要约束动态笔刷配置
image与image_tail至少提供一个;V1.5/V1.6 的 pro 模式支持仅尾帧,其余模型请提供首帧。image + image_tail、dynamic_masks/static_mask、camera_control三组选一,互斥不可同时使用;voice_list仅kling-v2-6支持,且使用时sound=on、最多 2 个。kling-v3-omni请使用 Omni 视频入口/kling/v1/videos/omni-video。- 历史输入
kling-v2-5会归一为kling-v2-5-turbo;Kling 3.0 Turbo 使用 新版入口,不使用旧版别名。
{
"dynamic_masks": [
{
"mask": "base64编码的掩码图片",
"trajectories": [
{"x": 100, "y": 200},
{"x": 150, "y": 250}
]
}
]
}
trajectories:运动轨迹坐标序列,以输入图片左下为原点的像素坐标,至少2个点,最多77个点dynamic_masks最多 6 组;static_mask与dynamic_masks.mask分辨率需与image一致,否则上游可能失败
场景一:首帧驱动
curl --request POST \
--url https://models.kapon.cloud/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v1",
"image": "https://example.com/first-frame.jpg",
"prompt": "A mouse runs toward the camera, smiling and blinking",
"mode": "std",
"duration": "5",
"aspect_ratio": "16:9"
}'
场景二:首帧 + 尾帧
curl --request POST \
--url https://models.kapon.cloud/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v1",
"image": "https://example.com/child.jpg",
"image_tail": "https://example.com/adult.jpg",
"prompt": "A little girl grows up",
"mode": "pro",
"duration": "10",
"aspect_ratio": "16:9"
}'
场景三:使用摄像机运镜
curl --request POST \
--url https://models.kapon.cloud/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v2-master",
"image": "https://example.com/landscape.jpg",
"prompt": "Camera slowly zooms in on the mountain peak",
"camera_control": {
"type": "simple",
"config": {
"zoom": 5
}
},
"duration": "10",
"aspect_ratio": "16:9"
}'
{
"code": 0,
"message": "success",
"request_id": "req_1735558800_xyz789",
"data": {
"task_id": "task_01JGHM...",
"task_status": "submitted",
"created_at": 1735558800000,
"updated_at": 1735558800000
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
画面纵横比:16:9, 9:16, 1:1
回调通知地址
摄像机运动控制
Show child attributes
Show child attributes
生成视频的自由度 [0, 1]
视频时长:5, 10
动态笔刷配置列表(最多6组)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
自定义任务ID
图片URL,必须
尾帧图片
生成模式:std, pro
模型名称,默认kling-v1
Show child attributes
Show child attributes
负向文本提示词
文本提示词
是否生成声音:on/off
静态笔刷涂抹区域
语音列表
Show child attributes
Show child attributes
水印信息
Show child attributes
Show child attributes