Omni 生图
更新时间:2026-11-04
POST
全能生图,支持参考图、主体、单图 / 组图。
使用 TE 北京地域 API Key 鉴权。模型能力、调用约定见 Kling 接口概览。
BearerAuthheader
AuthorizationBearer <token>TE 北京地域 API Key,填写后自动添加 Bearer 前缀。
application/json- body
model_name?stringkling-image-o1(默认)、kling-v3-omni
prompt*string≤ 2500 字符
image_list?array<>参考图 [{image}],URL 或 Base64(不带 data: 前缀);jpg/jpeg/png,≤ 10MB,宽高 ≥ 300px,宽高比 1:2.5~2.5:1;图片 + 主体 ≤ 10
element_list?array<>主体 [{element_id}];图片 + 主体 ≤ 10
resolution?string1k(默认)、2k、4k
result_type?stringsingle(默认)、series 组图
n?integer[1,9],默认 1;series 时无效
series_amount?integer组图数量 [2,9],默认 4;single 时无效
aspect_ratio?string16:9、9:16、1:1、4:3、3:4、3:2、2:3、21:9、auto(默认)
watermark_info?{"enabled": true} 同时生成含水印结果;不支持自定义水印
成功;具体状态及结果见响应字段。
application/json- response
taskId?string任务 ID
requestId?string请求 ID,用于排查
code?string错误码,异常时返回
message?string错误信息,异常时返回
curl -X POST 'https://vod.bj.baidubce.com/v3/aigc/kl/images/omni-image' \ -H 'Content-Type: application/json' \ -d '{ "model_name": "kling-v3-omni", "prompt": "生成卡通风格的泰迪狗", "resolution": "4k", "result_type": "single", "n": 2, "aspect_ratio": "1:1", "watermark_info": { "enabled": true }}'响应示例200
{ "taskId": "tsk-xxxxxxxxxxxxxxxx", "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}
