> ## 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.

# Exa Agent Runs

> Submit a research task to the Exa Agent as an asynchronous job — submit, then poll the run for status and results.

Submit a natural-language research `query` and the Exa Agent runs it in the background, returning a structured result. Because deep research takes time, Agent Runs is an **asynchronous job**: you submit the run and then poll it for status and results.

**Lifecycle**

1. **Submit** — `POST /apis/v1/exa/agent/runs` with the research body and a required `Idempotency-Key` header. On success you get back `202 Accepted`, a `Location` header pointing at the job resource (`/apis/v1/exa/agent/runs/{jobId}`), and a job object whose `status` starts as `queued`. Re-submitting with the same key and the same request body returns the original run; the same key with a different body returns `409 idempotency_conflict`.
2. **Poll** — `GET /apis/v1/exa/agent/runs/{jobId}` and repeat until `status` is terminal: `completed`, `failed`, or `cancelled`. When `completed`, the research result is in `output`. The provider supports polling only — there is no webhook or SSE callback.
3. **List** — `GET /apis/v1/exa/agent/runs` (optional `status` filter, paginated) to page through your runs.
4. **Cancel** — `POST /apis/v1/exa/agent/runs/{jobId}/cancel` to request cancellation; cancelled runs are not billed.

Supply an `outputSchema` to validate the structured output, `effort` to trade depth for latency, `previousRunId` to continue a prior run, and `input`/`dataSources` for row-processing and Exa Connect sources. Billed at a flat **\$0.10** per run. For a single-shot cited answer instead of a multi-step run, use [`post_exa-answer`](/docs/api-reference/search/post_exa-answer).


## OpenAPI

````yaml openapi/exa.json POST /exa/agent/runs
openapi: 3.0.0
info:
  title: Exa API
  version: 1.0.0
  description: >-
    Unified API documentation for Exa neural semantic search endpoints exposed
    through the AIsa gateway: Search, Contents, Answer, and the asynchronous
    research Agent Runs.


    Search, Contents, and Answer are synchronous and billed at a flat $0.08 per
    successful request. Agent Runs is asynchronous: the caller submits a run and
    then polls the returned job resource for status and results, billed at a
    flat $0.10 per run. Upstream 4xx responses (for example 401/403/404) are not
    billed. The `costDollars` field that Exa returns is the upstream cost
    breakdown and is informational only — customer billing follows the flat AIsa
    prices above.
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - bearerAuth: []
paths:
  /exa/agent/runs:
    post:
      tags:
        - https://docs.exa.ai/reference/create-a-research-task
      summary: Submit an asynchronous research Agent run.
      description: >-
        Asynchronous. Submit a natural-language research task; the Agent runs it
        in the background and returns a structured result. Billed at a flat
        $0.10 per run.


        Lifecycle:

        1. Submit — POST /exa/agent/runs with the research body and a required
        `Idempotency-Key` header. On success the API returns HTTP 202 Accepted,
        a `Location` response header pointing at the job resource
        (`/apis/v1/exa/agent/runs/{jobId}`), and an integration_async_job body
        with `status` = queued. Re-submitting with the same key and request
        fingerprint returns the original run; the same key with a different
        fingerprint returns 409 idempotency_conflict.

        2. Poll — GET /apis/v1/exa/agent/runs/{jobId} to retrieve the run.
        Repeat until `status` is terminal (completed, failed, or cancelled).
        When completed, the research result is in `output`. The provider
        supports polling only (no webhook or SSE callback).

        3. List — GET /apis/v1/exa/agent/runs (optional status filter,
        paginated) to page through your runs on this endpoint.

        4. Cancel — POST /apis/v1/exa/agent/runs/{jobId}/cancel to request
        cancellation. Cancelled runs are not billed.
      parameters:
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            type: string
            maxLength: 191
          description: >-
            Unique key (1 to 191 characters) that makes the submit idempotent.
            Re-submitting with the same key and request fingerprint returns the
            original run.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  description: The natural-language research query.
                  example: >-
                    Summarize the main changes in RAG evaluation methods over
                    the past year as a bullet list.
                outputSchema:
                  type: object
                  description: JSON Schema used to validate the structured output.
                input:
                  type: object
                  description: 'Row-processing input: rows to process and exclusions.'
                  properties:
                    data:
                      type: array
                      items: {}
                      description: Input rows for the run.
                    exclusion:
                      description: Items to exclude from processing.
                effort:
                  type: string
                  description: Compute/depth tier for the run.
                previousRunId:
                  type: string
                  description: Continue from a previously completed run.
                dataSources:
                  type: array
                  items: {}
                  description: >-
                    Third-party data sources (Exa Connect) the Agent is granted
                    access to.
              required:
                - query
      responses:
        '202':
          description: >-
            Research run accepted. The Location header points at the job
            resource; poll it until terminal.
          headers:
            Location:
              schema:
                type: string
              description: >-
                Path of the created job resource, e.g.
                /apis/v1/exa/agent/runs/{jobId}.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJob'
        '409':
          description: >-
            idempotency_conflict — the same Idempotency-Key was reused with a
            different request body.
components:
  schemas:
    AsyncJob:
      type: object
      description: >-
        An asynchronous integration job. Returned by the submit call (HTTP 202)
        and by the poll/detail call. Poll the job by its id until status is a
        terminal value (completed, failed, or cancelled).
      properties:
        id:
          type: string
          description: Unique AIsa job identifier. Use it to poll, list, or cancel the job.
          example: iaj_01HZY8Q2M4K7N9V3T6W1X0B2C3
        object:
          type: string
          description: Always "integration_async_job".
          example: integration_async_job
        endpoint:
          type: string
          description: The submit endpoint this job belongs to.
          example: /apis/v1/exa/agent/runs
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
            - cancelled
          description: >-
            Customer-facing lifecycle status. queued and running are
            non-terminal; completed, failed, and cancelled are terminal.
        createdAt:
          type: string
          format: date-time
          description: When the job was accepted.
        completedAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the job reached a terminal status. Null while the job is still
            queued or running.
        pricing:
          type: object
          properties:
            currency:
              type: string
              example: USD
            authorizedMicrosUSD:
              type: integer
              description: >-
                Amount authorized (held) when the job was admitted, in
                micro-USD. Agent Runs settle at the flat $0.10 per run.
            finalMicrosUSD:
              type: integer
              nullable: true
              description: >-
                Final settled cost in micro-USD once the job is terminal. Null
                until settlement.
            billingMode:
              type: string
              description: Billing mode for the job.
              example: flat_per_call
        output:
          description: >-
            Job result payload. Present only once status is completed. For Agent
            Runs this is the structured research result.
          nullable: true
        outputExpired:
          type: boolean
          description: >-
            True when the result has been retained past its retention window and
            is no longer retrievable.
        error:
          type: object
          nullable: true
          description: Present when status is failed. Null otherwise.
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable error message.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````