> ## 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)）。

使用建立介面回傳的本平台任務 ID。task_ids 為以逗號分隔的 1 至 100 個唯一 ID；僅查詢目前權杖所屬使用者的 Kling 4.0 任務。任一 ID 不存在、不屬於目前使用者，或不是 Kling 4.0 任務時，整體回傳 404。data 一律為陣列，完成後的 outputs 包含影片 URL。不支援 external_task_ids 或 POST /tasks 清單查詢。



## OpenAPI

````yaml api-reference/zh-tw/openapi.json GET /tasks
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:
  /tasks:
    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)）。


        使用建立介面回傳的本平台任務 ID。task_ids 為以逗號分隔的 1 至 100 個唯一 ID；僅查詢目前權杖所屬使用者的 Kling
        4.0 任務。任一 ID 不存在、不屬於目前使用者，或不是 Kling 4.0 任務時，整體回傳 404。data 一律為陣列，完成後的
        outputs 包含影片 URL。不支援 external_task_ids 或 POST /tasks 清單查詢。
      operationId: query_kling4_native_tasks
      parameters:
        - name: task_ids
          in: query
          required: true
          schema:
            type: string
            example: task_example_1,task_example_2
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - request_id
                  - data
                properties:
                  code:
                    type: integer
                    example: 0
                  message:
                    type: string
                  request_id:
                    type: string
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: 本站任務 ID，查詢時原樣傳入。
                        status:
                          type: string
                          enum:
                            - submitted
                            - processing
                            - succeeded
                            - failed
                        create_time:
                          type: integer
                          format: int64
                          description: 建立時間，Unix 毫秒。
                        update_time:
                          type: integer
                          format: int64
                          description: 更新時間，Unix 毫秒。
                        external_id:
                          type: string
                          maxLength: 0
                        message:
                          type: string
                          description: 任務狀態說明，失敗時為錯誤原因。
                        outputs:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - video
                              id:
                                type: string
                              url:
                                type: string
                                format: uri
                              duration:
                                type: string
                                description: 影片時長，秒。
              examples:
                success:
                  summary: 成功
                  value:
                    code: 0
                    message: SUCCEED
                    request_id: request_example
                    data:
                      - id: task_example
                        status: succeeded
                        create_time: 1792710000000
                        update_time: 1792710000000
                        external_id: ''
                        message: ''
                        outputs:
                          - type: video
                            id: video_example
                            url: https://example.com/result.mp4
                            duration: '10'
        '400':
          description: task_ids缺失或參數無效。
        '404':
          description: 任務不存在或無法存取。
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        使用 Bearer Token 認證。
        格式: `Authorization: Bearer sk-xxxxxx`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.