Omni-Video

POST /kling/v1/videos/omni-video

MethodPOST
Path/kling/v1/videos/omni-video
Typehttp
Status1
Module2102810
Folder74107234

概览

MethodPOST
Path/kling/v1/videos/omni-video
Typehttp
Status1
Module2102810
Folder74107234

参数

{
  "header": [
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "sdTrFfapNw",
      "enable": true,
      "name": "Content-Type",
      "sampleValue": "application/json"
    },
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "ymxk8tgbx1",
      "enable": true,
      "name": "Authorization",
      "sampleValue": "Bearer {{YOUR_API_KEY}}"
    }
  ]
}

请求体

{
  "type": "application/json",
  "parameters": [],
  "jsonSchema": {
    "type": "object",
    "properties": {
      "model_name": {
        "type": "string",
        "description": "模型名称 枚举值:kling-video-o1  kling-v3-omni"
      },
      "prompt": {
        "type": "string",
        "description": "文本提示词,可包含正向描述和负向描述\n可将提示词模板化来满足不同的视频生成需求\n不能超过2500个字符\n当multi_shot参数为false,当前参数不得为空"
      },
      "image_list": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "image_url": {
              "type": "string"
            },
            "type": {
              "type": "string"
            }
          },
          "x-apifox-orders": [
            "image_url",
            "type"
          ]
        },
        "description": "参考图列表\n包括主体、场景、风格等参考图片,也可作为首帧或尾帧生成视频;当作为首帧或尾帧生成视频时:\n通过type参数来定义图片是否为首尾帧:first_frame为首帧,end_frame为尾帧\n暂时不支持仅尾帧,即有尾帧图时必须有首帧图\n首帧或首尾帧生视频时,不能使用视频编辑功能"
      },
      "video_list": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "video_url": {
              "type": "string"
            },
            "refer_type": {
              "type": "string"
            },
            "keep_original_sound": {
              "type": "string"
            }
          },
          "x-apifox-orders": [
            "video_url",
            "refer_type",
            "keep_original_sound"
          ]
        },
        "description": "参考视频,通过URL方式获取\n可作为特征参考视频,也可作为待编辑视频,默认为待编辑视频;可选择性保留视频原声\n通过refer_type参数区分参考视频类型:feature为特征参考视频,base为待编辑视频\n参考视频为待编辑视频时,不能定义视频首尾帧\n通过keep_original_sound参数选择是否保留视频原声,yes为保留,no为不保留;当前参数对特征参考视频(feature)也生效"
      },
      "mode": {
        "type": "string",
        "description": "生成视频的模式\n枚举值:std,pro\n其中std:标准模式(标准),基础模式,性价比高\n其中pro:专家模式(高品质),高表现模式,生成视频质量更佳"
      },
      "aspect_ratio": {
        "type": "string",
        "description": "生成视频的画面纵横比(宽:高)\n枚举值:16:9, 9:16, 1:1\n未使用首帧参考或视频编辑功能时,当前参数必填"
      },
      "duration": {
        "type": "string",
        "description": "生成视频时长,单位s\n枚举值:3,4,5,6,7,8,9,10,其中:\n使用文生视频、首帧图生视频时,仅支持5和10s\n使用视频编辑功能(“refer_type”:“base”)时,输出结果与传入视频时长相同,此时当前参数无效;此时,按输入视频时长四舍五入取整计量计费\nkling-v3-omni  支持\n● 枚举值:3,4,5,6,7,8,9,10,11,12,13,14,15,其中:\n使用视频编辑功能(\"refer_type\":\"base\")时,输出结果与传入视频时长相同,此时当前参数无效;此时,按输入视频时长四舍五入取整计量计费"
      },
      "callback_url": {
        "type": "string"
      },
      "external_task_id": {
        "type": "string"
      },
      "element_list": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "element_id": {
              "type": "string",
              "description": "主体id"
            }
          },
          "x-apifox-orders": [
            "element_id"
          ]
        },
        "description": "主体"
      },
      "multi_shot": {
        "type": "boolean",
        "description": "是否生成多镜头视频\n当前参数为true时,prompt参数无效\n当前参数为false时,shot_type参数及multi_prompt参数无效"
      },
      "shot_type": {
        "type": "string",
        "description": "分镜方式\n枚举值:customize\n当multi_shot参数为true时,当前参数必填"
      },
      "multi_prompt": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "index": {
              "type": "number",
              "description": "镜序号"
            },
            "prompt": {
              "type": "string",
              "description": "提示词"
            },
            "duration": {
              "type": "string",
              "description": "时长"
            }
          },
          "x-apifox-orders": [
            "index",
            "prompt",
            "duration"
          ]
        },
        "description": "各分镜信息,如提示词、时长等\n● 通过index、prompt、duration参数定义分镜序号及相应提示词和时长,其中:\n\t○ 最多支持6个分镜,最小支持1个分镜\n\t○ 每个分镜相关内容的最大长度不超过512\n\t○ 每个分镜的时长不大于当前任务的总时长,不小于1\n\t○ 所有分镜的时长之和等于当前任务的总时长"
      },
      "watermark_info": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "x-apifox-orders": [
          "enabled"
        ],
        "description": "是否同时生成含水印的结果\n● 通过enabled参数定义,用key:value承载,如下::\n\"watermark_info\": {\n \t\"enabled\": boolean // true 为生成,false 为不生成\n}"
      },
      "sound": {
        "type": "string",
        "description": "生成视频时是否同时生成声音\n枚举值:on,off"
      }
    },
    "required": [
      "model_name",
      "mode",
      "duration",
      "multi_shot"
    ],
    "x-apifox-orders": [
      "model_name",
      "multi_shot",
      "shot_type",
      "prompt",
      "multi_prompt",
      "sound",
      "image_list",
      "video_list",
      "element_list",
      "mode",
      "aspect_ratio",
      "duration",
      "watermark_info",
      "callback_url",
      "external_task_id"
    ]
  },
  "required": true,
  "mediaType": "",
  "examples": [
    {
      "mediaType": "application/json",
      "value": "{\r\n    \"model_name\": \"kling-video-o1\",\r\n    \"prompt\": \"生成一个海边有一个人跳舞的视频\",\r\n    \"negative_prompt\": \"\",\r\n    // \"cfg_scale\": 0.5,\r\n    \"mode\": \"std\",\r\n    \"sound\": \"off\",\r\n    // \"image_list\": [\r\n    //     {\r\n    //         \"image_url\": \"https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg\",\r\n    //         \"type\": \"first_frame\"\r\n    //     }\r\n    // ],\r\n    // \"video_list\": [\r\n    //     {\r\n    //         \"video_url\": \"\",\r\n    //         \"refer_type\": \"base\",\r\n    //         \"keep_original_sound\": \"yes\"\r\n    //     }\r\n    // ],\r\n    \"element_list\": [\r\n        {\r\n            \"element_id\": 835266081714884677\r\n        }\r\n    ],\r\n    \"aspect_ratio\": \"16:9\",\r\n    \"duration\": \"5\",\r\n    \"callback_url\": \"\",\r\n    \"external_task_id\": \"\"\r\n}"
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 118594433,
    "name": "成功",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {}
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": []
  }
]