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

# kling-2.6-文生视频

> 使用 kling-v2-6 模型从文本提示词生成视频。



## OpenAPI

````yaml zh/api-reference/model-api/kuaishou/openapi/kling-v2-6-t2v/openapi.yaml POST /kling/v1/videos/text2video
openapi: 3.1.0
info:
  title: Kling 2.6 文生视频
  description: 通过 Anyfast API 调用快手 Kling 2.6 文生视频 模型
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/text2video:
    post:
      summary: 创建文生视频任务
      description: 使用 kling-v2-6 模型从文本提示词生成视频。
      operationId: createKlingV26T2v
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                model_name:
                  type: string
                  enum:
                    - kling-v2-6
                  description: 模型名称
                  example: kling-v2-6
                prompt:
                  type: string
                  maxLength: 2500
                  description: 正向文本提示词，最长 2500 字符。
                  example: 一只猫在金色夕阳下穿过向日葵花田
                negative_prompt:
                  type: string
                  maxLength: 2500
                  description: 负向文本提示词，最长 2500 字符。
                mode:
                  type: string
                  enum:
                    - std
                    - pro
                  default: std
                  description: std：标准模式（性价比高）。pro：专业模式（更高画质）。
                duration:
                  type: string
                  enum:
                    - '3'
                    - '4'
                    - '5'
                    - '6'
                    - '7'
                    - '8'
                    - '9'
                    - '10'
                    - '11'
                    - '12'
                    - '13'
                    - '14'
                    - '15'
                  default: '5'
                  description: 视频时长（秒），3-15 秒。
                  example: '5'
                aspect_ratio:
                  type: string
                  enum:
                    - '16:9'
                    - '9:16'
                    - '1:1'
                  default: '16:9'
                  description: 生成视频的画面比例（宽:高）。
                  example: '16:9'
                cfg_scale:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 0.5
                  description: 提示词相关性（0-1），值越大模型自由度越小。kling-v2.x 模型不支持此参数。
                multi_shot:
                  type: boolean
                  default: false
                  description: 是否生成多镜头视频。为 true 时 prompt 无效，需使用 multi_prompt。
                shot_type:
                  type: string
                  enum:
                    - customize
                    - intelligence
                  description: 分镜方式。multi_shot 为 true 时必填。
                multi_prompt:
                  type: array
                  description: 分镜信息（1-6 个）。multi_shot 为 true 且 shot_type 为 customize 时必填。
                  items:
                    type: object
                    properties:
                      index:
                        type: integer
                      prompt:
                        type: string
                        maxLength: 512
                      duration:
                        type: string
                sound:
                  type: string
                  enum:
                    - 'on'
                    - 'off'
                  default: 'off'
                  description: 是否同步生成音效。仅 V2.6 及以上版本支持。
                camera_control:
                  type: object
                  description: 运镜控制参数。
                  properties:
                    type:
                      type: string
                      enum:
                        - simple
                        - down_back
                        - forward_up
                        - right_turn_forward
                        - left_turn_forward
                    config:
                      type: object
                      properties:
                        horizontal:
                          type: number
                        vertical:
                          type: number
                        pan:
                          type: number
                        tilt:
                          type: number
                        roll:
                          type: number
                        zoom:
                          type: number
                watermark_info:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                      description: 是否同时生成水印结果
                callback_url:
                  type: string
                  description: 任务状态回调通知 URL
                external_task_id:
                  type: string
                  description: 自定义任务 ID，同一账号下须唯一。
      responses:
        '200':
          description: 任务已创建
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: '860260753860210752'
                  task_id:
                    type: string
                    example: '860260753860210752'
                  object:
                    type: string
                    example: video
                  model:
                    type: string
                    example: kling-v2-6
                  status:
                    type: string
                  progress:
                    type: integer
                    example: 0
                  created_at:
                    type: integer
                    example: 1773130665
        '401':
          description: 未授权
        '429':
          description: 请求频率超限
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````