> ## 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 文生影片任務的狀態和結果。



## OpenAPI

````yaml api-reference/zh-tw/openapi.json GET /kling/v1/videos/text2video/{task_id}
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/{task_id}:
    get:
      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 文生影片任務的狀態和結果。
      operationId: getKlingText2Video
      parameters:
        - name: task_id
          in: path
          description: 任務 ID
          required: true
          example: task-abc123
          schema:
            type: string
      responses:
        '200':
          description: 成功獲取任務狀態
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
          headers: {}
        '404':
          description: 任務不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    VideoTaskResponse:
      type: object
      description: 影片任務狀態查詢回應
      properties:
        task_id:
          type: string
          description: 任務 ID
          example: abcd1234efgh
        status:
          type: string
          description: 任務狀態
          enum:
            - queued
            - in_progress
            - completed
            - failed
          example: completed
        url:
          type: string
          description: 影片資源 URL（成功時）
          example: https://example.com/video.mp4
        format:
          type: string
          description: 影片格式
          example: mp4
        metadata:
          $ref: '#/components/schemas/VideoTaskMetadata'
        error:
          $ref: '#/components/schemas/VideoTaskError'
    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
    VideoTaskMetadata:
      type: object
      description: 影片任務中繼資料
      properties:
        duration:
          type: number
          description: 實際產生的影片時長
          example: 5
        fps:
          type: integer
          description: 實際影格率
          example: 30
        width:
          type: integer
          description: 實際寬度
          example: 1280
        height:
          type: integer
          description: 實際高度
          example: 720
        seed:
          type: integer
          description: 使用的隨機種子
          example: 20231234
    VideoTaskError:
      type: object
      description: 影片任務錯誤訊息
      properties:
        code:
          type: integer
          description: 錯誤碼
        message:
          type: string
          description: 錯誤訊息
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        使用 Bearer Token 認證。
        格式: `Authorization: Bearer sk-xxxxxx`

````