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/general/advanced-custom-elements

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

主体(新版本)#

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "callback_url": {
      "description": "本次任务结果回调通知地址,如果配置,服务端会在任务状态发生变更时主动通知",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Task result callback URL; if set, server notifies on status changes"
        }
      }
    },
    "element_description": {
      "description": "不能超过100个字符",
      "title": "主体描述",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "max 100 characters"
        }
      }
    },
    "element_image_list": {
      "description": "可通过多张图片设定主体及其细节\n\n包括正面参考图和其他角度或特写参考图,其中:至少包括1张正面参考图,由frontal_image参数定义;需包括1~3张其他参考图,需与正面参考图有差异,由image_url参数定义\n\n用key:value承载,如下:\n\n\"element_image_list\": {\n\"frontal_image\": \"image_url_0\", \n\"refer_images\": [{ \"image_url\": \"image_url_1\" }, ...] \n}\n支持传入图片Base64编码或图片URL(确保可访问)\n\n图片格式支持.jpg / .jpeg / .png。图片文件大小不能超过10MB,图片宽高尺寸不小于300px,图片宽高比要在1:2.5 ~ 2.5:1之间\n\nreference_type参数值为 image_refer 时,当前参数必填",
      "properties": {
        "frontal_image": {
          "type": "string"
        },
        "refer_images": {
          "items": {
            "properties": {
              "image_url": {
                "type": "string"
              }
            },
            "required": [
              "image_url"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "title": "主体参考图",
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "Define subject via multiple images: at least one frontal_image plus 1–3 differing refer_images (image_url). As key:value element_image_list. Base64 or URL; .jpg/.jpeg/.png; max 10MB; min 300px; aspect 1:2.5–2.5:1. Required when reference_type=image_refer"
        }
      }
    },
    "element_name": {
      "description": "不能超过20个字符",
      "title": "主体名称",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "max 20 characters"
        }
      }
    },
    "element_video_list": {
      "description": "可通过视频设定主体及其细节\n\n可上传有声视频,有声视频包含人声则触发音色定制(定制+入音色库+与主体绑定)\n\n暂时仅支持通过视频定制写实风格的人形形象\n\n参考视频时当前参数必填,参考图片时当前参数无效\n\n用key:value承载。视频格式仅支持MP4/MOV。仅支持时长介于3s~8s之间、宽高比例需为16:9或9:16的1080P视频。至多仅支持上传1段视频,视频大小不超过200MB。video_url参数值不得为空\n\n\"element_video_list\": {\n\"refer_videos\": [{ \"video_url\": \"video_url_1\" }, ...] \n}\n视频定制的主体仅支持用于 kling-video-o3 及之后的模型",
      "properties": {
        "refer_videos": {
          "items": {
            "properties": {
              "video_url": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        }
      },
      "title": "主体参考视频",
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "Define subject via video. Video with speech triggers voice customization. Realistic humans only for now. Required for video reference; ignored for image reference. MP4/MOV; 3–8s; 16:9 or 9:16 1080P; one clip ≤200MB; video_url required. Video-customized subjects only on kling-video-o3+"
        }
      }
    },
    "element_voice_id": {
      "description": "可绑定音色库中已有音色\n\n当前参数为空时,当前主体不绑定音色\n\n可通过音色相关API获取ID,点此查看\n\n仅视频定制的主体支持绑定音色",
      "title": "主体音色",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "can bind an existing voice from the library when this parameter is empty, this subject is not bound to a voice get IDs via voice APIs only video-customized subjects support voice binding"
        }
      }
    },
    "external_task_id": {
      "description": "自定义任务ID。用户自定义任务ID,传入不会覆盖系统生成的任务ID,但支持通过该ID进行任务查询。请注意,单用户下需要保证唯一性",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Custom task ID. Does not override the system task ID, but can be used for queries. Must be unique per user"
        }
      }
    },
    "reference_type": {
      "description": "枚举值:video_refer、  image_refer\nvideo_refer: 视频角色主体,此时将参考element_video_list定义主体外表\nimage_refer: 多图主体,此时将参考element_image_list定义主体外表\n通过视频定制的主体和通过图片定制的主体的可用范围不同,详见能力地图和参数说明。",
      "title": "主体参考方式",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "enum: video_refer、 image_refer\nvideo_refer: video subject; appearance from element_video_list\nimage_refer: multi-image subject; appearance from element_image_list\nVideo- vs image-customized subjects differ in availability; see capability map / params."
        }
      }
    },
    "tag_list": {
      "description": "一个主体可以配置多个标签\n\n用key:value承载。tag的ID与名称:o_101 热梗, o_102 人物, o_103 动物, o_104 道具, o_105 服饰, o_106 场景, o_107 特效, o_108 其他",
      "items": {
        "properties": {
          "tag_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "title": "主体配置标签",
      "type": "array",
      "x-i18n": {
        "en-US": {
          "description": "A subject can have multiple tags as key:value. Tag IDs/names: o_101 meme, o_102 person, o_103 animal, o_104 prop, o_105 clothing, o_106 scene, o_107 VFX, o_108 other"
        }
      }
    }
  },
  "required": [
    "element_name",
    "element_description",
    "reference_type"
  ]
}

请求示例 · 示例 1#

"{\r\n    \"element_name\": \"主体ysh11112311213\",\r\n    \"element_description\": \"测试\",\r\n    \"reference_type\": \"image_refer\",\r\n    \"element_image_list\": {\r\n        \"frontal_image\": \"https://imageproxy.zhongzhuan.chat/api/proxy/image/bb9bd34363da4fa486c9e645a6b1349e.png\",\r\n        \"refer_images\": [\r\n            {\r\n                \"image_url\": \"https://imageproxy.zhongzhuan.chat/api/proxy/image/bb9bd34363da4fa486c9e645a6b1349e.png\"\r\n            }\r\n        ]\r\n    },\r\n    // \"element_video_list\": {\r\n    //     \"refer_videos\": [\r\n    //         {\r\n    //             \"video_url\": \"xxx\"\r\n    //         }\r\n    //     ]\r\n    // },\r\n    // \"element_voice_id\": string,\r\n    // \"tag_list\": [\r\n    //     {\r\n    //         \"tag_id\": \"xxx\"\r\n    //     }\r\n    // ],\r\n    // \"callback_url\": \"xxx\",\r\n    // \"external_task_id\": \"\"\r\n}"

请求参数

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

Body 参数application/json必填

示例
{
    "element_name": "主体ysh11112311213",
    "element_description": "测试",
    "reference_type": "image_refer",
    "element_image_list": {
        "frontal_image": "https://imageproxy.zhongzhuan.chat/api/proxy/image/bb9bd34363da4fa486c9e645a6b1349e.png",
        "refer_images": [
            {
                "image_url": "https://imageproxy.zhongzhuan.chat/api/proxy/image/bb9bd34363da4fa486c9e645a6b1349e.png"
            }
        ]
    },
    // "element_video_list": {
    //     "refer_videos": [
    //         {
    //             "video_url": "xxx"
    //         }
    //     ]
    // },
    // "element_voice_id": string,
    // "tag_list": [
    //     {
    //         "tag_id": "xxx"
    //     }
    // ],
    // "callback_url": "xxx",
    // "external_task_id": ""
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/kling/v1/general/advanced-custom-elements' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "element_name": "主体ysh11112311213",
    "element_description": "测试",
    "reference_type": "image_refer",
    "element_image_list": {
        "frontal_image": "https://imageproxy.zhongzhuan.chat/api/proxy/image/bb9bd34363da4fa486c9e645a6b1349e.png",
        "refer_images": [
            {
                "image_url": "https://imageproxy.zhongzhuan.chat/api/proxy/image/bb9bd34363da4fa486c9e645a6b1349e.png"
            }
        ]
    },
    // "element_video_list": {
    //     "refer_videos": [
    //         {
    //             "video_url": "xxx"
    //         }
    //     ]
    // },
    // "element_voice_id": string,
    // "tag_list": [
    //     {
    //         "tag_id": "xxx"
    //     }
    // ],
    // "callback_url": "xxx",
    // "external_task_id": ""
}'

返回响应

🟢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