> ## 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 POST /api/v3/contents/generations/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:
  /api/v3/contents/generations/tasks:
    post:
      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: create__seedance__task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  example: doubao-seedance-2-0-260128
                  enum:
                    - doubao-seedance-1-0-lite-i2v-250428
                    - doubao-seedance-1-0-lite-t2v-250428
                    - doubao-seedance-1-0-pro-250528
                    - doubao-seedance-1-0-pro-fast-251015
                    - doubao-seedance-1-5-pro-251215
                    - doubao-seedance-2-0-260128
                    - doubao-seedance-2-0-fast-260128
                    - minimax-h3
                    - hailuo-2.3
                    - gemini-omni
                  description: >-
                    必填。模型名稱。可傳 Seedance 對外模型、`gemini-omni`、`minimax-h3` 或
                    `hailuo-2.3`。
                prompt:
                  type: string
                  example: 参考素材生成一段剧情短视频
                  description: 必填。影片生成主描述，不可為空。
                content:
                  type: array
                  description: >-
                    選填。火山方舟 content 陣列，依順序混排文字與素材項目。文字項使用 `{ "type": "text",
                    "text": "..." }`；圖片、影片、音訊項分別使用
                    `image_url`、`video_url`、`audio_url` 物件，並在其中放入 `url`，可搭配
                    `role`（如
                    `reference_image`、`reference_video`、`reference_audio`）和
                    `name` 供文字引用。
                  items:
                    type: object
                    required:
                      - type
                    properties:
                      type:
                        type: string
                        enum:
                          - text
                          - image_url
                          - video_url
                          - audio_url
                        description: 內容項類型。
                      text:
                        type: string
                        description: 文字內容，僅在 type=text 時使用。
                      image_url:
                        oneOf:
                          - type: string
                          - type: object
                            properties:
                              url:
                                type: string
                        description: 圖片 URL，建議使用物件寫法：`{"url":"https://..."}`。
                      video_url:
                        oneOf:
                          - type: string
                          - type: object
                            properties:
                              url:
                                type: string
                        description: 影片 URL，推薦物件寫法：`{"url":"https://..."}`。
                      audio_url:
                        oneOf:
                          - type: string
                          - type: object
                            properties:
                              url:
                                type: string
                        description: 音訊 URL，推薦物件寫法：`{"url":"https://..."}`。
                      role:
                        type: string
                        description: >-
                          素材用途標識，常見值如
                          reference_image、reference_video、reference_audio。
                      name:
                        type: string
                        description: 素材名稱，可供文字提示詞引用或區分多個素材。
                function_mode:
                  type: string
                  description: 選填。進階功能模式，例如 `omni_reference` 用於全方位參考。
                mode:
                  type: string
                  description: >-
                    選填。相容模式欄位，例如
                    `t2v`、`i2v`、`i2v_first_last`、`reference_images`、`reference_material`；`gemini-omni`
                    支援 `t2v`、`r2v`、`edit`。
                image_url:
                  type: string
                  description: 選填。單張參考圖 URL。
                image_urls:
                  type: array
                  items:
                    type: string
                  description: 選填。多張參考圖 URL 列表。
                input_reference:
                  type: string
                  description: 選填。兼容參考輸入欄位。
                end_image_url:
                  type: string
                  description: 選填。末幀參考圖 URL。
                last_image_url:
                  type: string
                  description: 選填。末幀參考圖 URL 別名。
                video_urls:
                  type: array
                  items:
                    type: string
                  description: 選填。參考影片 URL 列表。
                audio_urls:
                  type: array
                  items:
                    type: string
                  description: 選填。參考音訊 URL 列表。
                seconds:
                  oneOf:
                    - type: number
                    - type: string
                  description: 選填。影片長度（秒）；與 `duration` 相容。
                duration:
                  oneOf:
                    - type: number
                    - type: string
                  description: 選填。影片長度（秒）；與 `seconds` 相容。
                aspect_ratio:
                  type: string
                  description: 選填。長寬比，例如 `16:9`。
                ratio:
                  type: string
                  description: 選填。畫幅比例別名，如 `16:9`。
                size:
                  type: string
                  description: 選填。解析度或尺寸相容欄位。
                quality:
                  type: string
                  description: 選填。生成品質設定。
                resolution:
                  type: string
                  description: 選填。輸出解析度。
                fps:
                  type: number
                  description: 選填。影格率。
                generate_audio:
                  type: boolean
                  description: 選填。是否產生音訊。
                watermark:
                  type: boolean
                  description: 選填。是否添加浮水印。
            examples:
              seedance_tasks_reference_material:
                summary: Seedance content 任務
                value:
                  model: doubao-seedance-1-0-lite-i2v-250428
                  mode: reference_material
                  prompt: 测试文字
                  content:
                    - type: text
                      text: 测试文字
                    - type: image_url
                      image_url:
                        url: >-
                          https://imageproxy.zhongzhuan.chat/api/proxy/image/9979f1a754b3571d5e8bdcc397eedf53.png
                      role: reference_image
                      name: '1'
                    - type: video_url
                      video_url:
                        url: >-
                          https://imageproxy.zhongzhuan.chat/api/proxy/video/1979f1a754b3571d5e8bdcc397eedf53.mp4
                      role: reference_video
                      name: '2'
                    - type: audio_url
                      audio_url:
                        url: >-
                          https://imageproxy.zhongzhuan.chat/api/proxy/video/3979f1a754b3571d5e8bdcc397eedf53.mp3
                      role: reference_audio
                      name: '3'
                  duration: 5
                  size: 1280x720
              minimax_h3_tasks_content:
                summary: MiniMax H3 content 任務
                value:
                  model: minimax-h3
                  prompt: A cinematic product video with smooth camera motion
                  content:
                    - type: text
                      text: >-
                        Use the product image as reference and match the rhythm
                        of the audio.
                    - type: image_url
                      image_url:
                        url: https://example.com/product.jpg
                      role: reference_image
                      name: product
                    - type: audio_url
                      audio_url:
                        url: https://example.com/music.mp3
                      role: reference_audio
                      name: music
                  duration: 8
                  resolution: 1440p
                  ratio: '16:9'
                  generate_audio: true
              hailuo_2_3_tasks_first_frame:
                summary: Hailuo 2.3 首幀圖生影片
                value:
                  model: hailuo-2.3
                  prompt: >-
                    The camera slowly pushes in, natural motion and cinematic
                    lighting.
                  content:
                    - type: text
                      text: >-
                        The camera slowly pushes in, natural motion and
                        cinematic lighting.
                    - type: image_url
                      image_url:
                        url: https://example.com/first-frame.jpg
                      role: first_frame
                      name: first
                  duration: 10
                  resolution: 768p
                  ratio: '16:9'
              gemini_omni_seedance_t2v:
                summary: Gemini Omni t2v
                value:
                  model: gemini-omni
                  mode: t2v
                  prompt: A cinematic product video with smooth camera motion
                  duration: 8
                  size: 1280x720
              gemini_omni_seedance_r2v:
                summary: Gemini Omni r2v
                value:
                  model: gemini-omni
                  mode: r2v
                  content:
                    - type: text
                      text: Keep the product consistent and create a short ad video
                    - type: image_url
                      image_url:
                        url: https://example.com/product.jpg
                  duration: 8
                  size: 1280x720
              gemini_omni_seedance_edit:
                summary: Gemini Omni edit
                value:
                  model: gemini-omni
                  mode: edit
                  content:
                    - type: text
                      text: Change the outfit color while keeping the motion natural
                    - type: video_url
                      video_url:
                        url: https://example.com/input.mp4
                    - type: image_url
                      image_url:
                        url: https://example.com/style.jpg
                  duration: 8
                  size: 1280x720
      responses:
        '200':
          description: 任務建立成功
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                    example: task_xxx
                    description: 任務 ID。
                  status:
                    type: string
                    description: 任務狀態。
                    enum:
                      - queued
                      - running
                      - succeeded
                      - failed
                  created_at:
                    type: string
                    description: 建立時間 (Unix 秒)。
                  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`

````