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

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


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