Kling omni video
curl --request POST \
--url https://xuwuai.com/kling/v1/videos/omni-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://xuwuai.com/kling/v1/videos/omni-video"
payload = {}
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({})
};
fetch('https://xuwuai.com/kling/v1/videos/omni-video', 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://xuwuai.com/kling/v1/videos/omni-video",
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([
]),
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://xuwuai.com/kling/v1/videos/omni-video"
payload := strings.NewReader("{}")
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://xuwuai.com/kling/v1/videos/omni-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://xuwuai.com/kling/v1/videos/omni-video")
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 = "{}"
response = http.request(request)
puts response.read_body{}视频生成
Omni 视频
接口与可灵官网一致;Omni Video (O1)
POST
/
kling
/
v1
/
videos
/
omni-video
Kling omni video
curl --request POST \
--url https://xuwuai.com/kling/v1/videos/omni-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://xuwuai.com/kling/v1/videos/omni-video"
payload = {}
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({})
};
fetch('https://xuwuai.com/kling/v1/videos/omni-video', 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://xuwuai.com/kling/v1/videos/omni-video",
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([
]),
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://xuwuai.com/kling/v1/videos/omni-video"
payload := strings.NewReader("{}")
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://xuwuai.com/kling/v1/videos/omni-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://xuwuai.com/kling/v1/videos/omni-video")
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 = "{}"
response = http.request(request)
puts response.read_body{}- 路径
POST /kling/v1/videos/omni-video - 与官网一致:本页所有请求体、字段命名与返回结构与可灵官网保持一致
- 字段详解:请参考官网权威文档
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model_name | string | 否 | 模型名称,默认 kling-video-o1 |
prompt | string | 是 | 文本提示词,可包含正向/负向描述 |
image_list | array | 否 | 参考图片列表(可作为首帧/尾帧) |
element_list | array | 否 | 主体参考列表 |
video_list | array | 否 | 参考视频列表 |
mode | string | 否 | 生成模式:std/pro,默认 pro |
aspect_ratio | string | 否 | 画面纵横比:16:9、9:16、1:1 |
duration | string | 否 | 视频时长:3~10 |
watermark_info | object | 否 | 是否生成含水印结果 |
callback_url | string | 否 | 回调通知地址 |
external_task_id | string | 否 | 自定义任务ID |
prompt:支持通过<<<image_1>>>、<<<element_1>>>、<<<video_1>>>引用图片/主体/视频占位符;长度 ≤ 2500 字符。model_name仅支持kling-video-o1。image_list结构:- 字段:
image_url(URL 或 Base64)、type(first_frame/end_frame,可选) - 约束:
.jpg/.jpeg/.png;大小 ≤ 10MB;最小边 ≥ 300px;宽高比 1:2.5 ~ 2.5:1 - 首尾帧:不支持仅尾帧;有
end_frame必须有first_frame - 张数限制:有参考视频时 ≤ 4 张;无参考视频时 ≤ 7 张;超过 2 张时不支持设置尾帧
- 字段:
element_list结构:[{ "element_id": <ID> }];与image_list合计张数限制同上video_list结构:video_url(必填)、refer_type(feature/base)、keep_original_sound(yes/no)- 约束:仅支持 1 段视频;格式 MP4/MOV;时长 3
10s;分辨率 7202160px;帧率 24~60fps;大小 ≤ 200MB refer_type=base为视频编辑:不可设置首尾帧;输出时长与输入视频一致,duration无效
aspect_ratio:- 文生视频 / 图片或主体参考 / 视频参考(非编辑)需要填写
- 使用首帧/首尾帧或视频编辑(
refer_type=base)不支持
duration:- 文生视频、首帧图生视频:仅支持
5/10 - 图片/主体参考或视频参考(非编辑):支持
3~10 - 视频编辑(
refer_type=base):忽略,以输入视频时长为准
- 文生视频、首帧图生视频:仅支持
场景一:图片参考生成
curl --request POST \
--url https://xuwuai.com/kling/v1/videos/omni-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-video-o1",
"prompt": "<<<image_1>>>中的场景转为电影镜头",
"image_list": [
{"image_url": "https://example.com/ref.jpg"}
],
"mode": "pro",
"aspect_ratio": "16:9",
"duration": "7"
}'
场景二:视频编辑(refer_type=base)
curl --request POST \
--url https://xuwuai.com/kling/v1/videos/omni-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-video-o1",
"prompt": "给<<<video_1>>>中的人物戴上皇冠",
"video_list": [
{
"video_url": "https://example.com/base.mp4",
"refer_type": "base",
"keep_original_sound": "yes"
}
],
"mode": "pro"
}'
{
"code": 0,
"message": "success",
"request_id": "req_...",
"data": {
"task_id": "task_01...",
"task_status": "submitted",
"created_at": 1735558800000,
"updated_at": 1735558800000
}
}
Authorizations
Authorization: Bearer
Body
application/json
The body is of type object.
Response
200 - application/json
OK
The response is of type object.