文生视频
Last updated: Nov 4, 2026
POST
根据文本生成视频,支持单镜头 / 多镜头和指定音色(<<<voice_1>>>,最多 2 个,需 sound 为 on)。
请求头带 X-Response-Format: orion 时按原厂报文返回,任务通过原生查询接口查询;否则返回统一结构。
使用 TE 北京地域 API Key 鉴权。模型能力、调用约定见 Kling 接口概览。
BearerAuthheader
AuthorizationBearer <token>TE 北京地域 API Key,填写后自动添加 Bearer 前缀。
X-Response-Format?string传 orion 时按原厂报文返回
application/json- body
model_name?stringkling-v3
prompt?string≤ 2500 字符;multi_shot 为 false 或 shot_type 为 intelligence 时必填
multi_shot?boolean是否多镜头,默认 false;true 时 prompt 无效
shot_type?string分镜方式,multi_shot 为 true 时必填
multi_prompt?array<>分镜 [{index, prompt, duration}],1~6 个,单个 ≤ 512 字符,时长之和等于总时长
negative_prompt?string≤ 2500 字符
sound?stringon / off(默认);仅 V2.6 及后续模型
cfg_scale?number[0,1],默认 0.5;kling-v2.x 不支持
mode?stringstd(标准)、pro(高品质)、4k(同 pro,输出 4K),默认 std
aspect_ratio?string16:9(默认)、9:16、1:1
duration?string3~15,默认 5;范围见能力地图
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/videos/text2video' \ -H 'X-Response-Format: orion' \ -H 'Content-Type: application/json' \ -d '{ "model_name": "kling-v3", "multi_shot": true, "shot_type": "customize", "multi_prompt": [ { "index": 1, "prompt": "一只猫缓缓出现在镜头中", "duration": "2" }, { "index": 2, "prompt": "猫稳稳往前走", "duration": "3" } ], "duration": "5", "mode": "std", "sound": "on", "watermark_info": { "enabled": true }, "aspect_ratio": "9:16"}'Example Response200
{ "taskId": "tsk-xxxxxxxxxxxxxxxx", "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}
