Kling O3 V2V Reference
curl --request POST \
--url https://api.aihubmax.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-o3-video-to-video-reference",
"prompt": "参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频",
"resolution": "720p",
"video_url": "https://samplelib.com/lib/preview/mp4/sample-5s.mp4",
"image_urls": [
"https://picsum.photos/id/1043/1280/720.jpg"
],
"keep_audio": false,
"aspect_ratio": "auto",
"duration": 5
}
'import requests
url = "https://api.aihubmax.com/v1/videos/generations"
payload = {
"model": "kling-o3-video-to-video-reference",
"prompt": "参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频",
"resolution": "720p",
"video_url": "https://samplelib.com/lib/preview/mp4/sample-5s.mp4",
"image_urls": ["https://picsum.photos/id/1043/1280/720.jpg"],
"keep_audio": False,
"aspect_ratio": "auto",
"duration": 5
}
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({
model: 'kling-o3-video-to-video-reference',
prompt: '参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频',
resolution: '720p',
video_url: 'https://samplelib.com/lib/preview/mp4/sample-5s.mp4',
image_urls: ['https://picsum.photos/id/1043/1280/720.jpg'],
keep_audio: false,
aspect_ratio: 'auto',
duration: 5
})
};
fetch('https://api.aihubmax.com/v1/videos/generations', 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.aihubmax.com/v1/videos/generations",
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([
'model' => 'kling-o3-video-to-video-reference',
'prompt' => '参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频',
'resolution' => '720p',
'video_url' => 'https://samplelib.com/lib/preview/mp4/sample-5s.mp4',
'image_urls' => [
'https://picsum.photos/id/1043/1280/720.jpg'
],
'keep_audio' => false,
'aspect_ratio' => 'auto',
'duration' => 5
]),
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://api.aihubmax.com/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"kling-o3-video-to-video-reference\",\n \"prompt\": \"参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频\",\n \"resolution\": \"720p\",\n \"video_url\": \"https://samplelib.com/lib/preview/mp4/sample-5s.mp4\",\n \"image_urls\": [\n \"https://picsum.photos/id/1043/1280/720.jpg\"\n ],\n \"keep_audio\": false,\n \"aspect_ratio\": \"auto\",\n \"duration\": 5\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://api.aihubmax.com/v1/videos/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kling-o3-video-to-video-reference\",\n \"prompt\": \"参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频\",\n \"resolution\": \"720p\",\n \"video_url\": \"https://samplelib.com/lib/preview/mp4/sample-5s.mp4\",\n \"image_urls\": [\n \"https://picsum.photos/id/1043/1280/720.jpg\"\n ],\n \"keep_audio\": false,\n \"aspect_ratio\": \"auto\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/v1/videos/generations")
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 \"model\": \"kling-o3-video-to-video-reference\",\n \"prompt\": \"参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频\",\n \"resolution\": \"720p\",\n \"video_url\": \"https://samplelib.com/lib/preview/mp4/sample-5s.mp4\",\n \"image_urls\": [\n \"https://picsum.photos/id/1043/1280/720.jpg\"\n ],\n \"keep_audio\": false,\n \"aspect_ratio\": \"auto\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "video"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}Kling-O3
可灵-O3 参考视频生视频
- Kling O3 参考视频风格迁移模型
- 将参考视频的风格或运镜迁移到新生成的视频中
- 支持 720p / 1080p 两种分辨率
- 异步处理模式,使用返回的任务ID 进行查询
- 生成的视频链接,有效期为24小时,请尽快保存
POST
/
v1
/
videos
/
generations
Kling O3 V2V Reference
curl --request POST \
--url https://api.aihubmax.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-o3-video-to-video-reference",
"prompt": "参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频",
"resolution": "720p",
"video_url": "https://samplelib.com/lib/preview/mp4/sample-5s.mp4",
"image_urls": [
"https://picsum.photos/id/1043/1280/720.jpg"
],
"keep_audio": false,
"aspect_ratio": "auto",
"duration": 5
}
'import requests
url = "https://api.aihubmax.com/v1/videos/generations"
payload = {
"model": "kling-o3-video-to-video-reference",
"prompt": "参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频",
"resolution": "720p",
"video_url": "https://samplelib.com/lib/preview/mp4/sample-5s.mp4",
"image_urls": ["https://picsum.photos/id/1043/1280/720.jpg"],
"keep_audio": False,
"aspect_ratio": "auto",
"duration": 5
}
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({
model: 'kling-o3-video-to-video-reference',
prompt: '参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频',
resolution: '720p',
video_url: 'https://samplelib.com/lib/preview/mp4/sample-5s.mp4',
image_urls: ['https://picsum.photos/id/1043/1280/720.jpg'],
keep_audio: false,
aspect_ratio: 'auto',
duration: 5
})
};
fetch('https://api.aihubmax.com/v1/videos/generations', 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.aihubmax.com/v1/videos/generations",
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([
'model' => 'kling-o3-video-to-video-reference',
'prompt' => '参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频',
'resolution' => '720p',
'video_url' => 'https://samplelib.com/lib/preview/mp4/sample-5s.mp4',
'image_urls' => [
'https://picsum.photos/id/1043/1280/720.jpg'
],
'keep_audio' => false,
'aspect_ratio' => 'auto',
'duration' => 5
]),
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://api.aihubmax.com/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"kling-o3-video-to-video-reference\",\n \"prompt\": \"参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频\",\n \"resolution\": \"720p\",\n \"video_url\": \"https://samplelib.com/lib/preview/mp4/sample-5s.mp4\",\n \"image_urls\": [\n \"https://picsum.photos/id/1043/1280/720.jpg\"\n ],\n \"keep_audio\": false,\n \"aspect_ratio\": \"auto\",\n \"duration\": 5\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://api.aihubmax.com/v1/videos/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"kling-o3-video-to-video-reference\",\n \"prompt\": \"参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频\",\n \"resolution\": \"720p\",\n \"video_url\": \"https://samplelib.com/lib/preview/mp4/sample-5s.mp4\",\n \"image_urls\": [\n \"https://picsum.photos/id/1043/1280/720.jpg\"\n ],\n \"keep_audio\": false,\n \"aspect_ratio\": \"auto\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/v1/videos/generations")
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 \"model\": \"kling-o3-video-to-video-reference\",\n \"prompt\": \"参考 @Video1 的镜头运动节奏与 @Image1 的水彩风格,生成一段雨夜街景视频\",\n \"resolution\": \"720p\",\n \"video_url\": \"https://samplelib.com/lib/preview/mp4/sample-5s.mp4\",\n \"image_urls\": [\n \"https://picsum.photos/id/1043/1280/720.jpg\"\n ],\n \"keep_audio\": false,\n \"aspect_ratio\": \"auto\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "video"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}授权
所有接口均需要使用Bearer Token进行认证
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
kling-o3-video-to-video-reference:参考视频风格/运镜迁移
示例:
"kling-o3-video-to-video-reference"
文本提示词
说明:
- 最长 2500 字符
- 可使用
@Video1/@Image1/@Element1引用素材
Maximum string length:
2500示例:
"参考 @Video1 的运动节奏,生成一段雨夜街景短片"
参考视频 URL
说明:
- 支持
.mp4/.mov - 时长
3-10秒 - 宽高
720-2160px - 最大
200MB - 在提示词中用
@Video1引用
示例:
"https://samplelib.com/lib/preview/mp4/sample-5s.mp4"
输出分辨率
可选值:
720p— 720P 标清1080p— 1080P 高清
示例:
"720p"
是否保留参考视频原始音频
非必须不要传这个参数。
示例:
true
参考图片 URL 列表
说明:
- 在提示词中使用
@Image1/@Image2引用 image_urls与elements总数最多4个
示例:
[ "https://picsum.photos/id/1043/1280/720.jpg" ]
主体元素列表(仅支持图片主体)
说明:
- 在提示词中使用
@Element1/@Element2引用 image_urls与elements总数最多4个
非必须不要传这个参数。
Show child attributes
Show child attributes
示例:
[ { "frontal_image_url": "https://picsum.photos/id/1027/768/1024.jpg" } ]
输出视频宽高比
可选值: auto、16:9、9:16、1:1
示例:
"auto"
输出视频时长(秒),3-15
示例:
5
响应
任务创建成功
任务创建时间戳
示例:
1757165031
任务ID
示例:
"task-unified-1757165031-uyujaw3d"
实际使用的模型名称
任务的具体类型
可用选项:
video.generation.task 任务进度百分比 (0-100)
必填范围:
0 <= x <= 100示例:
0
任务状态
可用选项:
pending, processing, completed, failed 示例:
"pending"
异步任务信息
Show child attributes
Show child attributes
任务的输出类型
可用选项:
video 示例:
"video"
⌘I