> ## 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.

# 查詢任務（Seedance）

> 此系列支援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 查詢狀態與結果。

建立任務核心欄位：
- `model`：必填，模型名稱。
- `prompt`：必填，影片生成主描述。
- `content`：選填，火山方舟 content 陣列，可混排文字、圖片、影片、音訊素材。
- `function_mode`：選填，常用於全能參考等進階模式。

相容入參：

以下欄位主要用於舊版客戶端和舊協議適配。新接入請盡量採用本頁「請求範例」中的標準格式：文本與參考素材使用 `content` 陣列，生成配置使用頂層 `duration`、`ratio`、`resolution`、`fps` 等欄位。

- `mode`：`t2v / i2v / i2v_first_last / reference_images / reference_material`
- `image_url / image_urls / input_reference`
- `end_image_url / last_image_url`
- `video_urls / audio_urls`
- `seconds / duration`
- `aspect_ratio / ratio / size`
- `quality / resolution`
- `fps`
- `generate_audio / watermark`

呼叫細節：
- 當 `mode=reference_material` 或 `function_mode=omni_reference` 時，建議透過 `content` 傳遞文字與參考素材。
- `content` 文字項寫法為 `{ "type": "text", "text": "测试文字" }`。
- `content` 圖片、影片、音訊素材項分別使用 `image_url`、`video_url`、`audio_url` 物件寫法，例如 `{ "type": "image_url", "image_url": { "url": "https://example.com/ref.png" }, "role": "reference_image", "name": "1" }`。
- `role` 可標示素材用途，`name` 可供提示詞中依名稱引用。
- `ratio`、`duration`、`resolution`、`fps` 會影響最終生成配置。

Gemini Omni 呼叫：
- `gemini-omni` 也可透過本 Seedance 任務介面呼叫。
- `mode=t2v` 用於文生影片，`mode=r2v` 用於參考圖/參考素材生成，`mode=edit` 用於影片編輯。
- 文字可放在 `prompt` 或 `content` 的 `text` 項；圖片可放在 `image_url / image_urls / reference_images / input_reference / content`；影片可放在 `video_urls / content`。
- 時長欄位可用 `duration` 或 `seconds`，會自動匹配到 4 / 6 / 8 / 10 秒檔。

MiniMax / Hailuo 調用：
- `minimax-h3` 可透過本任務介面呼叫，支援文生影片、圖片參考和音訊參考；文字可放在 `prompt` 或 `content` 文字項，素材可放在 `content`、`image_urls`、`audio_urls` 等欄位。
- `hailuo-2.3` 可透過本任務介面呼叫，需要首幀圖片，建議在 `content` 中傳 `role=first_frame` 的 `image_url` 項。
- `minimax-h3` 常用 `duration=5~15`、`resolution=1440p`；`hailuo-2.3` 常用 `duration=6` 或 `10`、`resolution=768p`。

查詢結果關注欄位：
- `items[].status`
- `items[].content.video_url` 或 `items[].video_url`
- `items[].error`
- `items[].progress`

Error fields: `error.code`, `error.message`.

```json
{
  "error": {
    "code": "invalid_request_error",
    "message": "requires at least one image in `images`"
  }
}
```



## OpenAPI

````yaml api-reference/zh-tw/openapi.json GET /api/v3/contents/generations/tasks/{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:
  /api/v3/contents/generations/tasks/{task_id}:
    get:
      tags:
        - 影片生成 Seedance 格式
      summary: 查詢任務（Seedance）
      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 查詢狀態與結果。


        建立任務核心欄位：

        - `model`：必填，模型名稱。

        - `prompt`：必填，影片生成主描述。

        - `content`：選填，火山方舟 content 陣列，可混排文字、圖片、影片、音訊素材。

        - `function_mode`：選填，常用於全能參考等進階模式。


        相容入參：


        以下欄位主要用於舊版客戶端和舊協議適配。新接入請盡量採用本頁「請求範例」中的標準格式：文本與參考素材使用 `content`
        陣列，生成配置使用頂層 `duration`、`ratio`、`resolution`、`fps` 等欄位。


        - `mode`：`t2v / i2v / i2v_first_last / reference_images /
        reference_material`

        - `image_url / image_urls / input_reference`

        - `end_image_url / last_image_url`

        - `video_urls / audio_urls`

        - `seconds / duration`

        - `aspect_ratio / ratio / size`

        - `quality / resolution`

        - `fps`

        - `generate_audio / watermark`


        呼叫細節：

        - 當 `mode=reference_material` 或 `function_mode=omni_reference` 時，建議透過
        `content` 傳遞文字與參考素材。

        - `content` 文字項寫法為 `{ "type": "text", "text": "测试文字" }`。

        - `content` 圖片、影片、音訊素材項分別使用 `image_url`、`video_url`、`audio_url` 物件寫法，例如
        `{ "type": "image_url", "image_url": { "url":
        "https://example.com/ref.png" }, "role": "reference_image", "name": "1"
        }`。

        - `role` 可標示素材用途，`name` 可供提示詞中依名稱引用。

        - `ratio`、`duration`、`resolution`、`fps` 會影響最終生成配置。


        Gemini Omni 呼叫：

        - `gemini-omni` 也可透過本 Seedance 任務介面呼叫。

        - `mode=t2v` 用於文生影片，`mode=r2v` 用於參考圖/參考素材生成，`mode=edit` 用於影片編輯。

        - 文字可放在 `prompt` 或 `content` 的 `text` 項；圖片可放在 `image_url / image_urls /
        reference_images / input_reference / content`；影片可放在 `video_urls /
        content`。

        - 時長欄位可用 `duration` 或 `seconds`，會自動匹配到 4 / 6 / 8 / 10 秒檔。


        MiniMax / Hailuo 調用：

        - `minimax-h3` 可透過本任務介面呼叫，支援文生影片、圖片參考和音訊參考；文字可放在 `prompt` 或 `content`
        文字項，素材可放在 `content`、`image_urls`、`audio_urls` 等欄位。

        - `hailuo-2.3` 可透過本任務介面呼叫，需要首幀圖片，建議在 `content` 中傳 `role=first_frame` 的
        `image_url` 項。

        - `minimax-h3` 常用 `duration=5~15`、`resolution=1440p`；`hailuo-2.3` 常用
        `duration=6` 或 `10`、`resolution=768p`。


        查詢結果關注欄位：

        - `items[].status`

        - `items[].content.video_url` 或 `items[].video_url`

        - `items[].error`

        - `items[].progress`


        Error fields: `error.code`, `error.message`.


        ```json

        {
          "error": {
            "code": "invalid_request_error",
            "message": "requires at least one image in `images`"
          }
        }

        ```
      operationId: query__seedance__task
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          description: Task ID
      responses:
        '200':
          description: 查詢成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: 任務 ID。
                  model:
                    type: string
                  status:
                    type: string
                    description: 任務狀態。
                    enum:
                      - queued
                      - running
                      - succeeded
                      - failed
                  error:
                    type: object
                    nullable: true
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                  created_at:
                    type: integer
                    description: 建立時間 (Unix 秒)。
                  updated_at:
                    type: integer
                  content:
                    type: object
                    properties:
                      video_url:
                        type: string
                      last_frame_url:
                        type: string
                  usage:
                    type: object
                    properties:
                      completion_tokens:
                        type: integer
                      total_tokens:
                        type: integer
                  items:
                    type: string
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: 任務 ID。
                        status:
                          type: string
                          description: 任務狀態，常見為 `queued`、`running`、`succeeded`、`failed`。
                        content:
                          type: object
                          properties:
                            video_url:
                              type: string
                              description: 影片結果位址。
                        video_url:
                          type: string
                          description: 影片結果位址。
                        error:
                          type: string
                          description: 失敗時的錯誤訊息。
                        progress:
                          type: string
                          description: 任務進度。
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        使用 Bearer Token 認證。
        格式: `Authorization: Bearer sk-xxxxxx`

````