> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 查询任务列表

> 批量查询当前 API Key 创建的任务，按创建时间倒序。



## OpenAPI

````yaml /openapi/zh/seedance-2-5-flash.json get /api/v3/contents/generations/tasks
openapi: 3.1.0
info:
  description: >-
    DreamTo 开放平台 API。本文件由 Gateway
    源码自动生成（apps/gateway/internal/service/seedance_v3_contract.go），请勿手工修改。
  title: Seedance 2.5 Flash · DreamTo 开放平台 API
  version: v3
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Seedance 2 视频生成
paths:
  /api/v3/contents/generations/tasks:
    get:
      tags:
        - Seedance 2 视频生成
      summary: 查询任务列表
      description: 批量查询当前 API Key 创建的任务，按创建时间倒序。
      operationId: seedanceListTasks
      parameters:
        - description: >-
            按任务 ID 精确筛选，可传多个：重复参数名 `filter.task_ids=a&filter.task_ids=b`，或逗号分隔
            `filter.task_ids=a,b`；最多取前 100 个。不传则返回当前 API Key 名下的任务列表。
          explode: true
          in: query
          name: filter.task_ids
          schema:
            items:
              type: string
            maxItems: 100
            type: array
        - description: |-
            按状态筛选，不传则不筛选。`queued` 与 `running` 均表示处理中；传入其他值返回空列表（不报错）。

            **可选值：**
            - `queued`：处理中（与 `running` 等价）
            - `running`：处理中
            - `succeeded`：已成功
            - `failed`：已失败
          explode: false
          in: query
          name: filter.status
          schema:
            enum:
              - queued
              - running
              - succeeded
              - failed
            type: string
        - description: 页码，默认 `1`，范围 1 ~ 500，越界自动收敛到边界，非数字按默认值处理。
          explode: false
          in: query
          name: page_num
          schema:
            default: 1
            format: int64
            maximum: 500
            minimum: 1
            type: integer
        - description: 每页数量，默认 `20`，范围 1 ~ 500，越界自动收敛到边界，非数字按默认值处理。
          explode: false
          in: query
          name: page_size
          schema:
            default: 20
            format: int64
            maximum: 500
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              examples:
                example:
                  value:
                    items:
                      - id: task_8c1d2e3f4a5b6c7d8e9f0a1b
                        model: seedance-2.5-flash
                        status: succeeded
                        content:
                          video_url: https://example-cdn.com/videos/2026/11/11/output.mp4
                        created_at: 1794384000
                        updated_at: 1794384196
                        duration: 5
                        ratio: '16:9'
                        resolution: 720p
                        output_format: mp4
                        usage:
                          completion_tokens: 108900
                          total_tokens: 108900
                    total: 1
                    request_id: req_c3d5e7f9a1b2c4d6e8f0a2b4
              schema:
                $ref: '#/components/schemas/SeedanceV3TaskList'
          description: 成功
          headers:
            X-Request-Id:
              description: 本次请求的唯一 ID（`req_` 开头）。所有响应（成功与失败）都带该头，排查问题时请提供该值与任务 `id`。
              schema:
                type: string
        '401':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: unauthorized
                      message: Invalid API key
                      type: authentication_error
                      http_status: 401
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`unauthorized`：API Key 无效或缺失'
        '403':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: forbidden
                      message: No permission to access this resource
                      type: permission_error
                      http_status: 403
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`forbidden`：无权限访问该资源'
        '429':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: rate_limit_exceeded
                      message: Rate limit exceeded. Please try again later.
                      type: rate_limit_error
                      http_status: 429
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`rate_limit_exceeded`：请求过于频繁，请稍后重试'
        '500':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: api_error
                      message: Internal server error, please retry later
                      type: api_error
                      http_status: 500
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`api_error`：服务器内部错误，可重试'
        '503':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: service_unavailable
                      message: Service temporarily unavailable, please retry later
                      type: api_error
                      http_status: 503
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`service_unavailable`：服务暂时不可用（502 / 503 / 504），可重试'
components:
  schemas:
    SeedanceV3TaskList:
      additionalProperties: false
      description: 任务列表。
      properties:
        items:
          description: 当前页的任务，按创建时间倒序，结构与「查询任务」返回的任务对象一致。
          items:
            $ref: '#/components/schemas/SeedanceV3Task'
          type: array
        total:
          description: 符合筛选条件的任务总数。
          format: int64
          type: integer
        request_id:
          description: 本次请求 ID（`req_` 开头），与响应头 `X-Request-Id` 相同。排查问题时请提供该值与任务 `id`。
          examples:
            - req_c3d5e7f9a1b2c4d6e8f0a2b4
          type: string
      required:
        - items
        - total
        - request_id
      type: object
    SeedanceV3ErrorResponse:
      additionalProperties: false
      description: >-
        错误响应。建议先按 HTTP 状态码分支（可重试 / 需改参数 / 需充值），再用 `error.code` 与 `error.param`
        细分。
      properties:
        error:
          $ref: '#/components/schemas/SeedanceV3ErrorBody'
          description: 错误对象。
        request_id:
          description: 本次请求 ID（`req_` 开头），与响应头 `X-Request-Id` 相同。排查问题时请提供该值与任务 `id`。
          examples:
            - req_3f9a1c2b7d4e5f60718293a4
          type: string
      required:
        - error
        - request_id
      type: object
    SeedanceV3Task:
      additionalProperties: false
      description: >-
        任务对象。恒定返回的字段只有 `id` / `model` / `status` / `created_at` /
        `updated_at`，其余字段仅在有对应信息时返回，请按「字段可能不存在」做兼容解析。
      properties:
        id:
          description: 任务 ID（`task_` 开头）。
          examples:
            - task_8c1d2e3f4a5b6c7d8e9f0a1b
          type: string
        model:
          description: 创建任务时传入的 `model`，原样回显，不会被改写。
          examples:
            - seedance-2.0
          type: string
        status:
          description: >-
            任务状态。用它做业务分支：`running` 继续轮询，`succeeded` 读取
            `content.video_url`，`failed` 读取 `error.message`。


            **可选值：**

            - `running`：处理中（排队中与生成中均为 `running`），请继续轮询

            - `succeeded`：成功，读取 `content.video_url`

            - `failed`：失败，读取 `error.message`
          enum:
            - running
            - succeeded
            - failed
          type: string
        content:
          $ref: '#/components/schemas/SeedanceV3TaskOutput'
          description: 生成结果，仅 `succeeded` 时返回。
        error:
          $ref: '#/components/schemas/SeedanceV3TaskError'
          description: 失败信息，仅 `failed` 时返回。
        created_at:
          description: 任务创建时间，Unix 时间戳（秒）。
          examples:
            - 1794384000
          format: int64
          type: integer
        updated_at:
          description: 任务最近更新时间，Unix 时间戳（秒）。
          examples:
            - 1794384196
          format: int64
          type: integer
        duration:
          description: '生成视频的实际时长（秒）。请求 `duration: -1`（智能时长）时，以本字段为准。'
          format: int64
          type: integer
        frames_per_second:
          description: 生成视频的帧率（FPS）。
          format: int64
          type: integer
        ratio:
          description: 生成视频的实际宽高比，例如 `16:9`。
          type: string
        resolution:
          description: 生成视频的分辨率，例如 `720p`。
          type: string
        seed:
          description: 本次生成实际使用的随机种子，可在新任务中传入 `seed` 复现相近结果。
          format: int64
          type: integer
        generate_audio:
          description: 本次是否生成了音频。
          type: boolean
        output_format:
          description: 输出容器格式，例如 `mp4`。
          type: string
        service_tier:
          description: 实际使用的服务档位（如模型侧返回）。
          type: string
        priority:
          description: 任务优先级（如模型侧返回）。
          format: int64
          type: integer
        execution_expires_after:
          description: 任务执行超时时间（秒）（如模型侧返回）。
          format: int64
          type: integer
        usage:
          $ref: '#/components/schemas/SeedanceV3TaskUsage'
          description: Token 用量，任务产生计量后返回。
      required:
        - id
        - model
        - status
        - created_at
        - updated_at
      type: object
    SeedanceV3ErrorBody:
      additionalProperties: false
      description: 错误对象。
      properties:
        code:
          description: >-
            错误码：`invalid_parameter`（参数校验失败）、`invalid_request`、`unauthorized`、`insufficient_balance`、`forbidden`、`not_found`、`rate_limit_exceeded`、`api_error`、`service_unavailable`。
          examples:
            - invalid_parameter
          type: string
        message:
          description: 可读的错误描述，可直接展示给用户。
          type: string
        type:
          description: >-
            错误类别：`invalid_request_error`、`authentication_error`、`insufficient_balance_error`、`permission_error`、`rate_limit_error`、`api_error`。
          examples:
            - invalid_request_error
          type: string
        http_status:
          description: 与响应 HTTP 状态码相同。
          examples:
            - 400
          format: int64
          type: integer
        request_id:
          description: 本次请求 ID，与响应头 `X-Request-Id` 相同，排查问题时请提供。
          examples:
            - req_3f9a1c2b7d4e5f60718293a4
          type: string
        param:
          description: 出错的请求字段，仅参数校验失败时返回，例如 `duration`、`content[1]`。
          examples:
            - duration
          type: string
      required:
        - code
        - message
        - type
        - http_status
        - request_id
      type: object
    SeedanceV3TaskOutput:
      additionalProperties: false
      description: 生成结果。
      properties:
        video_url:
          description: 生成视频的直接下载地址。请在任务成功后及时下载并保存到你自己的存储中，不要作为长期访问地址。
          format: uri
          type: string
        last_frame_url:
          description: '尾帧图片地址，仅请求了 `return_last_frame: true` 且有结果时返回。'
          format: uri
          type: string
      type: object
    SeedanceV3TaskError:
      additionalProperties: false
      description: 任务失败信息。
      properties:
        code:
          description: 错误码，任务失败时固定为 `task_failed`。查询接口此时仍返回 HTTP 200。
          enum:
            - task_failed
          type: string
        message:
          description: >-
            可读的失败原因，例如素材不合规、超出模型限制等；未知原因时为 `Video generation failed, please
            retry`。
          type: string
      required:
        - code
        - message
      type: object
    SeedanceV3TaskUsage:
      additionalProperties: false
      description: Token 用量。各字段为 0 时不返回。
      properties:
        prompt_tokens:
          description: 输入（提示词与参考素材）消耗的 token 数。
          format: int64
          type: integer
        completion_tokens:
          description: 生成视频消耗的 token 数，与分辨率、时长、帧率相关。
          format: int64
          type: integer
        cache_tokens:
          description: 命中缓存的 token 数。
          format: int64
          type: integer
        total_tokens:
          description: 总 token 数。
          format: int64
          type: integer
        thoughts_tokens:
          description: 模型推理（思考）消耗的 token 数。
          format: int64
          type: integer
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        在请求头携带 `Authorization: Bearer <API Key>`。API Key 在 DreamTo
        控制台创建，同一账号下的多个 Key 共享素材库。
      scheme: bearer
      type: http

````

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