> ## 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/cn/视频生成sora兼容格式/创建视频)）。

用于创建视频生成任务，并通过任务 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/cn/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/cn/视频生成sora兼容格式/创建视频)）。


        用于创建视频生成任务，并通过任务 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`

````