> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-feat-openapi-i18n.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 带分页和筛选列出任务

> 检索已认证用户的分页任务列表。
返回为列表视图优化的轻量级任务数据。
排除工作流和完整输出以减小负载大小。




## OpenAPI

````yaml /openapi/cloud.zh.yaml get /api/jobs
openapi: 3.0.3
info:
  title: Comfy Cloud API
  description: >
    <警告>

    **实验性API：** 此API是实验性的，可能会更改。

    端点、请求/响应格式和行为可能在未经通知的情况下修改。

    </警告>


    用于Comfy Cloud的API - 在云基础设施上运行ComfyUI工作流。


    此API允许您以编程方式与Comfy Cloud交互，包括：

    - 提交和管理工作流

    - 上传和下载文件

    - 监控作业状态和进度


    ## 云端与OSS ComfyUI兼容性


    Comfy Cloud实现了与OSS ComfyUI相同的API接口以实现最大兼容性，

    但某些字段为了兼容性被接受，但处理方式不同或被忽略：


    | 字段 | 端点 | 云端行为 |

    |-------|-----------|----------------|

    | `subfolder` | `/api/view`, `/api/upload/*` | **忽略** -
    云端使用内容寻址存储（基于哈希）。在响应中返回用于客户端组织。 |

    | `type` (input/output/temp) | `/api/view`, `/api/upload/*` | 部分使用 -
    所有文件使用基于标签的组织存储，而非目录结构。 |

    | `overwrite` | `/api/upload/*` | **忽略** - 内容寻址存储意味着相同内容始终具有相同哈希。 |

    | `number`, `front` | `/api/prompt` | **忽略** - 云端使用自己的每个用户公平队列调度。 |

    | `split`, `full_info` | `/api/userdata` | **忽略** - 云端始终返回完整文件元数据。 |


    这些字段保留在API模式中，以便与现有ComfyUI客户端和工作流进行即插即用兼容。
  version: 1.0.0
  license:
    name: GNU General Public License v3.0
    url: https://github.com/Comfy-Org/ComfyUI/blob/master/LICENSE
servers:
  - url: https://cloud.comfy.org
    description: Comfy Cloud API
security:
  - ApiKeyAuth: []
tags:
  - name: workflow
    description: |
      提交工作流执行并管理执行队列。
      这是在云端运行ComfyUI工作流的主要方式。
  - name: job
    description: |
      监控任务状态、查看执行历史和管理运行中的任务。
      任务通过POST /api/prompt提交工作流时创建。
  - name: asset
    description: |
      上传、下载和管理持久资产（图像、模型、输出）。
      资产提供持久存储，支持标签和元数据。
  - name: file
    description: |
      与传统本地ComfyUI兼容的传统文件上传和下载端点。
      对于新的集成，请考虑使用资产API。
  - name: model
    description: |
      浏览可用的AI模型。模型已预加载到云端基础设施上。
  - name: node
    description: |
      获取可用ComfyUI节点及其输入/输出的信息。
      对构建动态工作流界面很有用。
  - name: user
    description: |
      用户账户信息和个人数据存储。
  - name: system
    description: |
      服务器状态、健康检查和系统信息。
paths:
  /api/jobs:
    get:
      tags:
        - job
      summary: 带分页和筛选列出任务
      description: |
        检索已认证用户的分页任务列表。
        返回为列表视图优化的轻量级任务数据。
        排除工作流和完整输出以减小负载大小。
      operationId: listJobs
      parameters:
        - name: status
          in: query
          required: false
          description: 筛选方式：一个或多个状态（逗号分隔）。如果未提供，则返回所有任务。
          schema:
            type: string
          example: pending,in_progress
        - name: workflow_id
          in: query
          required: false
          description: 筛选方式：工作流ID（精确匹配）
          schema:
            type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        - name: output_type
          in: query
          required: false
          description: 筛选方式：输出媒体类型（仅适用于已完成的有输出的任务）
          schema:
            type: string
            enum:
              - image
              - video
              - audio
          example: image
        - name: sort_by
          in: query
          required: false
          description: 排序方式：字段（create_time = 任务提交时间，execution_time = 工作流运行耗时）
          schema:
            type: string
            enum:
              - create_time
              - execution_time
            default: create_time
          example: execution_time
        - name: sort_order
          in: query
          required: false
          description: 排序方向（asc = 升序，desc = 降序）
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: offset
          in: query
          required: false
          description: 分页偏移（从0开始）
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: limit
          in: query
          required: false
          description: 每页最大项数（1-1000）
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
      responses:
        '200':
          description: '成功: 任务已获取'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobsListResponse'
        '401':
          description: '未授权: 需要身份验证'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 内部服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    JobsListResponse:
      type: object
      required:
        - jobs
        - pagination
      properties:
        jobs:
          type: array
          description: 按指定排序字段排序的任务数组
          items:
            $ref: '#/components/schemas/JobEntry'
        pagination:
          $ref: '#/components/schemas/PaginationInfo'
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
    JobEntry:
      type: object
      description: 用于列表视图的轻量任务数据（不包括工作流和完整输出）
      required:
        - id
        - status
        - create_time
      properties:
        id:
          type: string
          format: uuid
          description: 唯一任务标识符
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - failed
            - cancelled
          description: 用户友好的任务状态
        execution_error:
          $ref: '#/components/schemas/ExecutionError'
          description: 来自ComfyUI的详细执行错误（仅适用于带有结构化错误数据的失败任务）
        create_time:
          type: integer
          format: int64
          description: 任务创建时间戳（Unix时间戳，秒）
        preview_output:
          type: object
          description: 主要预览输出（仅终端状态存在）
          additionalProperties: true
        outputs_count:
          type: integer
          description: 输出文件总数（非终端状态省略）
        workflow_id:
          type: string
          description: 标识工作流画面定义的UUID
        execution_start_time:
          type: integer
          format: int64
          description: 工作流执行开始时间戳（Unix毫秒，仅终端状态存在）
        execution_end_time:
          type: integer
          format: int64
          description: 工作流执行完成时间戳（Unix毫秒，仅终端状态存在）
    PaginationInfo:
      type: object
      required:
        - offset
        - limit
        - total
        - has_more
      properties:
        offset:
          type: integer
          minimum: 0
          description: 当前偏移量（从0开始）
        limit:
          type: integer
          minimum: 1
          description: 每页项目数
        total:
          type: integer
          minimum: 0
          description: 匹配滤镜的项目总数
        has_more:
          type: boolean
          description: 此页之后是否还有更多项目
    ExecutionError:
      type: object
      description: 来自 ComfyUI 的详细执行错误信息
      required:
        - node_id
        - node_type
        - exception_message
        - exception_type
        - traceback
        - current_inputs
        - current_outputs
      properties:
        node_id:
          type: string
          description: 失败节点的ID
        node_type:
          type: string
          description: 节点类型名称（例如 "KSampler"）
        exception_message:
          type: string
          description: 人类可读的报错信息
        exception_type:
          type: string
          description: Python异常类型（例如 "RuntimeError"）
        traceback:
          type: array
          items:
            type: string
          description: 回溯行数组（如不可用则为空数组）
        current_inputs:
          type: object
          additionalProperties: true
          description: 失败时的输入值（不可用则为空对象）
        current_outputs:
          type: object
          additionalProperties: true
          description: 失败时的输出值（如不可用则为空对象）
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        API密钥认证。从您的用户设置中生成API密钥
        位于https://platform.comfy.org/profile/api-keys。在X-API-Key头中传递密钥。

````