任务:图生视频
POST
https://api.chatgptsb.com/kling/v1/videos/image2video
请求参数
Header 参数
Content-Type
string
可选
示例值:
application/json
Authorization
string
可选
示例值:
Bearer sk-xxxx
Body 参数application/json
model
string
模型
示例值:
kling-v1
image
string
参考图片
image_tail
string
参考图像 - 尾帧控制
prompt
string
正向文本提示
negative_prompt
string
负向文本提示
cfg_scale
number
创意想象力
示例值:
0.5
mode
enum<string>
视频模式
pro
模式 价格 * 3.5倍枚举值:
stdpro
示例值:
pro
aspect_ratio
enum<string>
画面比例
枚举值:
16:99:161:1
示例值:
1:1
duration
enum<string>
视频时长(单位秒)
10
价格 * 两倍枚举值:
510
示例值:
5
callback_url
string
通知地址
示例
{
"image": "https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/803793c178a6f0526925d61bff58ef29.png",
"prompt": "海浪拍打着贝壳",
"mode": "std",
"duration": "5"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.chatgptsb.com/kling/v1/videos/image2video' \
--header 'Authorization: Bearer sk-xxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"image": "https://p1.a.kwimgs.com/bs2/upload-ylab-stunt/803793c178a6f0526925d61bff58ef29.png",
"prompt": "海浪拍打着贝壳",
"mode": "std",
"duration": "5"
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
task_id
string
必需
action
string
必需
status
string
必需
fail_reason
string
必需
submit_time
integer
必需
start_time
integer
必需
finish_time
integer
必需
progress
string
必需
data
object
必需
created_at
integer
必需
updated_at
integer
必需
task_result
object
必需
task_status
string
必需
task_status_msg
string
必需
request_id
string
必需
示例
{
"code": 0,
"message": "SUCCEED",
"request_id": "CmYgjmbyMToAAAAAAF6svw",
"data": {
"task_id": "CmYgjmbyMToAAAAAAF6svw",
"task_status": "submitted",
"created_at": 1727338013674,
"updated_at": 1727338013674
}
}
修改于 2024-11-26 03:07:15