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

# 轮询 Agent 运行

> 按 jobId 取回 post_exa_agent_runs 提交的 Agent 运行。

按 `jobId` 取回 [`post_exa_agent_runs`](/docs/zh/api-reference/search/post_exa-agent-runs) 提交的 Agent 运行。返回同一个信封 —— `id`、`status`、`createdAt`、`completedAt`、`pricing`、`output`、`error`。反复轮询直到 `status` 为 `completed`、`failed` 或 `cancelled`；成功时 `output` 含 `text`、`structured` 和 `grounding`。只读取运行，不能发起运行。


## OpenAPI

````yaml openapi/zh/exa.json GET /exa/agent/runs/{jobId}
openapi: 3.0.0
info:
  title: Exa API
  version: 1.0.0
  description: >-
    通过 AIsa 网关开放的 Exa 神经语义搜索 endpoint 的统一 API 文档：Search、Contents、Answer，以及异步的研究型
    Agent Runs。


    Search、Contents 和 Answer 为同步接口，每次成功请求固定计费 $0.08。Agent Runs
    为异步接口：调用方提交任务，然后轮询返回的任务资源以获取状态和结果，每次任务固定计费 $0.10。上游 4xx 响应（例如
    401/403/404）不计费。Exa 返回的 `costDollars` 字段是上游成本明细，仅供参考——客户计费以上述 AIsa 固定价格为准。
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - bearerAuth: []
paths:
  /exa/agent/runs/{jobId}:
    get:
      tags:
        - https://docs.exa.ai/reference/get-a-research-task
      summary: 轮询研究型 Agent 任务。
      description: >-
        按 `jobId` 取回 `post_exa_agent_runs` 提交的 Agent 运行。返回同一个信封 ——
        `id`、`status`、`createdAt`、`completedAt`、`pricing`、`output`、`error`。反复轮询直到
        `status` 为 `completed`、`failed` 或 `cancelled`；成功时 `output` 含
        `text`、`structured` 和 `grounding`。只读取运行，不能发起运行。
      operationId: get_exa_agent_run
      parameters:
        - in: path
          name: jobId
          required: true
          schema:
            type: string
          description: 提交调用返回的任务 id。
      responses:
        '200':
          description: 该研究任务的当前状态。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJob'
components:
  schemas:
    AsyncJob:
      type: object
      description: >-
        一个异步集成任务。由提交调用（HTTP 202）以及轮询/详情调用返回。请按 id 轮询该任务，直到 status
        进入终态（completed、failed 或 cancelled）。
      properties:
        id:
          type: string
          description: 唯一的 AIsa 任务标识符。可用它轮询、列出或取消该任务。
          example: iaj_01HZY8Q2M4K7N9V3T6W1X0B2C3
        object:
          type: string
          description: 始终为 "integration_async_job"。
          example: integration_async_job
        endpoint:
          type: string
          description: 该任务所属的提交 endpoint。
          example: /apis/v1/exa/agent/runs
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
            - cancelled
          description: 面向用户的生命周期状态。queued 和 running 为非终态；completed、failed 和 cancelled 为终态。
        createdAt:
          type: string
          format: date-time
          description: 任务被受理的时间。
        completedAt:
          type: string
          format: date-time
          nullable: true
          description: 任务进入终态的时间。任务仍处于排队或运行中时为 null。
        pricing:
          type: object
          properties:
            currency:
              type: string
              example: USD
            authorizedMicrosUSD:
              type: integer
              description: 任务被受理时授权（冻结）的金额，单位为微美元。Agent Runs 按每次任务固定 $0.10 结算。
            finalMicrosUSD:
              type: integer
              nullable: true
              description: 任务进入终态后的最终结算金额，单位为微美元。结算前为 null。
            billingMode:
              type: string
              description: 该任务的计费模式。
              example: flat_per_call
        output:
          description: 任务结果载荷。仅在 status 为 completed 后出现。对 Agent Runs 而言是结构化的研究结果。
          nullable: true
        outputExpired:
          type: boolean
          description: 当结果已超过留存窗口、不再可获取时为 true。
        error:
          type: object
          nullable: true
          description: 当 status 为 failed 时出现，否则为 null。
          properties:
            code:
              type: string
              description: 机器可读的错误码。
            message:
              type: string
              description: 人类可读的错误信息。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````