1. kling
梧柏API使用文档
WHBAI · Kling
  • WHBAI · Google Gemini 原生 (v1alpha)
  • WHBAI · Google Gemini 原生
  • WHBAI · Ideogram
  • WHBAI · Ideogram V3
  • WHBAI · Midjourney
  • WHBAI · Jimeng
  • WHBAI · Kling
  • WHBAI · Luma
  • WHBAI · Luma V1
  • WHBAI · Omni 视频
  • WHBAI · Pixverse
  • WHBAI · Runway
  • WHBAI · Sora2
  • WHBAI · 统一视频 VEO
  • WHBAI · Vidu
  • WHBAI · 豆包 Volc
  • WHBAI · Suno
  • WHBAI · Playground
  • WHBAI · 账号与令牌
  • WHBAI · 阿里 Pix
  • WHBAI · 阿里百炼
  • WHBAI · 私域人像
  • WHBAI · Fal.ai
  • WHBAI · Replicate
  • WHBAI · 腾讯云 VOD
  • WHBAI · MiniMax
  • WHBAI · 支持模型列表
  • WHBAI · Grok Imagine
  • WHBAI · Seedance 2.0
  • WHBAI · TypeSafe
  • WHBAI · OpenAI 兼容
  • 可灵 Kling
    • 文生音效
    • 文生视频
    • 图生视频
    • 文生图
    • 查询文生视频任务
    • Omni-Video
  • kling
    • 对口型
      POST
    • 虚拟试穿
      POST
    • 视频延长
      POST
    • 视频特效
      POST
    • 多图参考生视频
      POST
    • 查询任务(免费)
      GET
    • 查询任务(单个)
      GET
    • Omni-Image
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 初始化待编辑视频
      POST
    • 增加视频选区
      POST
    • 删减视频选区
      POST
    • 预览已选区视频
      POST
    • 多模态视频
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 多图参考生图
      POST
    • 查询任务(单个)
      GET
    • 文生视频
      POST
    • 图生视频
      POST
    • 查询视频
      GET
    • 查询任务(单个)
      GET
    • 扩图
      POST
    • 查询任务(单个)
      GET
    • 图像识别
      POST
    • 数字人
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 视频生音效
      POST
    • 查询任务(单个)
      GET
    • 语音合成
      POST
    • 查询任务(单个)
      GET
    • 人脸识别
      POST
    • 对口型
      POST
    • 查询任务(单个)
      GET
    • 自定义音色
      POST
    • 查询自定义音色(单个)
      GET
    • 查询官方音色
      GET
    • 删除自定义音色
      POST
    • 动作控制
      POST
    • 查询任务(单个)
      GET
    • 主体(旧)
      POST
    • 主体(新版本)
      POST
    • 查询自定义主体(单个新版本)
      GET
    • 查询官方主体(列表新版本)
      GET
    • 删除自定义主体(新版本)
      POST
  • 数据模型
    • KlingTaskSubmitResponse
    • KlingTaskQueryResponse
    • KlingText2VideoRequest
    • KlingImage2VideoRequest
    • PostKlingV1ImagesGenerationsRequest
    • KlingOmniVideoRequest
    • NewApiError
  1. kling

多图参考生视频

POST
/kling/v1/videos/multi-image2video

网站中的模型与调用示例#

多图参考生视频#

其他参数 请看 官方文档 https://app.klingai.com/cn/dev/document-api/apiReference/updateNotice
参数是一致的,对接时,仅需将请求域名、API key 改成我们

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "callback_url": {
      "description": "回调通知地址,可选,用于接收任务状态更新",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Optional callback URL for task status updates."
        }
      }
    },
    "cfg_scale": {
      "description": "生成视频的自由度,可选,取值范围0-1,值越大相关性越强",
      "type": "number",
      "x-i18n": {
        "en-US": {
          "description": "Creativity/guidance for video generation (optional), range 0-1; higher values follow the prompt more closely."
        }
      }
    },
    "duration": {
      "description": "生成视频时长,单位秒,可选值:5或10(注意:包含尾帧的请求仅支持5秒)",
      "type": "number",
      "x-i18n": {
        "en-US": {
          "description": "Video duration in seconds: 5 or 10. Requests with an end frame only support 5 seconds."
        }
      }
    },
    "image": {
      "description": "参考图像,必需,支持Base64编码 或图片URL,支持.jpg/.jpeg/.png格式,大小不超过10MB,分辨率不小于300*300px\nbese64 不能传入 ",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Reference image (required). Base64 or URL. jpg/jpeg/png, max 10MB, min resolution 300x300px."
        }
      }
    },
    "image_tail": {
      "description": "参考图像-尾帧控制,可选,支持Base64编码或图片URL,支持.jpg/.jpeg/.png格式,大小不超过10MB,分辨率不小于300*300px",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "End-frame reference image (optional). Base64 or URL. jpg/jpeg/png, max 10MB, min 300x300px."
        }
      }
    },
    "mode": {
      "description": "生成视频的模式,可选,std(高性能)或 pro(高表现)",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Video generation mode (optional): std (high performance) or pro (high quality)."
        }
      }
    },
    "model_name": {
      "description": "kling-v1、kling-v1-5、kling-v1-6\n",
      "type": "string"
    },
    "negative_prompt": {
      "description": "负向文本提示,可选,描述不想在视频中出现的元素,不超过2000字符",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Negative text prompt (optional). Elements to avoid. Max 2000 characters."
        }
      }
    },
    "prompt": {
      "description": "正向文本提示,可选,描述想要生成的视频内容,不超过5000字符",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Positive text prompt (optional). Describes desired video content. Max 5000 characters."
        }
      }
    }
  },
  "required": [
    "model_name",
    "image",
    "image_tail",
    "prompt",
    "negative_prompt",
    "cfg_scale",
    "mode",
    "duration",
    "callback_url"
  ]
}

请求示例 · 示例 1#

{
  "aspect_ratio": "1:1",
  "duration": "5",
  "image_list": [
    {
      "image": "https://cdn.klingai.com/bs2/upload-kling-api/9471259838/image/Cl6kH2gHPegAAAAAAjveaQ-0_raw_image_0.png"
    },
    {
      "image": "https://cdn.klingai.com/bs2/upload-kling-api/9471259838/image/Cl6kH2gHPegAAAAAAjveaQ-0_raw_image_0.png"
    }
  ],
  "image_tail": "",
  "mode": "std",
  "model_name": "kling-v1-6",
  "negative_prompt": "",
  "prompt": "flow"
}

多图参考生视频#

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "aspect_ratio": {
      "description": "画幅比例。可选;传入时网关预检枚举,不传则由上游决定。",
      "enum": [
        "16:9",
        "9:16",
        "1:1"
      ],
      "type": "string",
      "x-apifox-enum": [
        {
          "description": "宽屏横构图",
          "name": "横屏",
          "value": "16:9"
        },
        {
          "description": "短视频竖构图",
          "name": "竖屏",
          "value": "9:16"
        },
        {
          "description": "正方形构图",
          "name": "方屏",
          "value": "1:1"
        }
      ],
      "x-i18n": {
        "en-US": {
          "description": "Aspect ratio, optional. Gateway validates enum when set; otherwise upstream decides."
        }
      }
    },
    "callback_url": {
      "description": "任务完成回调地址,须公网可达,网关原样透传。",
      "format": "uri",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Task completion callback URL; must be publicly reachable; gateway pass-through."
        }
      }
    },
    "cfg_scale": {
      "description": "生成自由度(CFG),可选。网关透传,不预检范围。",
      "type": "number",
      "x-i18n": {
        "en-US": {
          "description": "CFG, optional. Gateway pass-through; range not pre-validated."
        }
      }
    },
    "duration": {
      "description": "视频时长(秒),必填。仅 5 或 10;支持 string / integer,网关归一化为字符串。缺失时在 Relay 计费层报 duration must be 5 or 10。",
      "oneOf": [
        {
          "enum": [
            "5",
            "10"
          ],
          "type": "string"
        },
        {
          "enum": [
            5,
            10
          ],
          "type": "integer"
        }
      ],
      "x-i18n": {
        "en-US": {
          "description": "Video duration (seconds), required. Only 5 or 10; string/integer OK; gateway normalizes to string. If missing, Relay billing: duration must be 5 or 10."
        }
      }
    },
    "external_task_id": {
      "description": "调用方外部任务 ID,用于幂等关联与业务对账;非响应 data.task_id。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Caller external task ID for idempotency/reconciliation; not response data.task_id."
        }
      }
    },
    "image_list": {
      "description": "参考图列表,必填。1~4 张;每项须含 image 字段(URL 或 Base64)。网关只校验 image 非空,格式/大小由上游校验。",
      "items": {
        "additionalProperties": true,
        "properties": {
          "image": {
            "description": "参考图 URL 或 Base64,必填。勿用 image_url 替代(网关只认 image 字段)。",
            "minLength": 1,
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "Reference image URL or Base64, required. Do not use image_url (gateway only reads image)."
              }
            }
          },
          "image_fidelity": {
            "description": "图片保真度,网关透传,不预检范围。",
            "type": "number",
            "x-i18n": {
              "en-US": {
                "description": "Image fidelity; gateway pass-through; range not pre-validated."
              }
            }
          },
          "image_url": {
            "description": "备用图片 URL 字段,网关校验不读取此字段;请使用 image。",
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "backup image URL field; gateway validation ignores it—use image."
              }
            }
          },
          "type": {
            "description": "图片类型标记,网关透传,本接口不预检枚举。",
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "Image type flag; gateway pass-through; enum not pre-validated here."
              }
            }
          }
        },
        "required": [
          "image"
        ],
        "type": "object"
      },
      "maxItems": 4,
      "minItems": 1,
      "type": "array",
      "x-i18n": {
        "en-US": {
          "description": "Reference images, required, 1–4; each needs image (URL/Base64). Gateway only checks non-empty; format/size by upstream."
        }
      }
    },
    "mode": {
      "description": "生成模式。不传时计费侧默认 std。不支持 4k。",
      "enum": [
        "std",
        "pro"
      ],
      "type": "string",
      "x-apifox-enum": [
        {
          "description": "性价比模式",
          "name": "标准",
          "value": "std"
        },
        {
          "description": "高表现模式,计费更高",
          "name": "高品质",
          "value": "pro"
        }
      ],
      "x-i18n": {
        "en-US": {
          "description": "generation mode. billing defaults to std if omitted. 4k not supported."
        }
      }
    },
    "model_name": {
      "description": "模型名称,必填。网关仅允许 kling-v1-6;缺失或其他值返回 400。",
      "enum": [
        "kling-v1-6"
      ],
      "type": "string",
      "x-apifox-enum": [
        {
          "description": "多图参考生视频唯一支持模型;duration 仅 5/10 秒",
          "name": "V1.6",
          "value": "kling-v1-6"
        }
      ],
      "x-i18n": {
        "en-US": {
          "description": "Model name, required. Gateway only allows kling-v1-6; otherwise 400."
        }
      }
    },
    "negative_prompt": {
      "description": "负向提示词,可选。网关透传,不预检长度(仅 prompt 有 2500 校验)。",
      "maxLength": 2500,
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Negative prompt, optional. Gateway pass-through; length not pre-validated (only prompt has 2500 check)."
        }
      }
    },
    "prompt": {
      "description": "正向提示词,可选。网关不强制必填;若传入须 ≤2500 字符。建议填写以引导运动与风格。",
      "maxLength": 2500,
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Positive prompt, optional. Gateway does not require it; if set, ≤2500 chars. Recommended to guide motion/style."
        }
      }
    }
  },
  "required": [
    "model_name",
    "image_list",
    "duration"
  ]
}

请求示例 · 多图生视频 · 双图最小可用#

{
  "aspect_ratio": "16:9",
  "duration": "5",
  "image_list": [
    {
      "image": "{{image_url_1}}"
    },
    {
      "image": "{{image_url_2}}"
    }
  ],
  "mode": "std",
  "model_name": "kling-v1-6",
  "prompt": "A cinematic scene blending the subjects from reference images, smooth camera movement"
}

请求示例 · 新手推荐:多图生视频 · 单图竖屏#

{
  "aspect_ratio": "9:16",
  "duration": 5,
  "image_list": [
    {
      "image": "{{image_url_1}}"
    }
  ],
  "mode": "std",
  "model_name": "kling-v1-6",
  "prompt": "The character turns and walks forward, soft natural lighting"
}

请求示例 · 新手推荐:多图生视频 · 四图上限#

{
  "aspect_ratio": "16:9",
  "duration": "10",
  "image_list": [
    {
      "image": "{{image_url_1}}"
    },
    {
      "image": "{{image_url_2}}"
    },
    {
      "image": "{{image_url_3}}"
    },
    {
      "image": "{{image_url_4}}"
    }
  ],
  "model_name": "kling-v1-6",
  "prompt": "Combine scene, character, style and lighting from all reference images"
}

请求示例 · 进阶推荐:多图生视频 · 负向词 + pro 10 秒#

{
  "aspect_ratio": "16:9",
  "cfg_scale": 0.5,
  "duration": "10",
  "image_list": [
    {
      "image": "{{image_url_1}}"
    },
    {
      "image": "{{image_url_2}}"
    }
  ],
  "mode": "pro",
  "model_name": "kling-v1-6",
  "negative_prompt": "blurry, distorted face, low quality, watermark",
  "prompt": "Epic wide shot merging both characters into one cohesive action scene"
}

请求示例 · 进阶推荐:多图生视频 · 回调 + 外部任务 ID#

{
  "aspect_ratio": "1:1",
  "callback_url": "https://your-server.com/webhook/kling",
  "duration": "5",
  "external_task_id": "biz-mi2v-20260701-001",
  "image_list": [
    {
      "image": "{{image_url_1}}"
    },
    {
      "image": "{{image_url_2}}"
    },
    {
      "image": "{{image_url_3}}"
    }
  ],
  "mode": "pro",
  "model_name": "kling-v1-6",
  "prompt": "Fashion editorial style video with dynamic camera pan"
}

请求示例 · 进阶推荐:多图生视频 · duration 整数写法#

{
  "aspect_ratio": "16:9",
  "duration": 10,
  "image_list": [
    {
      "image": "{{image_url_1}}"
    },
    {
      "image": "{{image_url_2}}"
    }
  ],
  "mode": "std",
  "model_name": "kling-v1-6",
  "prompt": "Slow motion transition between two reference scenes"
}

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Header 参数

Body 参数application/json必填

示例
{
    "model_name": "kling-v1-6",
    "image_list": [
        {
            "image": "{{image_url_1}}"
        },
        {
            "image": "{{image_url_2}}"
        }
    ],
    "prompt": "A cinematic scene blending the subjects from reference images, smooth camera movement",
    "mode": "std",
    "duration": "5",
    "aspect_ratio": "16:9"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location '/kling/v1/videos/multi-image2video' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model_name": "kling-v1-6",
    "image_list": [
        {
            "image": "{{image_url_1}}"
        },
        {
            "image": "{{image_url_2}}"
        }
    ],
    "prompt": "A cinematic scene blending the subjects from reference images, smooth camera movement",
    "mode": "std",
    "duration": "5",
    "aspect_ratio": "16:9"
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "code": 0,
    "message": "success",
    "data": {
        "task_id": "task_example_001"
    }
}
🟠400请求有误
🟠401没有权限
修改于 2026-10-24 18:33:09
上一页
视频特效
下一页
查询任务(免费)
Built with