> ## Documentation Index
> Fetch the complete documentation index at: https://docs.newapi.si/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`：選填，火山方舟 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` 會影響最終生成配置。

Seedance 2.5 圖片、影片、音訊混合參考範例（素材 URL 為佔位符，呼叫時請替換為實際可存取的連結）：

```json
{
  "model": "sd-2-5",
  "ratio": "9:16",
  "fps": 24,
  "duration": 10,
  "content": [
    {
      "type": "text",
      "text": "使用 @图片1 @图片2 @图片3 @音频1 参考@视频1 生成视频"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://demo1.png"
      },
      "role": "reference_image",
      "name": "图片1"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://demo2.png"
      },
      "role": "reference_image",
      "name": "图片2"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://demo3.png"
      },
      "role": "reference_image",
      "name": "图片3"
    },
    {
      "type": "video_url",
      "video_url": {
        "url": "https://video.mp4"
      },
      "role": "reference_video",
      "name": "视频1"
    },
    {
      "type": "audio_url",
      "audio_url": {
        "url": "https://audio.mp3"
      },
      "role": "reference_audio",
      "name": "音频1"
    }
  ]
}
```

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`。

Kling 4.0 呼叫：`kling-4.0`（720p）與 `kling-4.0-1080p` 同時支援 Seedance `content/duration/resolution/ratio/mode` 格式、`contents/settings/options` 與 OpenAI 影片格式；兩種統一影片入口可重複使用相同的請求主體。解析度必須與模型名稱一致。Kling 4.0 可直接使用 Seedance 格式 content/duration/resolution/ratio/mode，或 OpenAI 影片格式 prompt/seconds/size/input_reference；兩者都不需要額外的 contents/settings/options。mode 可選 t2v（純文字）、i2v（單張首幀）、i2v_first_last（首尾兩幀）、reference_images（一般參考圖）、reference_material（全能素材參考；音訊須使用支援此功能的路由）。省略 mode 且未指定工具時，有參考素材預設為 reference_material，沒有任何參考素材則預設為 t2v。參考模式會將素材視為一般參考圖，不會將明確指定的首尾幀默默改成參考圖；首尾幀請明確選擇 i2v 或 i2v_first_last，並省略畫面比例參數。Kling 4.0 預設同時生成音訊與影片。全能參考模式支援公開音訊 URL：/v1/videos 使用 audio_urls，Seedance 使用 content 中的 audio_url 項目；請使用支援音訊素材的路由。目前三個原生專用入口不接受參考音訊欄位。

Vidu Q4：`vidu-q4` 固定為 720p，`vidu-q4-540p` 固定為 540p，支援生成 3～16 秒影片。至少需要 1 張圖片，最多支援 15 張參考圖；參考生成可附帶最多 3 段 MP3 音訊，每段 3～12 秒、最大 50MB。不支援純文字生成、指定首尾影格或參考影片。多張圖片用於共同參考，不代表首尾位置。可透過 `POST /v1/videos`、`POST /api/v3/contents/generations/tasks`，或 Vidu 格式 `POST /ent/v2/img2video`、`POST /ent/v2/reference2video` 建立任務。建議統一入口使用 `mode=reference_images`；附帶音訊時使用 `mode=reference_material`。參考音訊可使用 `audio_urls`，Seedance 格式也可使用標準 `content` 的 `audio_url` 項；`audio` 布林欄位表示生成音訊開關，與參考音訊 URL 清單分別使用。解析度須與模型名稱一致。

### Magi-2 1080p

`magi-2-1080p` 支援 OpenAI `/v1/videos` 和 Ark `/api/v3/contents/generations/tasks` 兩種格式，分別透過對應路徑的 `GET /{task_id}` 查詢。固定為 1080p，生成時長為 4～30 秒。支援 16:9、9:16、1:1、4:3、3:4、21:9；1:1 輸出為 1440×1440。參考模式最多支援 10 張圖片、5 段影片、5 段音訊，共 20 份素材。每段影片和音訊長度為 2～30 秒，所有影片總長度不得超過 30 秒，所有音訊總長度不得超過 30 秒。圖片大小上限為 30 MB，影片為 200 MB，音訊為 15 MB。首尾影格模式不得混入其他圖片、影片或音訊參考。提示詞可依各類素材的輸入順序，使用 `<<<image_1>>>`、`<<<video_1>>>`、`<<<audio_1>>>` 引用。目前未提供獨立的 sand.ai 官方格式入口。

```json
{
  "model": "magi-2-1080p",
  "duration": 4,
  "resolution": "1080p",
  "ratio": "1:1",
  "content": [
    {
      "type": "text",
      "text": "以 <<<image_1>>> 的彩色积木为主体，参考 <<<video_1>>> 的缓慢转动及 <<<audio_1>>> 的轻柔节奏。"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/blocks.png"
      },
      "role": "reference_image"
    },
    {
      "type": "video_url",
      "video_url": {
        "url": "https://example.com/rotation.mp4"
      },
      "role": "reference_video"
    },
    {
      "type": "audio_url",
      "audio_url": {
        "url": "https://example.com/rhythm.wav"
      },
      "role": "reference_audio"
    }
  ]
}
```

查詢結果關注欄位：
- `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: NewAPIs API 參考文件
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.newapi.si
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`：選填，火山方舟 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` 會影響最終生成配置。


        Seedance 2.5 圖片、影片、音訊混合參考範例（素材 URL 為佔位符，呼叫時請替換為實際可存取的連結）：


        ```json

        {
          "model": "sd-2-5",
          "ratio": "9:16",
          "fps": 24,
          "duration": 10,
          "content": [
            {
              "type": "text",
              "text": "使用 @图片1 @图片2 @图片3 @音频1 参考@视频1 生成视频"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://demo1.png"
              },
              "role": "reference_image",
              "name": "图片1"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://demo2.png"
              },
              "role": "reference_image",
              "name": "图片2"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://demo3.png"
              },
              "role": "reference_image",
              "name": "图片3"
            },
            {
              "type": "video_url",
              "video_url": {
                "url": "https://video.mp4"
              },
              "role": "reference_video",
              "name": "视频1"
            },
            {
              "type": "audio_url",
              "audio_url": {
                "url": "https://audio.mp3"
              },
              "role": "reference_audio",
              "name": "音频1"
            }
          ]
        }

        ```


        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`。


        Kling 4.0 呼叫：`kling-4.0`（720p）與 `kling-4.0-1080p` 同時支援 Seedance
        `content/duration/resolution/ratio/mode` 格式、`contents/settings/options`
        與 OpenAI 影片格式；兩種統一影片入口可重複使用相同的請求主體。解析度必須與模型名稱一致。Kling 4.0 可直接使用 Seedance
        格式 content/duration/resolution/ratio/mode，或 OpenAI 影片格式
        prompt/seconds/size/input_reference；兩者都不需要額外的
        contents/settings/options。mode 可選
        t2v（純文字）、i2v（單張首幀）、i2v_first_last（首尾兩幀）、reference_images（一般參考圖）、reference_material（全能素材參考；音訊須使用支援此功能的路由）。省略
        mode 且未指定工具時，有參考素材預設為 reference_material，沒有任何參考素材則預設為
        t2v。參考模式會將素材視為一般參考圖，不會將明確指定的首尾幀默默改成參考圖；首尾幀請明確選擇 i2v 或
        i2v_first_last，並省略畫面比例參數。Kling 4.0 預設同時生成音訊與影片。全能參考模式支援公開音訊
        URL：/v1/videos 使用 audio_urls，Seedance 使用 content 中的 audio_url
        項目；請使用支援音訊素材的路由。目前三個原生專用入口不接受參考音訊欄位。


        Vidu Q4：`vidu-q4` 固定為 720p，`vidu-q4-540p` 固定為 540p，支援生成 3～16 秒影片。至少需要 1
        張圖片，最多支援 15 張參考圖；參考生成可附帶最多 3 段 MP3 音訊，每段 3～12 秒、最大
        50MB。不支援純文字生成、指定首尾影格或參考影片。多張圖片用於共同參考，不代表首尾位置。可透過 `POST /v1/videos`、`POST
        /api/v3/contents/generations/tasks`，或 Vidu 格式 `POST
        /ent/v2/img2video`、`POST /ent/v2/reference2video` 建立任務。建議統一入口使用
        `mode=reference_images`；附帶音訊時使用 `mode=reference_material`。參考音訊可使用
        `audio_urls`，Seedance 格式也可使用標準 `content` 的 `audio_url` 項；`audio`
        布林欄位表示生成音訊開關，與參考音訊 URL 清單分別使用。解析度須與模型名稱一致。


        ### Magi-2 1080p


        `magi-2-1080p` 支援 OpenAI `/v1/videos` 和 Ark
        `/api/v3/contents/generations/tasks` 兩種格式，分別透過對應路徑的 `GET /{task_id}`
        查詢。固定為 1080p，生成時長為 4～30 秒。支援 16:9、9:16、1:1、4:3、3:4、21:9；1:1 輸出為
        1440×1440。參考模式最多支援 10 張圖片、5 段影片、5 段音訊，共 20 份素材。每段影片和音訊長度為 2～30
        秒，所有影片總長度不得超過 30 秒，所有音訊總長度不得超過 30 秒。圖片大小上限為 30 MB，影片為 200 MB，音訊為 15
        MB。首尾影格模式不得混入其他圖片、影片或音訊參考。提示詞可依各類素材的輸入順序，使用
        `<<<image_1>>>`、`<<<video_1>>>`、`<<<audio_1>>>` 引用。目前未提供獨立的 sand.ai
        官方格式入口。


        ```json

        {
          "model": "magi-2-1080p",
          "duration": 4,
          "resolution": "1080p",
          "ratio": "1:1",
          "content": [
            {
              "type": "text",
              "text": "以 <<<image_1>>> 的彩色积木为主体，参考 <<<video_1>>> 的缓慢转动及 <<<audio_1>>> 的轻柔节奏。"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/blocks.png"
              },
              "role": "reference_image"
            },
            {
              "type": "video_url",
              "video_url": {
                "url": "https://example.com/rotation.mp4"
              },
              "role": "reference_video"
            },
            {
              "type": "audio_url",
              "audio_url": {
                "url": "https://example.com/rhythm.wav"
              },
              "role": "reference_audio"
            }
          ]
        }

        ```


        查詢結果關注欄位：

        - `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`

````

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