创建图生视频任务
curl --request POST \
--url https://api.keevx.cn/v1/image_to_video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "KL",
"prompt": "一只金毛犬在草地上奔跑,阳光明媚,电影级光影",
"aspect_ratio": "16:9",
"aspect_resolution": "1080p",
"duration": 5,
"reference_images": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg"
],
"generate_count": 1,
"callback_url": "https://your-server.com/callback"
}
'import requests
url = "https://api.keevx.cn/v1/image_to_video"
payload = {
"model": "KL",
"prompt": "一只金毛犬在草地上奔跑,阳光明媚,电影级光影",
"aspect_ratio": "16:9",
"aspect_resolution": "1080p",
"duration": 5,
"reference_images": ["https://example.com/ref1.jpg", "https://example.com/ref2.jpg"],
"generate_count": 1,
"callback_url": "https://your-server.com/callback"
}
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: 'KL',
prompt: '一只金毛犬在草地上奔跑,阳光明媚,电影级光影',
aspect_ratio: '16:9',
aspect_resolution: '1080p',
duration: 5,
reference_images: ['https://example.com/ref1.jpg', 'https://example.com/ref2.jpg'],
generate_count: 1,
callback_url: 'https://your-server.com/callback'
})
};
fetch('https://api.keevx.cn/v1/image_to_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://api.keevx.cn/v1/image_to_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([
'model' => 'KL',
'prompt' => '一只金毛犬在草地上奔跑,阳光明媚,电影级光影',
'aspect_ratio' => '16:9',
'aspect_resolution' => '1080p',
'duration' => 5,
'reference_images' => [
'https://example.com/ref1.jpg',
'https://example.com/ref2.jpg'
],
'generate_count' => 1,
'callback_url' => 'https://your-server.com/callback'
]),
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.keevx.cn/v1/image_to_video"
payload := strings.NewReader("{\n \"model\": \"KL\",\n \"prompt\": \"一只金毛犬在草地上奔跑,阳光明媚,电影级光影\",\n \"aspect_ratio\": \"16:9\",\n \"aspect_resolution\": \"1080p\",\n \"duration\": 5,\n \"reference_images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\"\n ],\n \"generate_count\": 1,\n \"callback_url\": \"https://your-server.com/callback\"\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.keevx.cn/v1/image_to_video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"KL\",\n \"prompt\": \"一只金毛犬在草地上奔跑,阳光明媚,电影级光影\",\n \"aspect_ratio\": \"16:9\",\n \"aspect_resolution\": \"1080p\",\n \"duration\": 5,\n \"reference_images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\"\n ],\n \"generate_count\": 1,\n \"callback_url\": \"https://your-server.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keevx.cn/v1/image_to_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 = "{\n \"model\": \"KL\",\n \"prompt\": \"一只金毛犬在草地上奔跑,阳光明媚,电影级光影\",\n \"aspect_ratio\": \"16:9\",\n \"aspect_resolution\": \"1080p\",\n \"duration\": 5,\n \"reference_images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\"\n ],\n \"generate_count\": 1,\n \"callback_url\": \"https://your-server.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "ok",
"data": {
"task_ids": [
"i2v-d6b6472bcf724d0399e06d1390cb964e",
"i2v-fc654817587e435e937f1e1b80366c00"
]
}
}{
"code": 100001,
"msg": "<string>"
}图生视频
创建图生视频任务
创建一个使用 KL 模型从图片生成视频的任务。
POST
/
v1
/
image_to_video
创建图生视频任务
curl --request POST \
--url https://api.keevx.cn/v1/image_to_video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "KL",
"prompt": "一只金毛犬在草地上奔跑,阳光明媚,电影级光影",
"aspect_ratio": "16:9",
"aspect_resolution": "1080p",
"duration": 5,
"reference_images": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg"
],
"generate_count": 1,
"callback_url": "https://your-server.com/callback"
}
'import requests
url = "https://api.keevx.cn/v1/image_to_video"
payload = {
"model": "KL",
"prompt": "一只金毛犬在草地上奔跑,阳光明媚,电影级光影",
"aspect_ratio": "16:9",
"aspect_resolution": "1080p",
"duration": 5,
"reference_images": ["https://example.com/ref1.jpg", "https://example.com/ref2.jpg"],
"generate_count": 1,
"callback_url": "https://your-server.com/callback"
}
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: 'KL',
prompt: '一只金毛犬在草地上奔跑,阳光明媚,电影级光影',
aspect_ratio: '16:9',
aspect_resolution: '1080p',
duration: 5,
reference_images: ['https://example.com/ref1.jpg', 'https://example.com/ref2.jpg'],
generate_count: 1,
callback_url: 'https://your-server.com/callback'
})
};
fetch('https://api.keevx.cn/v1/image_to_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://api.keevx.cn/v1/image_to_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([
'model' => 'KL',
'prompt' => '一只金毛犬在草地上奔跑,阳光明媚,电影级光影',
'aspect_ratio' => '16:9',
'aspect_resolution' => '1080p',
'duration' => 5,
'reference_images' => [
'https://example.com/ref1.jpg',
'https://example.com/ref2.jpg'
],
'generate_count' => 1,
'callback_url' => 'https://your-server.com/callback'
]),
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.keevx.cn/v1/image_to_video"
payload := strings.NewReader("{\n \"model\": \"KL\",\n \"prompt\": \"一只金毛犬在草地上奔跑,阳光明媚,电影级光影\",\n \"aspect_ratio\": \"16:9\",\n \"aspect_resolution\": \"1080p\",\n \"duration\": 5,\n \"reference_images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\"\n ],\n \"generate_count\": 1,\n \"callback_url\": \"https://your-server.com/callback\"\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.keevx.cn/v1/image_to_video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"KL\",\n \"prompt\": \"一只金毛犬在草地上奔跑,阳光明媚,电影级光影\",\n \"aspect_ratio\": \"16:9\",\n \"aspect_resolution\": \"1080p\",\n \"duration\": 5,\n \"reference_images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\"\n ],\n \"generate_count\": 1,\n \"callback_url\": \"https://your-server.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keevx.cn/v1/image_to_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 = "{\n \"model\": \"KL\",\n \"prompt\": \"一只金毛犬在草地上奔跑,阳光明媚,电影级光影\",\n \"aspect_ratio\": \"16:9\",\n \"aspect_resolution\": \"1080p\",\n \"duration\": 5,\n \"reference_images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\"\n ],\n \"generate_count\": 1,\n \"callback_url\": \"https://your-server.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "ok",
"data": {
"task_ids": [
"i2v-d6b6472bcf724d0399e06d1390cb964e",
"i2v-fc654817587e435e937f1e1b80366c00"
]
}
}{
"code": 100001,
"msg": "<string>"
}模型参数详细规则
根据model 的值,各参数的必填状态和有效范围如下:
- Model KL
名称:标准模型-多参考图生视频特性:强制使用多参考图输入。
| 参数 | 是否必填 | 说明 |
|---|---|---|
| prompt | 是 | 图生视频提示词。 |
| reference_images | 是 | 必须提供参考图列表。(最多 7 张图片) |
| aspect_resolution | 是 | 支持 720p、1080p。 |
| duration | 是 | 支持 5、10 秒。 |
| image_url | 否 | 不支持。 |
回调通知
视频生成任务处理完成后,服务将向发起请求中提供的callback_url 发送一个 POST 请求。
结构
回调示例
{
"code": 0,
"msg": "ok",
"task_type": "image_to_video",
"data": {
"task_id": "i2v-d6b6472bcf724d0399e06d1390cb964e",
"status": "SUCCEEDED",
"video_url": "https://xiling-dh.bj.bcebos.com/tmp/image2video/kling/951742d2-bea1-4ccf-acfa-73cb7b073ae8/i2v-82b660e5aea44414a2a7b10c12b6bcbd/6544fe9d-0b2e-423e-9b2f-33303ff48c04.mp4",
"thumbnail_url": "https://xiling-dh.cdn.bcebos.com/media/image2video/converted/93c9943d-3323-42ee-b7cc-6915517ec4dd_converted.jpg",
"error_message": ""
}
}
授权
请求体
application/json
创建图生视频任务,使用 KL 模型。

