Documentation

文生视频(新版)

Last updated: Nov 4, 2026

POST
/v3/aigc/kl/text-to-video/{model_name}

原厂新版接口,model_name 取值:kling-3.0、kling-2.6、kling-2.5-turbo。请求体对齐原厂。

任务状态:submitted(已提交)、processing(处理中)、succeeded(成功)、failed(失败);时间为 Unix 毫秒。

使用 TE 北京地域 API Key 鉴权。模型能力、调用约定见 Kling 接口概览。

Authorization

BearerAuth
headerAuthorizationBearer <token>

TE 北京地域 API Key,填写后自动添加 Bearer 前缀。

Path Parameters

model_name*string

kling-3.0、kling-2.6、kling-2.5-turbo

Request Body

application/json
  1. body
contents?array<>

输入内容 [{type, text \| url}],type 如 prompt、first_frame、image、video

prompt?string

文生视频直接传提示词

settings*

生成设置:resolution、aspect_ratio、duration、audio、multi_shot、character_orientation 等

options?

callback_url、external_task_id、watermark_info

Response Body

成功;具体状态及结果见响应字段。

application/json
  1. response
code?integer
message?string
data?
request_id?string
Example Request
curl -X POST 'https://vod.bj.baidubce.com/v3/aigc/kl/text-to-video/kling-3.0' \  -H 'Content-Type: application/json' \  -d '{  "prompt": "A girl sat on the train, looking out the window with a melancholic expression, her head swaying with the train.",  "settings": {    "resolution": "4k",    "aspect_ratio": "16:9",    "duration": 15,    "audio": "off",    "multi_shot": true  },  "options": {    "callback_url": "https://example.com/callback",    "external_task_id": "",    "watermark_info": {      "enabled": false    }  }}'
Example Response200
{  "code": 0,  "message": "SUCCEED",  "data": {    "id": "tsk-xxxxxxxxxxxxxxxx",    "status": "submitted",    "create_time": 1788401717479,    "update_time": 1788401717479,    "external_id": ""  },  "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}