> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kapon.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# 文生视频（Legacy）

> 接口与可灵官网一致；详细字段以官方文档为准

* 路径 `POST /kling/v1/videos/text2video`
* 本页对应官方 Legacy 协议；新版请求请使用 [API 2.0](/kling/api2-kling3)。
* 字段详解：请参考[官网权威文档](https://kling.ai/document-api/api/video/3-0-omni/text-to-video/legacy)

请求参数

`multi_shot=true` 且 `shot_type=customize` 时使用 `multi_prompt`，无需顶层 `prompt`；普通单镜头和智能分镜仍需 `prompt`。

| 参数                 | 类型      | 必填   | 说明                                                                                                                             |
| ------------------ | ------- | ---- | ------------------------------------------------------------------------------------------------------------------------------ |
| `model_name`       | string  | 否    | 模型名称，默认 `kling-v1`。可选：`kling-v1`、`kling-v1-6`、`kling-v2-master`、`kling-v2-1-master`、`kling-v2-5-turbo`、`kling-v2-6`、`kling-v3` |
| `prompt`           | string  | 条件必填 | 正向文本提示词                                                                                                                        |
| `multi_shot`       | boolean | 否    | 是否多镜头，默认false，3.0支持                                                                                                            |
| `shot_type`        | string  | 条件必填 | 多镜头时为 `customize` 或 `intelligence`                                                                                             |
| `multi_prompt`     | array   | 条件必填 | 自定义分镜 `{index,prompt,duration}`；序号从1递增，各段时长之和等于总时长，最多6段                                                                        |
| `negative_prompt`  | string  | 否    | 负向文本提示词                                                                                                                        |
| `cfg_scale`        | number  | 否    | 生成自由度 \[0, 1]，仅 `kling-v1`/`kling-v1-5`/`kling-v1-6` 支持                                                                        |
| `sound`            | string  | 否    | 是否生成声音：`on`/`off`（仅 `kling-v2-6` 支持）                                                                                           |
| `mode`             | string  | 否    | 生成模式：`std`（标准）、`pro`（专业），默认 `std`                                                                                              |
| `camera_control`   | object  | 否    | 摄像机运动控制，详见下方说明                                                                                                                 |
| `aspect_ratio`     | string  | 否    | 画面纵横比：`16:9`、`9:16`、`1:1`，默认 `16:9`                                                                                            |
| `duration`         | string  | 否    | 视频时长：`5`（5秒）、`10`（10秒），默认 `5`                                                                                                  |
| `watermark_info`   | object  | 否    | 是否生成含水印结果                                                                                                                      |
| `callback_url`     | string  | 否    | 回调通知地址                                                                                                                         |
| `external_task_id` | string  | 否    | 自定义任务ID（幂等控制）                                                                                                                  |

摄像机控制

```json theme={null}
{
  "camera_control": {
    "type": "simple",  // simple, down_back, forward_up, right_turn_forward, left_turn_forward
    "config": {        // type=simple 时必填
      "horizontal": 5  // 水平运镜 [-10, 10]
      // 其他可选：vertical, pan, tilt, roll, zoom（只能有一个非零）
    }
  }
}
```

补充约束

* `prompt` 不能超过 2500 字符。
* `cfg_scale` 仅 `kling-v1`/`kling-v1-5`/`kling-v1-6` 支持，`kling-v2` 系列不支持。
* `camera_control.type=simple` 时，`config` 只能有一个字段为非零值，其余必须为 0。
* 历史输入 `kling-v2-5` 会归一为 `kling-v2-5-turbo`；对外展示和渠道自动填充使用 canonical 模型名。
* `kling-v3-omni` 请使用 Omni 视频入口 `/kling/v1/videos/omni-video`。
* `Kling 3.0 Turbo` 暂未确认官方可调用 schema，当前不放行。

### 场景一：简单文生视频

```bash theme={null}
curl --request POST \
  --url https://models.kapon.cloud/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v1",
    "prompt": "A man picks up a book, then reads with focused expression.",
    "mode": "std",
    "duration": "5",
    "aspect_ratio": "16:9"
  }'
```

示例响应（创建任务）

```json theme={null}
{
  "code": 0,
  "message": "success",
  "request_id": "req_1735558800_abc123",
  "data": {
    "task_id": "task_01JGHK...",
    "task_status": "submitted",
    "created_at": 1735558800000,
    "updated_at": 1735558800000
  }
}
```

### 场景二：带摄像机运镜

```bash theme={null}
curl --request POST \
  --url https://models.kapon.cloud/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v2-master",
    "prompt": "Sunset over mountains, golden light spreading across valleys",
    "mode": "pro",
    "duration": "10",
    "aspect_ratio": "16:9",
    "camera_control": {
      "type": "forward_up"
    }
  }'
```

### 场景三：V2.6 声音控制

```bash theme={null}
curl --request POST \
  --url https://models.kapon.cloud/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-v2-6",
    "prompt": "A calm ocean scene with gentle waves",
    "mode": "std",
    "duration": "5",
    "aspect_ratio": "16:9",
    "sound": "on"
  }'
```

任务状态说明

| 状态           | 含义  |
| ------------ | --- |
| `submitted`  | 已提交 |
| `processing` | 处理中 |
| `succeed`    | 成功  |
| `failed`     | 失败  |


## OpenAPI

````yaml POST /kling/v1/videos/text2video
openapi: 3.0.3
info:
  title: Kling API
  version: '2026-09-07'
  description: API 2.0 与 Legacy 分开定义；请求使用 Kapon Token。
servers:
  - url: https://models.kapon.cloud
security:
  - BearerAuth: []
paths:
  /kling/v1/videos/text2video:
    post:
      tags:
        - Kling
      summary: Text to video
      description: >-
        创建响应中 task_id 为上游原始任务 ID，platform_id 为平台追踪 ID。成功任务按上游
        final_unit_deduction 积分结算到 kling-video-points。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/kling.OfficialText2VideoRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/kling.OfficialResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    kling.OfficialText2VideoRequest:
      type: object
      properties:
        aspect_ratio:
          description: 画面纵横比：16:9, 9:16, 1:1
          type: string
        callback_url:
          description: 回调通知地址
          type: string
        camera_control:
          description: 摄像机运动控制
          allOf:
            - $ref: '#/components/schemas/kling.CameraControl'
        cfg_scale:
          description: 生成视频的自由度 [0, 1]
          type: number
        duration:
          description: 视频时长：5, 10
          type: string
        external_task_id:
          description: 自定义任务ID
          type: string
        mode:
          description: 生成模式：std, pro
          type: string
        model_name:
          description: 模型名称，默认kling-v1
          type: string
        multi_prompt:
          type: array
          items:
            $ref: '#/components/schemas/kling.OfficialVideoShot'
        multi_shot:
          type: boolean
        negative_prompt:
          description: 负向文本提示词
          type: string
        prompt:
          description: 正向文本提示词，必须
          type: string
        shot_type:
          type: string
        sound:
          description: 是否生成声音：on/off
          type: string
        watermark_info:
          description: 水印信息
          allOf:
            - $ref: '#/components/schemas/kling.OfficialWatermarkInfo'
    kling.OfficialResponse:
      type: object
      properties:
        code:
          description: 错误码
          type: integer
        data:
          description: 单个任务数据
          allOf:
            - $ref: '#/components/schemas/kling.OfficialTaskData'
        data_list:
          description: 任务列表数据（用于列表查询）
          type: array
          items:
            $ref: '#/components/schemas/kling.OfficialTaskData'
        message:
          description: 错误信息
          type: string
        request_id:
          description: 请求ID
          type: string
    kling.CameraControl:
      type: object
      properties:
        config:
          description: 当type为"simple"时必填
          allOf:
            - $ref: '#/components/schemas/kling.CameraControlConfig'
        type:
          description: >-
            "simple", "down_back", "forward_up", "right_turn_forward",
            "left_turn_forward"
          type: string
    kling.OfficialVideoShot:
      type: object
      properties:
        duration:
          type: string
        index:
          type: integer
        prompt:
          type: string
    kling.OfficialWatermarkInfo:
      type: object
      properties:
        enabled:
          description: 是否生成含水印结果
          type: boolean
    kling.OfficialTaskData:
      type: object
      properties:
        created_at:
          description: 任务创建时间，Unix时间戳、单位ms
          type: integer
        final_balance_deduction:
          type: object
        final_unit_deduction:
          description: 实际扣减积分
          type: string
        platform_id:
          description: One-Hub 平台统一追踪 ID（video_<ULID>）
          type: string
        task_id:
          description: 任务ID — 上游原始任务 ID
          type: string
        task_info:
          description: 任务创建时的参数信息
          allOf:
            - $ref: '#/components/schemas/kling.OfficialTaskInfo'
        task_result:
          description: 任务结果
          allOf:
            - $ref: '#/components/schemas/kling.OfficialTaskResult'
        task_status:
          description: 任务状态
          type: string
        task_status_msg:
          description: 任务状态信息
          type: string
        updated_at:
          description: 任务更新时间，Unix时间戳、单位ms
          type: integer
        watermark_info:
          description: 水印信息
          allOf:
            - $ref: '#/components/schemas/kling.OfficialWatermarkInfo'
    kling.CameraControlConfig:
      type: object
      properties:
        horizontal:
          description: 水平运镜 [-10, 10]
          type: number
        pan:
          description: 水平摇镜 [-10, 10]
          type: number
        roll:
          description: 旋转运镜 [-10, 10]
          type: number
        tilt:
          description: 垂直摇镜 [-10, 10]
          type: number
        vertical:
          description: 垂直运镜 [-10, 10]
          type: number
        zoom:
          description: 变焦 [-10, 10]
          type: number
    kling.OfficialTaskInfo:
      type: object
      properties:
        external_task_id:
          description: 客户自定义任务ID
          type: string
    kling.OfficialTaskResult:
      type: object
      properties:
        videos:
          type: array
          items:
            $ref: '#/components/schemas/kling.OfficialVideoResult'
    kling.OfficialVideoResult:
      type: object
      properties:
        duration:
          description: 视频总时长，单位s
          type: string
        id:
          description: 生成的视频ID
          type: string
        url:
          description: 生成视频的URL
          type: string
        watermark_url:
          description: 含水印视频下载URL
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````