Skip to main content
Exa Agent is an async, usage-based endpoint for high-compute tasks like list building, enrichment, and deep research. It handles complex reasoning and can return many structured output fields. Think of it as a context agent: you describe the data you want and the shape it should come back in, and Exa Agent orchestrates the tool calls needed to get there. A single run can fan out many searches across different angles, read and condense the pages behind them, split list building into subtasks that run in parallel, verify each candidate against your criteria, enrich contacts, and query any Exa Connect data partners you attach. You get the assembled context back as one grounded, structured result instead of orchestrating each /search and /contents call yourself. Each run can return a natural-language answer, schema-validated JSON, field-level grounding, metadata, and a cost breakdown. You can retrieve completed runs later, list past runs, replay events, or continue from a previous run.
Prefer MCP? Exa Agent and Exa Connect are available in Exa MCP. Enable tools=agent_run to run multi-step research, list-building, enrichment, and structured output from Claude, Cursor, and other MCP clients.

When to use Exa Agent

Use Exa Agent when a workflow needs more than a single search or extraction call, or when you would otherwise write your own loop of searches, page reads, and verification steps to assemble the data:
  • Build lists from open-ended criteria, then enrich each result
  • Research entities across many fields with citations
  • Run multi-hop tasks like “find companies, then find their decision makers”
  • Produce structured JSON from a long-running web research task
  • Combine web research with premium data partners in one grounded answer
  • Continue from a previous run with a follow-up request like “find 10 more results”
Exa Agent is higher-latency and async by design. For a single low-latency search where you orchestrate the calls yourself, start with the Search API.

Quickstart

This example starts a run that builds a structured list of people matching your criteria. It returns JSON in output.structured.

1. Install the Exa SDK

2. Set your API key

3. Create a run

Add Accept: text/event-stream when creating a run to receive server-sent events as the run is queued, started, and completed. See Stream events for more details.

4. Poll for completion

If you do not stream events, save the returned id and poll the run until it reaches a terminal status.
Completed runs include:
  • output.text: a natural-language answer
  • output.structured: validated JSON when you provide outputSchema
  • output.grounding: citations for text or structured fields, when emitted
  • costDollars: the run’s cost breakdown
Exa Agent is also available through the OpenAI-compatible Responses API. Point the OpenAI SDK at https://api.exa.ai, use model: "exa-agent", and choose synchronous, streaming, or background execution. See OpenAI SDK compatibility.

Verify and enrich a specific entity

Beyond list building, use Exa Agent to inspect a single known entity, verify a claim against authoritative sources, and return structured enrichment. This example checks whether a company’s official website has a publicly accessible pricing page, and enriches the result with pricing details when they are available. The schema requires only domain and verdict; everything else is optional enrichment.
Schemas for verification workflows should account for uncertainty. Make fields that may not be verifiable nullable and leave them out of required, so the agent can return null instead of fabricating a value. The verdict enum distinguishes a failed inspection (cannot_verify) from actual negative evidence (absent): a site that could not be reached is not evidence that the page does not exist.

Stream events

Streaming keeps the create request open and sends Server-Sent Events (SSE) until the run completes. See Event format for the event types and payloads. Set stream=True in Python, stream: true in JavaScript, or send Accept: text/event-stream over HTTP:

Event format

Each SSE frame contains an event ID, event name, and JSON payload:
The stream may also contain comment lines such as : keep-alive. SSE clients ignore comments automatically; custom parsers should do the same.

Event types

Events associated with the same research step include a callId. It corresponds to item.call_id in tool progress events. Use it to group search traces, sources, and tool progress. Some search-trace descriptions are generated asynchronously and can arrive after the source or tool event they describe, so do not correlate them by arrival order alone. Treat agent_run.source.added as a live preview rather than a complete citation list. The terminal run’s output.grounding is the authoritative grounding output.

Replay stored events

For non-ZDR runs, GET /agent/runs/{id}/events returns stored events as paginated JSON. Send Accept: text/event-stream to replay the stored events as SSE, and Last-Event-ID to skip events your client has already processed:
cURL
The replay endpoint sends the events stored at request time and then closes; it does not continue following a running run. ZDR runs do not retain events and cannot be replayed. For forward compatibility, ignore event names your application does not recognize and continue until a terminal event arrives.

Return structured JSON

Use outputSchema to return schema-validated JSON in output.structured. outputSchema supports the JSON Schema specification. To request contact information, describe the desired contact fields in outputSchema. Use standard JSON Schema shapes such as { "type": "string", "format": "email" } for email addresses, { "type": "string", "format": "phone" } for phone numbers, and { "type": "string", "format": "uri" } for URLs. Bound list sizes with maxItems when possible so the maximum contact-enrichment cost is predictable.

Process input rows

Use input.data when you have an existing set of data that you want to enrich. You can add more fields to each data entity, surface more entities based on the data you bring in, or both. For complete row-enrichment examples, see Agent examples.

Process exclusions

Use input.exclusion to exclude certain entries from being surfaced in the run. In the example below, we want to look for the top 10 cutest animals, but we exclude goats and pandas from the run because we already know how cute they are.

Connect data sources

The index is already available on every run. Use dataSources only to attach Exa Connect partners. Each entry selects a provider. When a property in your outputSchema references a specific source (e.g., “from Similarweb”), Exa Agent calls the matching provider tool instead of guessing from a web page.
See Exa Connect for the full list of data partners, with examples for each.

Continue from a previous run

Use previousRunId to ask follow-ups to a previous response. Each follow-up starts a new run with its own ID. previousRunId carries context into the new run; it is not reused as the new run’s ID.

Find a run ID

List recent runs and inspect their statuses:

Pricing

Costs are usage-based and priced by component:
Contact enrichment is separate from the core pricing components above: email contact enrichment is $0.02 / email, and phone number contact enrichment is $0.07 / phone number.
usage.agentComputeUnits measures model computation across the full run. Complex queries, especially ones with a large input.data field, need more reasoning steps and tool calls and consume more ACUs. See Agent limits for concurrency and rate limits.

Effort

Use effort to choose a cost and reasoning level for each run. The supported values are minimal, low, medium, high, xhigh, auto, and max; the default is auto. Fixed efforts have a predictable per-request price, while auto and beta max are metered by usage:
Agent Max is the highest-effort tier for work where completeness and thoroughness matter more than latency or cost, including large list building, deep multi-source research, and criteria that are hard to verify. It is in public beta: requests with effort: "max" must include Exa-Beta: agent-max-effort-2026-07-27. The header accepts a comma-separated list of beta tokens.
budget.maxCostDollars is an optional per-run ceiling for auto and max. It accepts $1$100; the shipped maximum is $100, though the server may configure a lower maximum. The default cap is $5 for auto and $20 for max. This is a ceiling rather than a fixed price: runs that finish early cost less. Budget is not accepted for fixed efforts.

Choosing an effort mode

Fixed effort modes work well when you want predictable per-request pricing for standard research. Use auto for variable-scope work like list building, where the number of entities can vary from request to request. Start with medium for standard single-entity research. Drop to low or minimal when cost and latency matter more than completeness. Move up to high or xhigh when the output schema is larger, fields need verification, or the task needs deeper reasoning. Use auto when you don’t know the scope ahead of time, such as list building or workflows that may return many entities. Runtime varies by query difficulty, schema complexity, and external source availability. Treat effort modes as quality/cost/runtime tradeoffs rather than strict latency guarantees.

Run with max effort

The SDK samples require an exa-py or exa-js version with Agent Max support.

Zero Data Retention

Exa Agent supports Zero Data Retention (ZDR). ZDR is enabled per team. Contact us to enable it for your account. When ZDR is enabled for your team:
  • Create runs with streaming (Accept: text/event-stream) to consume output live, or poll asynchronous runs within the retention window.
  • Run data is available while the run executes and for up to 10 minutes after it reaches a terminal state. After that window, the run cannot be retrieved.
  • previousRunId is not available.
  • Exa Connect dataSources are not available; requests that include them return a 400 error.

Next steps

What's in the index

Explore news, code, company, and people sources across the public web.

Exa Connect

Attach premium partner databases to a run.

Agent best practices

Best practices for using Exa Agent.

Agent examples

Examples of using Exa Agent.
Last modified on September 15, 2026