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

# 查询任务列表

> 读取当前账户已存储的任务。

> 当前为 API 预览。生成接口尚未接入供应商，成功认证后仍可能返回 503；不会创建任务或扣积分。

## 权限与结果

使用具有 usage:read 权限的 API 密钥。响应最多返回 200 条本账户任务，按创建时间倒序排列。当前尚无分页；此请求不会启动生成。

[读取单个任务](https://docs.apistable.com/cn/query-task.md)


## OpenAPI

````yaml openapi.json GET /v1/tasks
openapi: 3.1.0
info:
  title: APIstable API preview
  version: 0.1.0-preview
  description: >-
    Current implemented HTTP surface. / 当前已实现的 HTTP 接口。 Models and quote prices
    are illustrative. Real providers and paid generation are not connected. POST
    /v1/tasks and /v1/chat/completions return 503 provider_not_configured after
    authentication and applicable validation; no credits are reserved or
    charged. Live 202 acceptance, provider callbacks, SSE, idempotent task
    creation, and full model capability adapters remain future integration work.
    Website login sessions are separate from application API keys.
servers:
  - url: https://apistable.com
    description: APIstable API
security: []
tags:
  - name: Models
  - name: Quotes
  - name: Tasks
  - name: Credits
  - name: LLM
paths:
  /v1/tasks:
    get:
      tags:
        - Tasks
      summary: List stored tasks / 获取已存任务
      description: >-
        Requires usage:read. Returns up to 200 account-owned tasks, newest
        first. No pagination cursor is implemented yet. This endpoint does not
        generate work.
      operationId: listTasks
      responses:
        '200':
          description: Stored tasks
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Task'
        '401':
          description: invalid_api_key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: insufficient_scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: service_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Task:
      type: object
      required:
        - task_id
        - model
        - modality
        - status
        - output_count
        - fallback
        - created_at
        - duration_ms
        - counts
        - billing
        - items
      properties:
        task_id:
          type: string
        model:
          type: string
        modality:
          type: string
        status:
          type: string
          description: >-
            Operation status. Possible states include queued, running,
            falling_back, reconciliation_required, succeeded,
            partially_succeeded, failed, and cancelled.
        output_count:
          type: integer
          minimum: 1
          maximum: 4
        fallback:
          type: boolean
        created_at:
          type: string
          format: date-time
        duration_ms:
          type: integer
          minimum: 0
          description: Completed duration; currently zero for unfinished tasks.
        counts:
          type: object
          required:
            - succeeded
            - failed
            - cancelled
            - pending
          properties:
            succeeded:
              type: integer
              minimum: 0
            failed:
              type: integer
              minimum: 0
            cancelled:
              type: integer
              minimum: 0
            pending:
              type: integer
              minimum: 0
        billing:
          type: object
          required:
            - initial_reserved_credits
            - charged_credits
            - released_credits
            - remaining_reserved_credits
          properties:
            initial_reserved_credits:
              type: number
              minimum: 0
              description: Credits, not USD. / 积分，非美元。
            charged_credits:
              type: number
              minimum: 0
              description: Credits, not USD. / 积分，非美元。
            released_credits:
              type: number
              minimum: 0
              description: Credits, not USD. / 积分，非美元。
            remaining_reserved_credits:
              type: number
              minimum: 0
              description: Credits, not USD. / 积分，非美元。
        items:
          type: array
          items:
            $ref: '#/components/schemas/GenerationItem'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
    GenerationItem:
      type: object
      required:
        - item_id
        - index
        - status
        - final_channel_type
        - charged_credits
        - attempts
        - outputs
      properties:
        item_id:
          type: string
        index:
          type: integer
          minimum: 0
        status:
          type: string
        final_channel_type:
          type:
            - string
            - 'null'
          description: Selected successful route only; null for unfinished or failed items.
        charged_credits:
          type: number
          minimum: 0
          description: Credits, not USD. / 积分，非美元。
        attempts:
          type: array
          items:
            type: object
            required:
              - attempt_id
              - channel_type
              - status
              - duration_ms
            properties:
              attempt_id:
                type: string
              channel_type:
                type: string
              status:
                type: string
              duration_ms:
                type: integer
                minimum: 0
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/Output'
    Output:
      type: object
      required:
        - output_id
        - type
        - status
        - assets
        - metadata
        - expires_at
      properties:
        output_id:
          type: string
        type:
          type: string
        status:
          type: string
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        title:
          type:
            - string
            - 'null'
        assets:
          type: array
          items:
            type: object
            required:
              - role
              - url
            properties:
              role:
                type: string
              url:
                type: string
        metadata:
          type: object
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: APIstable API key
      description: >-
        API key beginning as_. Keep on the server. Scope permissions are checked
        separately.

````

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