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

# Kling v3

> 可灵 3.0 视频生成模型，支持文生视频、图生视频、首尾帧补齐、多参考图生视频



## OpenAPI

````yaml /zh/openapi/videos/kling-v3.yaml POST /v1/videos/generate
openapi: 3.1.0
info:
  title: Kling v3
  version: '1.0'
  description: 可灵 3.0 视频生成模型，支持文生视频、图生视频、首尾帧补齐、多参考图生视频。
servers:
  - url: https://openapi.imini.ai/imini/router
security:
  - ApiKeyAuth: []
paths:
  /v1/videos/generate:
    post:
      summary: Kling v3
      description: |
        提交异步的视频生成任务，后续需通过查询接口轮询结果。

        > 模型 ID：`kling/kling-v3` · 底层：可灵 3.0
      operationId: generateKlingV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
              properties:
                model:
                  type: string
                  description: 固定值 `kling/kling-v3`
                prompt:
                  type: string
                  description: >
                    提示词，不超过 **2500** 字符。


                    > 开启 `extra_params.multi_shot` 分镜模式时可为空，分镜词由
                    `extra_params.multi_prompt` 提供。
                  example: >-
                    A cinematic shot of an orange cat stretching slowly under
                    cherry blossoms, warm sunlight
                resolution:
                  type: string
                  description: 输出分辨率，默认 `720P`。
                  default: 720P
                  enum:
                    - 720P
                    - 1080P
                aspect_ratio:
                  type: string
                  description: 输出宽高比，默认 `16:9`。
                  default: '16:9'
                  enum:
                    - '16:9'
                    - '9:16'
                    - '1:1'
                duration:
                  type: integer
                  description: 视频时长（秒），默认 `5`，取值范围 `3 ~ 15`。
                  default: 5
                  minimum: 3
                  maximum: 15
                generate_audio:
                  type: boolean
                  description: 是否生成声音，默认 `false`。
                  default: false
                reference_images:
                  type: array
                  description: |
                    参考图列表，**最多 4 张**。为空时为文生视频，否则按 `reference_type` 组合决定输入模式：
                    - **图生视频**：1 张 `first_frame`
                    - **首尾帧生视频**：1 张 `first_frame` + 1 张 `last_frame`
                    - **多参考图生视频**：最多 4 张 `asset`

                    **图片约束**（每张都需满足）：
                    - 格式：`jpg` / `jpeg` / `png`
                    - 文件大小：≤ **10 MB**
                    - 尺寸：宽、高均 ≥ **200 px**
                    - 宽高比：**1:2.5 ~ 2.5:1**
                  maxItems: 4
                  items:
                    type: object
                    required:
                      - url
                    properties:
                      url:
                        type: string
                        description: >
                          图片地址，支持两种形式：

                          **1)** 公网可访问 URL（`http://` 或 `https://`）；

                          **2)** Data URI base64（`data:image/` 开头）。


                          约束：格式 `jpg` / `jpeg` / `png`；文件 ≤ 10 MB；宽高 ≥ 200
                          px；宽高比 1:2.5 ~ 2.5:1。
                      reference_type:
                        type: string
                        description: |
                          参考类型：
                          - `asset` — 通用素材参考（默认）
                          - `first_frame` — 首帧
                          - `last_frame` — 尾帧
                        default: asset
                        enum:
                          - asset
                          - first_frame
                          - last_frame
                extra_params:
                  type: object
                  description: 可灵官方扩展参数，全部选填。
                  properties:
                    multi_shot:
                      type: boolean
                      default: false
                      description: |
                        是否启用多镜头（分镜）模式。
                        - `true`：开启分镜，此时顶层 `prompt` 无效，且不支持首尾帧生视频
                        - `false`：关闭分镜，此时 `shot_type` 与 `multi_prompt` 无效
                    shot_type:
                      type: string
                      description: |
                        分镜类型，仅在 `multi_shot=true` 时生效。
                        - `intelligence` — 智能分镜，模型按 `prompt` 自动拆分镜头
                        - `customize` — 自定义分镜，由 `multi_prompt` 明确每个分镜
                      enum:
                        - intelligence
                        - customize
                    multi_prompt:
                      type: array
                      description: >
                        分镜信息列表。**当 `multi_shot=true` 且 `shot_type=customize`
                        时必填。**


                        - 至少 **1** 个、至多 **6** 个分镜

                        - 每个分镜提示词最大长度 **512** 字符

                        - 每个分镜时长 ≥ 1s 且不大于任务总时长

                        - 所有分镜时长之和必须等于任务总时长 `duration`
                      minItems: 1
                      maxItems: 6
                      items:
                        type: object
                        required:
                          - index
                          - prompt
                          - duration
                        properties:
                          index:
                            type: integer
                            description: 分镜序号，从 `1` 开始。
                          prompt:
                            type: string
                            description: 当前分镜的提示词，最大 512 字符。
                            maxLength: 512
                          duration:
                            type: string
                            description: 当前分镜时长（秒），字符串形式传入，如 `"5"`。取值 ≥ 1 且 ≤ 任务总时长。
                            example: '5'
                    negative_prompt:
                      type: string
                      maxLength: 2500
                      description: 负向提示词，长度不超过 **2500** 字符。
                    cfg_scale:
                      type: number
                      minimum: 0
                      maximum: 1
                      default: 0.5
                      description: |
                        生成视频的自由度，默认 `0.5`，取值范围 `[0, 1]`。

                        值越大，模型自由度越小，与提示词的相关性越强。
                    camera_control:
                      type: object
                      description: >
                        摄像机运镜控制配置。


                        **支持范围**：仅在 **文生视频** 与
                        **图生视频（首帧，`reference_type=first_frame`）**
                        场景下生效；**多参考图生视频（`reference_type=asset`）不支持**。
                      properties:
                        type:
                          type: string
                          enum:
                            - simple
                            - down_back
                            - forward_up
                            - right_turn_forward
                            - left_turn_forward
                          description: |
                            预定义运镜类型。
                            - `simple` — 自定义运镜，需配合 `config` 指定具体参数
                            - `down_back` — 镜头下压后退
                            - `forward_up` — 镜头前进上移
                            - `right_turn_forward` — 镜头右旋前进
                            - `left_turn_forward` — 镜头左旋前进
                        config:
                          type: object
                          description: |
                            包含六个字段，用于指定摄像机在不同方向上的运动或变化。

                            当 `type=simple` 时必填，指定其他类型时不填。

                            以下参数 **6 选 1**——只能有一个参数不为 0，其余必须为 0。
                          properties:
                            horizontal:
                              type: number
                              minimum: -10
                              maximum: 10
                              description: |
                                水平运镜，控制摄像机在水平方向上的移动量（沿 x 轴平移）。
                                取值范围 `[-10, 10]`：负值向左平移，正值向右平移。
                            vertical:
                              type: number
                              minimum: -10
                              maximum: 10
                              description: |
                                垂直运镜，控制摄像机在垂直方向上的移动量（沿 y 轴平移）。
                                取值范围 `[-10, 10]`：负值向下平移，正值向上平移。
                            pan:
                              type: number
                              minimum: -10
                              maximum: 10
                              description: |
                                水平摇镜，控制摄像机在水平面上的旋转量（绕 y 轴旋转）。
                                取值范围 `[-10, 10]`：负值向左旋转，正值向右旋转。
                            tilt:
                              type: number
                              minimum: -10
                              maximum: 10
                              description: |
                                垂直摇镜，控制摄像机在垂直面上的旋转量（沿 x 轴旋转）。
                                取值范围 `[-10, 10]`：负值向下旋转，正值向上旋转。
                            roll:
                              type: number
                              minimum: -10
                              maximum: 10
                              description: |
                                旋转运镜，控制摄像机的滚动量（绕 z 轴旋转）。
                                取值范围 `[-10, 10]`：负值逆时针旋转，正值顺时针旋转。
                            zoom:
                              type: number
                              minimum: -10
                              maximum: 10
                              description: |
                                变焦，控制摄像机的焦距变化，影响视野的远近。
                                取值范围 `[-10, 10]`：负值焦距变长、视野变小，正值焦距变短、视野变大。
                  additionalProperties: true
            examples:
              Text to Video - Multi-Shot:
                summary: Text to Video - Multi-Shot
                value:
                  model: kling/kling-v3
                  resolution: 720P
                  aspect_ratio: '9:16'
                  duration: 8
                  generate_audio: true
                  extra_params:
                    multi_shot: true
                    shot_type: customize
                    multi_prompt:
                      - index: 1
                        prompt: >-
                          Two friends talking under a streetlight at night. Warm
                          glow, casual poses, no dialogue.
                        duration: '2'
                      - index: 2
                        prompt: >-
                          A runner sprinting through a forest, leaves flying.
                          Low-angle shot, focus on movement.
                        duration: '3'
                      - index: 3
                        prompt: >-
                          A woman hugging a cat, smiling. Soft sunlight, cozy
                          home setting, emphasize warmth.
                        duration: '3'
              Image to Video - Multi-Shot:
                summary: Image to Video - Multi-Shot
                value:
                  model: kling/kling-v3
                  prompt: ''
                  reference_images:
                    - url: >-
                        https://file.iminicdn.com/public/2026/04/11/2042857867857498112/8QUzTr7a.png
                  resolution: 720P
                  aspect_ratio: '16:9'
                  duration: 10
                  generate_audio: true
                  extra_params:
                    multi_shot: true
                    shot_type: customize
                    multi_prompt:
                      - index: 1
                        prompt: >-
                          [Close-up] The motorcycle engine vibrates intensely;
                          thick white exhaust plumes into the freezing air.
                        duration: '1'
                      - index: 2
                        prompt: >-
                          [Low Angle] Camera near the snow surface; the rear
                          wheel kicks up a massive spray of ice and snow while
                          speeding past.
                        duration: '2'
                      - index: 3
                        prompt: >-
                          [Wide Shot] Aerial view. The motorcycle rides
                          solitarily across the vast white ice field with grand
                          snowy mountains in the background.
                        duration: '2'
                      - index: 4
                        prompt: >-
                          [Medium Shot] Profile of the rider in a weathered
                          leather jacket, the goggles reflecting the cold winter
                          light.
                        duration: '1'
                      - index: 5
                        prompt: >-
                          [Medium Shot] Dynamic tracking shot moving parallel to
                          the bike, capturing the balance of riding on snow.
                        duration: '2'
                      - index: 6
                        prompt: >-
                          [Long Shot] Zoom out slowly as the rider disappears
                          into the grey horizon, with the forest shrouded in
                          snow mist.
                        duration: '2'
              First & Last Frame:
                summary: First & Last Frame
                value:
                  model: kling/kling-v3
                  prompt: ''
                  reference_images:
                    - url: >-
                        https://file.iminicdn.com/public/2026/04/11/2042869610478440448/Xq4AGRrI.jpg
                      reference_type: first_frame
                    - url: >-
                        https://file.iminicdn.com/public/2026/04/11/2042869610478440448/f2nTCl56.jpg
                      reference_type: last_frame
                  resolution: 720P
                  aspect_ratio: '9:16'
                  duration: 5
              Multi Reference Images:
                summary: Multi Reference Images
                value:
                  model: kling/kling-v3
                  prompt: >-
                    In the park, a little boy and a puppy are having a picnic
                    and playing on the grass by the lake.
                  reference_images:
                    - url: >-
                        https://file.iminicdn.com/public/2026/04/11/2042877824624365568/O5hm7DKe.png
                      reference_type: asset
                    - url: >-
                        https://file.iminicdn.com/public/2026/04/11/2042877824624365568/iW_m9uHk.png
                      reference_type: asset
                    - url: >-
                        https://file.iminicdn.com/public/2026/04/11/2042877824624365568/yHYHwPnG.png
                      reference_type: asset
                  resolution: 720P
                  aspect_ratio: '16:9'
                  duration: 5
      responses:
        '200':
          description: 提交成功（异步模式）
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    type: string
                    description: 任务唯一 ID，用于后续轮询查询
                    example: task_2042864638838083584
                  model:
                    type: string
                    description: 本次任务使用的模型 ID
                    example: kling/kling-v3
                  created_at:
                    type: string
                    description: 任务创建时间（ISO 8601）
                    example: '2026-04-11T07:17:39.146Z'
                  request_id:
                    type: string
                    description: 请求唯一 ID
                    example: 291a4117-9df8-4349-aee1-bdf8ffcacb9a
        '400':
          description: Validation Error (e.g. invalid parameter, invalid prompt)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Error code
                        example: INVALID_PARAMETER
                      message:
                        type: string
                        description: Error message details
                        example: prompt exceeds max length 2500
                      status:
                        type: integer
                        description: HTTP status code
                        example: 400
                      request_id:
                        type: string
                        description: Unique request identifier
                        example: req_abc123
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >
        在请求 Header 中传入 `Authorization: Bearer <YOUR_API_KEY>`。前往 [API Keys
        管理页](https://imini.ai/zh/api-keys) 创建和管理 API Key。

````