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

# Kling 2.6 文生视频

> 使用 Kling 2.6 模型生成视频（异步）

使用[快手](https://klingai.com)的 Kling 2.6 模型从文本生成视频。

**模型特点：**

* **超长视频** - 支持生成 5 秒或 10 秒高质量视频
* **多种画幅** - 支持 1:1、16:9、9:16 等主流画幅比例
* **音频生成** - 可选生成配套音效，增强视频表现力
* **高清画质** - 输出流畅自然的高清视频内容


## OpenAPI

````yaml /cn/openapi.yaml POST /generate/k/kling26-text-to-video
openapi: 3.0.0
info:
  contact:
    email: support@sinancode.com
    name: API Support
    url: https://sinancode.com/support
  description: AI 模型任务调度平台 API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://sinancode.com/terms-of-service
  title: TikTomato API
  version: '1.0'
servers:
  - url: https://api.sinancode.com/v1
    description: Production server
security: []
paths:
  /generate/k/kling26-text-to-video:
    post:
      tags:
        - public
      summary: Kling 2.6 文生视频
      description: 使用 Kling 2.6 模型生成视频（异步）
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ka.CreateKling26TextToVideoTaskRequest'
        description: Task parameters
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.CreateTaskResponse'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    ka.CreateKling26TextToVideoTaskRequest:
      properties:
        aspect_ratio:
          default: '1:1'
          description: 宽高比（可选，默认 1:1）
          enum:
            - '1:1'
            - '16:9'
            - '9:16'
          example: '16:9'
          type: string
        duration:
          default: 5
          description: 视频时长（可选，5或10秒，默认5）
          enum:
            - 5
            - 10
          example: 5
          type: integer
        prompt:
          description: 提示词（必填，最大1000字符）
          example: A cat walking in the garden
          maxLength: 1000
          minLength: 1
          type: string
        sound:
          default: false
          description: 是否包含声音（可选，默认 false）
          example: false
          type: boolean
      required:
        - prompt
      type: object
    dto.CreateTaskResponse:
      properties:
        task_id:
          description: Task ID
          example: 01234567-89ab-cdef-0123-456789abcdef
          type: string
      required:
        - task_id
      type: object
    apierror.ErrorResponse:
      properties:
        error_code:
          description: Machine-readable error code (e.g. TASK.INVALID_PARAMS)
          type: string
        message:
          description: User-friendly error message
          type: string
      type: object
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 请使用您的 API Token 进行认证

````