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

# 获取任务结果

> 根据 taskId 查询任务执行状态和结果，支持轮询



## OpenAPI

````yaml GET /xai/tasks
openapi: 3.0.0
info:
  title: Xai AI
  description: API documentation for Xai AI
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.mountsea.ai
    description: API Gateway
security: []
tags:
  - name: xai
    description: ''
paths:
  /xai/tasks:
    get:
      tags:
        - XAI - 任务
      summary: 查询任务状态
      description: 根据 taskId 查询任务执行状态和结果，支持轮询
      operationId: XaiTaskController_getTaskResult
      parameters:
        - name: taskId
          required: true
          in: query
          description: 任务ID
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResultDto'
      security:
        - bearerAuth: []
components:
  schemas:
    TaskResultDto:
      type: object
      properties:
        taskId:
          type: string
          description: 任务 ID
        status:
          enum:
            - pending
            - ready
            - assigned
            - processing
            - completed
            - failed
            - cancelled
            - timeout
          type: string
          description: 任务状态
        result:
          type: object
          description: 任务结果（直接透传协议层返回，类型根据任务类型不同而变化）
          nullable: true
        errorMessage:
          type: string
          description: 错误信息
        errorCode:
          type: number
          description: 错误代码
        finishedAt:
          format: date-time
          type: string
          description: 完成时间
        createdAt:
          format: date-time
          type: string
          description: 创建时间
        traceId:
          type: string
          description: 追踪 ID
      required:
        - taskId
        - status
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````