Skip to content

Omni 视频

创建 Kling 兼容多模态 Omni 视频任务。

Create Task

Request

http
POST /v1/videos/omni-video
字段类型必填支持值与限制说明
model_namestringkling-v3-omniOmni 视频生成模型。当前只支持这一模型值。
multi_shotbooleantruefalse是否生成多镜头视频,默认 false。当 multi_shot=true 时,prompt 无效;当 multi_shot=false 时,shot_typemulti_prompt 无效。
shot_typestring仅支持 customizemulti_shot=true 时必填;当 multi_shot=false 时该字段无效。当前仅支持自定义分镜,intelligence 不支持。
promptstring最长 2500 字符multi_shot=false 时必填;当 multi_shot=true 时该字段无效。可在提示词中通过 <<<image_1>>><<<element_1>>><<<video_1>>> 引用输入内容。
multi_promptarray16multi_shot=trueshot_type=customize 时必填;当 multi_shot=false 时该字段无效,用于逐镜头定义提示词和时长。
multi_prompt[].indexinteger1 开始递增分镜序号。
multi_prompt[].promptstring最长 512 字符当前分镜的提示词。
multi_prompt[].durationstring每段至少 1当前分镜时长,所有分镜时长之和必须等于总 duration
image_listarray支持图片 URL 或原始 Base64参考图列表,可用于主体、场景、风格参考,也可作为首帧/尾帧。使用尾帧时必须同时有首帧;使用首帧或首尾帧生成视频时,不能使用视频编辑功能。
image_list[].image_urlstring.jpg.jpeg.png;不超过 10MB图片 URL 或原始 Base64。图片宽高不小于 300px,宽高比需在 1:2.52.5:1 之间。
image_list[].typestringfirst_frameend_frame图片帧类型。若使用尾帧,必须同时有首帧,不支持只传尾帧。参考图片超过 2 张时,不支持设置尾帧。
element_listarray按场景限制使用参考主体列表,适合在视频中保持角色或主体一致性。使用首帧或首尾帧时最多支持 3 个主体;有参考视频时,参考图片数量和参考主体数量之和不得超过 4,且不支持视频角色主体;无参考视频时,参考图片数量和参考主体数量之和不得超过 7
element_list[].element_idinteger已存在的主体 ID主体库中的主体 ID。
video_listarray最多 1 段视频参考视频列表,可做视频参考或视频编辑输入。使用 refer_type=base 时不能定义视频首尾帧;有参考视频时,sound 只能为 off
video_list[].video_urlstringMP4MOV视频 URL。视频时长不少于 3 秒,大小不超过 200MB,宽高需在 720px2160px 之间,帧率需在 24fps60fps 之间。使用视频参考能力时,仅支持 310 秒。
video_list[].refer_typestringfeaturebasefeature 表示参考视频;base 表示以该视频作为编辑输入。默认 base
video_list[].keep_original_soundstringyesno是否保留输入视频原声。该参数对 feature 参考视频同样生效。
soundstringonoff是否同时生成音频,默认 off。当传入 video_list 时,只能使用 off
modestringstdpro生成模式。std 为标准模式;pro 为高质量模式,默认 pro4k 不支持。
aspect_ratiostring16:99:161:1未使用首帧参考、也未使用视频编辑时,建议必传。
durationstring315视频总时长,单位秒。若 video_list[].refer_type=base,输出时长跟随输入视频,此字段不生效。
watermark_infoobject{"enabled": boolean}是否同时返回带水印结果。
external_task_idstring自定义字符串自定义任务 ID,可用于后续查询;同一账号下应保持唯一。

当请求包含 video_list 时,应将 sound 设为 off

Response

json
{
  "code": 0,
  "message": "success",
  "request_id": "req_abc123",
  "data": {
    "task_id": "sg_vid_xxxxxxxx",
    "task_status": "submitted",
    "created_at": 1776209922,
    "updated_at": 1776209922
  }
}

Example

基础示例

bash
curl -sS "https://api.exchangetoken.ai/v1/videos/omni-video" \
  -H "Authorization: Bearer sk-xxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "kling-v3-omni",
    "prompt": "让 <<<image_1>>> 走过霓虹展厅,整体氛围参考 <<<video_1>>>",
    "image_list": [
      {"image_url": "https://example.com/character.png"}
    ],
    "video_list": [
      {"video_url": "https://example.com/reference.mp4", "refer_type": "feature", "keep_original_sound": "no"}
    ],
    "mode": "pro",
    "sound": "off",
    "aspect_ratio": "16:9",
    "duration": "7"
  }'

首尾帧示例

bash
curl -sS "https://api.exchangetoken.ai/v1/videos/omni-video" \
  -H "Authorization: Bearer sk-xxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "kling-v3-omni",
    "prompt": "人物转身,镜头缓慢推进",
    "image_list": [
      {"image_url": "https://example.com/first.png", "type": "first_frame"},
      {"image_url": "https://example.com/end.png", "type": "end_frame"}
    ],
    "mode": "pro",
    "sound": "off",
    "duration": "5"
  }'

Query Task

Request

http
GET /v1/videos/omni-video/{task_id}

后续轮询使用 data.task_id

Response

json
{
  "code": 0,
  "message": "success",
  "request_id": "req_abc123",
  "data": {
    "task_id": "sg_vid_xxxxxxxx",
    "task_status": "succeed",
    "watermark_info": {
      "enabled": false
    },
    "task_result": {
      "videos": [
        {
          "url": "https://example.com/output.mp4"
        }
      ]
    },
    "created_at": 1776209922,
    "updated_at": 1776210072
  }
}

状态枚举

task_status含义
submitted任务已接受,尚未开始执行。
processing任务排队中或执行中。
succeed任务完成,可能包含 task_result.videos
failed任务失败或已取消。若存在 task_status_msg,可查看失败原因。

Example

bash
curl -sS "https://api.exchangetoken.ai/v1/videos/omni-video/sg_vid_xxxxxxxx" \
  -H "Authorization: Bearer sk-xxxxxx"