图生视频
curl --request POST \
--url https://api.maxapi.ai/kling/v1/videos/image2video \
--header 'Content-Type: application/json' \
--data '
{
"image": "https://example.com/a.png"
}
'import requests
url = "https://api.maxapi.ai/kling/v1/videos/image2video"
payload = { "image": "https://example.com/a.png" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({image: 'https://example.com/a.png'})
};
fetch('https://api.maxapi.ai/kling/v1/videos/image2video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/kling/v1/videos/image2video"
payload := strings.NewReader("{\n \"image\": \"https://example.com/a.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.maxapi.ai/kling/v1/videos/image2video")
.header("Content-Type", "application/json")
.body("{\n \"image\": \"https://example.com/a.png\"\n}")
.asString();{
"code": 0,
"message": "string",
"request_id": "string",
"data": {
"task_id": "string",
"task_status": "string",
"created_at": 0,
"updated_at": 0
}
}POST
https://api.maxapi.ai
/
kling
/
v1
/
videos
/
image2video
图生视频
curl --request POST \
--url https://api.maxapi.ai/kling/v1/videos/image2video \
--header 'Content-Type: application/json' \
--data '
{
"image": "https://example.com/a.png"
}
'import requests
url = "https://api.maxapi.ai/kling/v1/videos/image2video"
payload = { "image": "https://example.com/a.png" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({image: 'https://example.com/a.png'})
};
fetch('https://api.maxapi.ai/kling/v1/videos/image2video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/kling/v1/videos/image2video"
payload := strings.NewReader("{\n \"image\": \"https://example.com/a.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.maxapi.ai/kling/v1/videos/image2video")
.header("Content-Type", "application/json")
.body("{\n \"image\": \"https://example.com/a.png\"\n}")
.asString();{
"code": 0,
"message": "string",
"request_id": "string",
"data": {
"task_id": "string",
"task_status": "string",
"created_at": 0,
"updated_at": 0
}
}请求头
在 Header 添加参数 Authorization,其值为在 Bearer 之后拼接 Token 示例Authorization: Bearer YOUR_API_KEY
请求体
application/json
参考图像,必须,支持Base64编码或图片URL,支持.jpg / .jpeg / .png格式,大小不能超过10MB,分辨率不小于300*300px
参考图像 - 尾帧控制,可选,支持Base64编码或图片URL,支持.jpg / .jpeg / .png格式,大小不能超过10MB,分辨率不小于300*300px
正向文本提示, 可选,不能超过500个字符
Maximum string length:
5000负向文本提示,可选,不能超过200个字符
Maximum string length:
2000生成视频的自由度,可选,值越大相关性越强,取值范围:[0, 1]
必填范围:
0 <= x <= 1生成视频的模式,可选,枚举值:std(高性能)或 pro(高表现)
可用选项:
std(高性能), pro(高表现) 生成视频时长,单位秒,可选,枚举值:5,10(包含尾帧的请求仅支持5秒)
可用选项:
5, 10 本次任务结果回调通知地址,可选
响应
200 - application/json
请求成功
错误码;具体定义错误码
错误信息
请求ID,系统生成,用于跟踪请求、排查问题