切换主题
Kling 图生视频
使用 Kling 模型从图片生成视频。
支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。
Kling 图生视频
POST /kling/v1/videos/image2video
使用 Kling 模型从图片生成视频。
支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。
认证
BearerAuth
请求体
必填:否
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| model | 否 | string | 模型/风格 ID Examples: kling-v1 |
| prompt | 否 | string | 文本描述提示词 Examples: 宇航员站起身走了 |
| image | 否 | string | 图片输入 (URL 或 Base64) Examples: https://example.com/image.jpg |
| duration | 否 | number | 视频时长(秒) Examples: 5 |
| width | 否 | integer | 视频宽度 Examples: 1280 |
| height | 否 | integer | 视频高度 Examples: 720 |
| fps | 否 | integer | 视频帧率 Examples: 30 |
| seed | 否 | integer | 随机种子 Examples: 20231234 |
| n | 否 | integer | 生成视频数量 Examples: 1 |
| response_format | 否 | string | 响应格式 Examples: url |
| user | 否 | string | 用户标识 Examples: user-1234 |
| metadata | 否 | object | 扩展参数 (如 negative_prompt, style, quality_level 等) |
原始 Schema
json
{
"type": "object",
"description": "视频生成请求",
"properties": {
"model": {
"type": "string",
"description": "模型/风格 ID",
"examples": [
"kling-v1"
]
},
"prompt": {
"type": "string",
"description": "文本描述提示词",
"examples": [
"宇航员站起身走了"
]
},
"image": {
"type": "string",
"description": "图片输入 (URL 或 Base64)",
"examples": [
"https://example.com/image.jpg"
]
},
"duration": {
"type": "number",
"description": "视频时长(秒)",
"examples": [
5
]
},
"width": {
"type": "integer",
"description": "视频宽度",
"examples": [
1280
]
},
"height": {
"type": "integer",
"description": "视频高度",
"examples": [
720
]
},
"fps": {
"type": "integer",
"description": "视频帧率",
"examples": [
30
]
},
"seed": {
"type": "integer",
"description": "随机种子",
"examples": [
20231234
]
},
"n": {
"type": "integer",
"description": "生成视频数量",
"examples": [
1
]
},
"response_format": {
"type": "string",
"description": "响应格式",
"examples": [
"url"
]
},
"user": {
"type": "string",
"description": "用户标识",
"examples": [
"user-1234"
]
},
"metadata": {
"type": "object",
"description": "扩展参数 (如 negative_prompt, style, quality_level 等)",
"additionalProperties": true,
"properties": {},
"x-apifox-orders": []
}
},
"x-apifox-orders": [
"model",
"prompt",
"image",
"duration",
"width",
"height",
"fps",
"seed",
"n",
"response_format",
"user",
"metadata"
]
}响应
200 成功创建视频生成任务
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| task_id | 否 | string | 任务 ID Examples: abcd1234efgh |
| status | 否 | string | 任务状态 Examples: queued |
原始 Schema
json
{
"type": "object",
"description": "视频生成任务提交响应",
"properties": {
"task_id": {
"type": "string",
"description": "任务 ID",
"examples": [
"abcd1234efgh"
]
},
"status": {
"type": "string",
"description": "任务状态",
"examples": [
"queued"
]
}
},
"x-apifox-orders": [
"task_id",
"status"
]
}400 请求参数错误
application/json
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| error | 否 | object | - |
| error.message | 否 | string | 错误信息 |
| error.type | 否 | string | 错误类型 |
| error.param | 否 | string | null | 相关参数 |
| error.code | 否 | string | null | 错误代码 |
原始 Schema
json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "错误信息"
},
"type": {
"type": "string",
"description": "错误类型"
},
"param": {
"type": [
"string",
"null"
],
"description": "相关参数"
},
"code": {
"type": [
"string",
"null"
],
"description": "错误代码"
}
},
"x-apifox-orders": [
"message",
"type",
"param",
"code"
]
}
},
"x-apifox-orders": [
"error"
]
}