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

# Kling 文生视频 kling-v3

> 通过 `/kling/v1/videos/text2video` 提交 Kling 文生视频任务。请求体经模型映射和公共任务 ID 注入后转发至 Kling 官方接口。



## OpenAPI

````yaml api-reference/zh-Hans/zmodelVideo/kling/kling-v3-text2video.json POST /kling/v1/videos/text2video
openapi: 3.0.1
info:
  title: Kling 文生视频任务 - 提交任务 (kling-v3)
  version: 1.0.0
  description: 通过 `/kling/v1/videos/text2video` 提交 Kling 文生视频任务。使用模型 kling-v3。
servers:
  - url: https://api.powertokens.ai
    description: ''
security: []
tags:
  - name: Kling
    description: Kling 原生异步任务端点
paths:
  /kling/v1/videos/text2video:
    post:
      tags:
        - Kling
      summary: Kling 文生视频任务 (kling-v3)
      description: >-
        通过 `/kling/v1/videos/text2video` 提交 Kling 文生视频任务。请求体经模型映射和公共任务 ID 注入后转发至
        Kling 官方接口。
      operationId: createKlingV3Text2Video
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
            default: application/json
          description: 数据交换格式
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingRequest'
            examples:
              request:
                summary: 请求示例
                value:
                  model_name: kling-v3
                  prompt: 一只可爱的小兔子，戴着眼镜，坐在桌边，看报纸，桌上放着一杯卡布奇诺
                  negative_prompt: ''
                  duration: '5'
                  mode: pro
                  sound: 'on'
                  aspect_ratio: '1:1'
                  callback_url: ''
                  external_task_id: ''
      responses:
        '200':
          description: 任务已受理。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
              examples:
                response:
                  summary: 响应示例
                  value:
                    code: 0
                    message: string
                    request_id: string
                    data:
                      task_id: string
                      task_info:
                        external_task_id: string
                      task_status: submitted
                      created_at: 1722769557708
                      updated_at: 1722769557708
      security:
        - bearerAuth: []
components:
  schemas:
    KlingRequest:
      type: object
      required:
        - model_name
        - prompt
      properties:
        model_name:
          type: string
          description: 模型名称
          enum:
            - kling-v3
        multi_shot:
          type: boolean
          default: false
          description: |-
            是否生成多镜头视频。
            当前参数为 true 时，prompt 参数无效，且不支持设定首尾帧生视频。
            当前参数为 false 时，shot_type 参数及 multi_prompt 参数无效
        shot_type:
          type: string
          enum:
            - customize
            - intelligence
          description: |-
            分镜方式
            当 multi_shot 参数为 true 时，当前参数必填
          x-valid-when:
            multi_shot:
              - true
        prompt:
          type: string
          description: >-
            正向文本提示词


            ```markdown

            Omni模型可通过Prompt与主体、图片、视频等内容实现多种能力：

            -
            通过<<<>>>的格式来指定某个主体、图片或视频，如：<<<element_1>>>、<<<image_1>>>、<<<video_1>>>

            ```


            - 不能超过 2500 个字符

            - 用 <<<voice_1>>> 来指定音色，序号同 voice_list；至多引用 2 个音色；指定音色时 sound 必须为
            on；语法结构越简单越好，如：男人<<<voice_1>>>说："你好"；

            -voice_list 不为空且 prompt 引用音色 ID 时按「有指定音色」计费

            - 当 multi_shot 为 false 或 shot_type 为 intelligence 时不得为空。
          maxLength: 2500
        multi_prompt:
          type: array
          items:
            type: object
            required:
              - index
              - prompt
              - duration
            properties:
              index:
                type: integer
                description: 分镜序号。
              prompt:
                type: string
                description: 当前分镜提示词。
                maxLength: 512
              duration:
                type: string
                description: 当前分镜时长，单位秒。
          description: >-
            各分镜信息，如提示词、时长等。

            通过 index、prompt、duration 参数定义分镜序号及相应提示词和时长。

            - 最多支持 6 个分镜，最小支持 1 个分镜。

            - 每个分镜相关内容的最大长度不超过 512。

            - 每个分镜的时长不大于当前任务的总时长，不小于 1。

            - 所有分镜的时长之和等于当前任务的总时长。


            用key:value承载，格式如下：


            ```json

            "multi_prompt":[{ "index": int, "prompt": "string", "duration": "5"
            },{ "index": int, "prompt": "string","duration": "5" }]

            ```


            当 multi_shot 为 true 且 shot_type 为 customize 时必填
          minItems: 1
          maxItems: 6
          x-valid-when:
            multi_shot:
              - true
        negative_prompt:
          type: string
          description: |-
            负向文本提示词
            - 不能超过 2500 个字符
            - 建议通过正向提示词中的负向句子补充负向提示信息
          maxLength: 2500
        sound:
          type: string
          enum:
            - 'on'
            - 'off'
          default: 'off'
          description: 生成视频时是否同时生成声音
        cfg_scale:
          type: number
          minimum: 0
          maximum: 1
          default: 0.5
          description: 生成视频的自由度；值越大，模型的自由度越小
        mode:
          type: string
          enum:
            - std
            - pro
            - 4k
          default: std
          x-options:
            - label: 720P
              value: std
            - label: 1080P
              value: pro
            - label: 4K
              value: 4k
          description: |-
            生成视频的模式

            - std：标准模式（标准），基础模式，性价比高，输出视频分辨率为720P。
            - pro：专家模式（高品质），高表现模式，生成视频质量更佳，输出视频分辨率为1080P。
            - 4k：4K模式，高表现（同pro），生成视频质量更佳，输出视频分辨率为4K。
        aspect_ratio:
          type: string
          description: 生成视频帧的宽高比（宽:高）
          enum:
            - '1:1'
            - '16:9'
            - '9:16'
          default: '16:9'
        duration:
          type: string
          description: 视频时长，单位秒。
          enum:
            - '3'
            - '4'
            - '5'
            - '6'
            - '7'
            - '8'
            - '9'
            - '10'
            - '11'
            - '12'
            - '13'
            - '14'
            - '15'
          default: '5'
        watermark_info:
          type: object
          description: |-
            是否同时生成含水印的结果。
            - 通过enabled参数定义，具体格式如下：

            ```json
             "watermark_info": { "enabled": boolean }
            ```
            - true 为生成，false 为不生成
            - 暂不支持自定义水印
          properties:
            enabled:
              type: boolean
              description: true 表示生成含水印结果，false 表示不生成。
        callback_url:
          type: string
          description: 本次任务结果回调通知地址，如果配置，服务端会在任务状态发生变更时主动通知
        external_task_id:
          type: string
          description: |-
            自定义任务ID。
            - 传入不会覆盖系统生成的任务ID，但支持通过该ID进行任务查询。
            - 请注意，单用户下需要保证唯一性。
    SubmitResponse:
      type: object
      properties:
        code:
          type: integer
          description: 错误码；具体定义见错误码。
        message:
          type: string
          description: 错误信息。
        request_id:
          type: string
          description: 请求ID，系统生成，用于跟踪请求、排查问题。
        data:
          type: object
          properties:
            task_id:
              type: string
              description: 任务ID，系统生成。
            task_info:
              type: object
              description: 任务创建时的参数信息。
              properties:
                external_task_id:
                  type: string
                  description: 客户自定义任务ID。
            task_status:
              type: string
              description: 任务状态。
              enum:
                - submitted
                - processing
                - succeed
                - failed
              example: submitted
            created_at:
              type: integer
              format: int64
              description: 任务创建时间，Unix时间戳、单位ms。
            updated_at:
              type: integer
              format: int64
              description: 任务更新时间，Unix时间戳、单位ms。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: '在请求头中传入 `Authorization: Bearer <token>`。'

````