AI 模型接口视频(Videos)可灵格式
Kling 图生视频
接口
POST /kling/v1/videos/image2video
请求头
| Header | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <token> |
Content-Type | 是 | application/json |
Accept | 是 | application/json |
请求参数
application/json
说明:以下字段按 schema 展示,OpenAPI 未显式声明 body 字段必填项。
| 字段 | 位置 | 类型 | 说明 |
|---|---|---|---|
model | body | string | 模型 / 风格 ID |
prompt | body | string | 文本提示词 |
image | body | string | 图片输入,支持 URL 或 Base64 |
duration | body | number | 视频时长,单位秒 |
width | body | integer | 视频宽度 |
height | body | integer | 视频高度 |
fps | body | integer | 视频帧率 |
seed | body | integer | 随机种子 |
n | body | integer | 生成数量 |
response_format | body | string | 响应格式,通常为 url |
user | body | string | 用户标识 |
metadata | body | object | 扩展元数据,支持自定义字段 |
响应参数
application/json
| 字段 | 类型 | 说明 |
|---|---|---|
task_id | string | 任务 ID |
status | string | 任务状态,创建成功时通常为 queued |
错误响应
400 Bad Request
| 字段 | 类型 | 说明 |
|---|---|---|
error.message | string | 错误信息 |
error.type | string | 错误类型 |
error.param | string | null | 相关参数 |
error.code | string | null | 错误代码 |
说明
- 图生视频接口会使用
image作为输入图像。 response_format当前按url返回。
Authorization
BearerAuth
AuthorizationBearer <token>
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
In: header
Request Body
application/json
model?string
模型/风格 ID
prompt?string
文本描述提示词
image?string
图片输入 (URL 或 Base64)
duration?number
视频时长(秒)
width?integer
视频宽度
height?integer
视频高度
fps?integer
视频帧率
seed?integer
随机种子
n?integer
生成视频数量
response_format?string
响应格式
user?string
用户标识
metadata?
扩展参数 (如 negative_prompt, style, quality_level 等)
Response Body
application/json
application/json
curl -X POST "https://tokenfleet.cn/kling/v1/videos/image2video" \ -H "Content-Type: application/json" \ -d '{}'{
"task_id": "abcd1234efgh",
"status": "queued"
}{
"error": {
"message": "string",
"type": "string",
"param": "string",
"code": "string"
}
}