跳转至

Kling 图生视频

使用 Kling 模型从图片生成视频。

支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。

OpenAPI 摘要

Kling 图生视频

项目
方法 POST
路径 /kling/v1/videos/image2video
Operation ID createklingimage2video
标签 视频(Videos)/可灵格式

使用 Kling 模型从图片生成视频。

支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。

认证

名称 类型 方案 说明
BearerAuth http bearer 使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx

请求体

必填: 否

application/json
字段 类型 必填 说明
model string 模型/风格 ID
示例: kling-v1
prompt string 文本描述提示词
示例: 宇航员站起身走了
image string 图片输入 (URL 或 Base64)
示例: https://example.com/image.jpg
duration number 视频时长(秒)
示例: 5
width integer 视频宽度
示例: 1280
height integer 视频高度
示例: 720
fps integer 视频帧率
示例: 30
seed integer 随机种子
示例: 20231234
n integer 生成视频数量
示例: 1
response_format string 响应格式
示例: url
user string 用户标识
示例: user-1234
metadata object 扩展参数 (如 negative_prompt, style, quality_level 等)

调用案例

curl -X POST "https://你的newapi服务器地址/kling/v1/videos/image2video" \
  -H "Authorization: Bearer $NEWAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-4o",
  "prompt": "A cute baby sea otter wearing a beret.",
  "image": "https://example.com/image.png",
  "duration": 5,
  "width": 1280,
  "height": 720
}'

成功响应示例

{
  "task_id": "task_123456",
  "status": "queued"
}

响应

HTTP 200

成功创建视频生成任务

application/json
字段 类型 必填 说明
task_id string 任务 ID
示例: abcd1234efgh
status string 任务状态
示例: queued
HTTP 400

请求参数错误

application/json
字段 类型 必填 说明
error object
error.message string 错误信息
error.type string 错误类型
error.param string | null 相关参数
error.code string | null 错误代码

OpenAPI 源文件

openapi/generated/ai-model/视频(Videos)/可灵格式/post-kling-v1-videos-image2video-createklingimage2video-383844641.json