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

# Kling 文生影片

> 此系列支援OpenAI影片生成格式（詳見連結 [影片生成Sora相容格式](/api-reference/zh-tw/%E5%BD%B1%E7%89%87%E7%94%9F%E6%88%90sora%E7%9B%B8%E5%AE%B9%E6%A0%BC%E5%BC%8F/%E5%BB%BA%E7%AB%8B%E5%BD%B1%E7%89%87)）。

使用 Kling 模型從文字描述生成影片。

支援的模型：kling-v1, kling-v1-5 等



## OpenAPI

````yaml api-reference/zh-tw/openapi.json POST /kling/v1/videos/text2video
openapi: 3.0.0
info:
  title: 出海營 API 參考文件
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
security:
  - BearerAuth: []
tags:
  - name: OpenAI格式（Chat）
  - name: OpenAI格式（Responses）
  - name: 圖片生成 Gemini 格式
  - name: 圖片生成OpenAI DALL-E 格式
  - name: 獲取模型列表
  - name: 影片生成HappyHorse與 Wan
  - name: 影片生成Kling格式
  - name: 影片生成 Omni 與 Veo 格式
  - name: 影片生成 Seedance 格式
  - name: 影片生成Sora相容格式
  - name: 影片生成 Vidu 格式
  - name: 音樂生成任務格式
paths:
  /kling/v1/videos/text2video:
    post:
      tags:
        - 影片生成Kling格式
      summary: Kling 文生影片
      description: >-
        此系列支援OpenAI影片生成格式（詳見連結
        [影片生成Sora相容格式](/api-reference/zh-tw/%E5%BD%B1%E7%89%87%E7%94%9F%E6%88%90sora%E7%9B%B8%E5%AE%B9%E6%A0%BC%E5%BC%8F/%E5%BB%BA%E7%AB%8B%E5%BD%B1%E7%89%87)）。


        使用 Kling 模型從文字描述生成影片。


        支援的模型：kling-v1, kling-v1-5 等
      operationId: createKlingText2Video
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoRequest'
            example:
              model: kling-v1
              prompt: 宇航员站起身走了
              duration: 5
              width: 1280
              height: 720
              fps: 30
      responses:
        '200':
          description: 成功建立影片生成任務
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoResponse'
          headers: {}
        '400':
          description: 請求參數錯誤
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    VideoRequest:
      type: object
      description: 影片生成請求
      properties:
        model:
          type: string
          description: 模型/風格 ID
          example: kling-v1
        prompt:
          type: string
          description: 文字描述提示詞
          example: 宇航员站起身走了
        image:
          type: string
          description: 圖片輸入 (URL 或 Base64)
          example: https://example.com/image.jpg
        duration:
          type: number
          description: 影片時長（秒）
          example: 5
        width:
          type: integer
          description: 影片寬度
          example: 1280
        height:
          type: integer
          description: 影片高度
          example: 720
        fps:
          type: integer
          description: 影片畫面播放速率
          example: 30
        seed:
          type: integer
          description: 隨機種子
          example: 20231234
        'n':
          type: integer
          description: 生成影片數量
          example: 1
        response_format:
          type: string
          description: 回應格式
          example: url
        user:
          type: string
          description: 使用者標識
          example: user-1234
        metadata:
          type: object
          description: 擴充參數 (如 negative_prompt, style, quality_level 等)
          additionalProperties: true
          properties: {}
    VideoResponse:
      type: object
      description: 影片生成任務提交回應
      properties:
        task_id:
          type: string
          description: 任務 ID
          example: abcd1234efgh
        status:
          type: string
          description: 任務狀態
          example: queued
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: 錯誤訊息
            type:
              type: string
              description: 錯誤類型
            param:
              type: string
              description: 相關參數
              nullable: true
            code:
              type: string
              description: 錯誤代碼
              nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        使用 Bearer Token 認證。
        格式: `Authorization: Bearer sk-xxxxxx`

````