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

# 异步结果

> 查询智能体异步任务的处理结果和状态。点击 **Try it** 按钮可快速试用。



## OpenAPI

````yaml /openapi/openapi.json post /v1/agents/async-result
openapi: 3.0.1
info:
  title: ZHIPU AI API
  description: ZHIPU AI 接口提供强大的 AI 能力，包括聊天对话、工具调用和视频生成。
  license:
    name: ZHIPU AI 开发者协议和政策
    url: https://chat.z.ai/legal-agreement/terms-of-service
  version: 1.0.0
  contact:
    name: Z.AI 开发者
    url: https://chat.z.ai/legal-agreement/privacy-policy
    email: user_feedback@z.ai
servers:
  - url: https://open.bigmodel.cn/api/
    description: 开放平台服务
security:
  - bearerAuth: []
tags:
  - name: 模型 API
    description: Chat API
  - name: 工具 API
    description: Web Search API
  - name: Agent API
    description: Agent API
  - name: 文件 API
    description: File API
  - name: 知识库 API
    description: Knowledge API
  - name: 实时 API
    description: Realtime API
  - name: 批处理 API
    description: Batch API
  - name: 助理 API
    description: Assistant API
  - name: 智能体 API（旧）
    description: QingLiu Agent API
paths:
  /v1/agents/async-result:
    post:
      tags:
        - Agent API
      summary: 异步结果
      description: 查询智能体异步任务的处理结果和状态。点击 **Try it** 按钮可快速试用。
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - async_id
                - agent_id
              properties:
                async_id:
                  type: string
                  description: 任务ID
                  example: VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5
                agent_id:
                  type: string
                  description: 智能体ID
                  example: intelligent_education_correction_polling
        required: true
      responses:
        '200':
          description: 业务处理成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentAsyncResultResponse'
        default:
          description: 请求失败。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AgentAsyncResultResponse:
      type: object
      properties:
        agent_id:
          type: string
          description: 智能体`ID`
        async_id:
          type: string
          description: 异步任务的`ID`
        status:
          type: string
          description: 任务状态，`success/failed/pending`
          enum:
            - success
            - failed
            - pending
        choices:
          type: array
          description: '`agent`输出'
          items:
            type: object
            properties:
              messages:
                type: array
                items:
                  type: object
                  properties:
                    role:
                      type: string
                      description: 用户的输入 `role = assistant`
                    content:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            description: 目前支持 `type=file_url`
                          file_url:
                            type: string
                            description: url链接
                          tag_cn:
                            type: string
                            description: 中文描述
                          tag_en:
                            type: string
                            description: 英文描述
        usage:
          type: object
          properties:
            total_tokens:
              type: integer
              description: 消耗总`tokens`数
    Error:
      type: object
      properties:
        error:
          required:
            - code
            - message
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准的 HTTP Bearer 认证方式，在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 页面获取密钥。

````