Kling 图生视频
使用 Kling 模型从图片生成视频。 支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。
POST
https://api.xiexus.cn/kling/v1/videos/image2video
请求体:可选
接口信息
方法
POST路径
/kling/v1/videos/image2video完整地址
https://api.xiexus.cn/kling/v1/videos/image2video请求体
可选
标签
视频(Videos)/可灵格式
响应码
200400
静态文件
当前接口页内已嵌入 OpenAPI JSON;如果需要查看总文件,可直接打开固定静态文件
relay.json。当前 JSON
../../../openapi/generated/ai-model/视频(Videos)/可灵格式/post-kling-v1-videos-image2video-createklingimage2video-383844641.json总文件
../../../openapi/relay.jsonOpenAPI JSON
已将服务地址固定为
https://api.xiexus.cn,其余结构保持和源文档一致。{
"openapi": "3.1.0",
"info": {
"title": "Kling 图生视频",
"version": "1.0.0",
"description": "使用 Kling 模型从图片生成视频。\n\n支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。\n"
},
"tags": [
{
"name": "视频(Videos)/可灵格式"
}
],
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "使用 Bearer Token 认证。\n格式: `Authorization: Bearer sk-xxxxxx`\n"
}
}
},
"paths": {
"/kling/v1/videos/image2video": {
"post": {
"tags": [
"视频(Videos)/可灵格式"
],
"summary": "Kling 图生视频",
"description": "使用 Kling 模型从图片生成视频。\n\n支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。\n",
"operationId": "createklingimage2video",
"parameters": [],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"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"
]
}
}
}
},
"security": [
{
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "成功创建视频生成任务",
"content": {
"application/json": {
"schema": {
"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": {
"description": "请求参数错误",
"content": {
"application/json": {
"schema": {
"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"
]
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api.xiexus.cn",
"description": "固定生产地址"
}
]
}