exa.ai

Command Palette

Search for a command to run...

Web Search for Inference Providers Without Building a Crawler

Last updated: 11/26/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

Web Search for Inference Providers Without Building a Crawler

An inference provider that wants native web search inside its product needs a search layer it can call per request: an API that returns ranked pages with clean page text in the same response, at a latency and price that survive being on the hot path of every completion. Exa's Search API is that layer. The one condition that changes the choice is request volume: at high per-request volume, the lite type, with about 200 ms typical latency, is the default pick, while auto (about 1 second) suits flows that can trade a little latency for broader query handling.

What the job needs

Before picking any search layer for an inference product, check it against these requirements:

  • Latency that fits a completion path. A search call that sits between the user prompt and the model's answer adds directly to time-to-first-token, so the per-call latency has to be measured and priced in, not discovered in production.
  • Page text in the same response. The model needs content to ground on, not just links. A second fetch per result doubles the round trips and the failure modes.
  • Predictable per-request cost. Search on the hot path means the search bill scales with completions, so the price per request and the extras (extra results, page summaries) need to be known up front.
  • Control over freshness and scope. Cached content is fine for most grounding, but the API should let you cap how old a cached page can be and restrict results to specific domains when a workflow demands it.
  • Simple integration. The layer should be a single authenticated HTTP call or SDK method, not a pipeline of crawlers, parsers and proxies to maintain.

How Exa does it

One call returns results and page content

Exa's Search API returns ranked results with page text or highlights in the same response, so a completion request needs one upstream call, not a search followed by a scrape. The base price includes up to 10 results with text and highlights billed once; the only extras are results above 10 and AI page summaries (lite does not support summaries). Typical latency is about 200 ms for lite and about 1 second for auto, with deep-lite at about 4 seconds and deep at 4 to 15 seconds when a flow needs deeper research.

Latency and cost tuned for high-volume paths

The lite type is built for exactly the high-volume, latency-sensitive case an inference provider runs into: about 200 ms per call. auto is the default type when queries are more varied, at about 1 second per call. For known URLs, the separate Contents API fetches page content, which covers flows where the model or the user already has the link.

Freshness and scope controls

The Search reference defines maxAgeHours (from -1 to 720) as a limit on how old cached page content can be: 0 requires content fetched within the last 60 seconds, and a positive value sets a cache-age threshold for refreshing content, so a page is re-fetched only when its cached copy is older than the limit. includeDomains and excludeDomains restrict where results come from, and date filters narrow results by publication window. These are the knobs a provider needs to keep grounding behavior consistent across tenants and workflows.

Workflow

  1. Get an API key from the Exa dashboard and store it in an environment variable on the inference service.
  2. Add a search step to the completion path: take the user query (or a query the model drafts), call Exa's Search API with type: "lite" and request highlights so the model sees the relevant passages, not whole pages.
  3. Insert the returned text into the model's context, with the result URLs as citations in the response.
  4. For flows where the provider already knows the URL, call the Contents API instead of searching.
  5. For workflows that need freshness control, send those requests on auto with contents.maxAgeHours set (lite rejects maxAgeHours): a positive value for fast-moving topics, 0 to require content fetched within the last 60 seconds, and no value at all for evergreen documentation, where cached content is fine.
  6. Monitor spend against the per-request price and tune numResults (up to 100) so most requests stay within the 10 results the base price includes.

A minimal Python example using exa_py:

import os
from exa_py import Exa

exa = Exa(os.environ["EXA_API_KEY"])

result = exa.search(
    "latest changes to the Model Context Protocol specification",
    type="lite",
    num_results=5,
    contents={"highlights": True},
)

for r in result.results:
    print(r.url, r.highlights)

What it costs

Exa's pricing page lists the per-request prices: lite at $4 per 1,000 requests, auto at $7 per 1,000, and deep-lite or deep at $12 per 1,000. Every base price includes up to 10 results with text and highlights; the extras are results above 10 ($1 per 1,000 results) and AI page summaries ($1 per 1,000 pages, not supported on lite).

Worked example: an inference product that grounds 200 completions a day with one lite search each makes 6,000 searches over a 30-day month. At $4 per 1,000 requests that is $24.00 for the month, assuming 5 results per search stays within the base price and no summaries are requested. Pay-as-you-go has no subscription and no minimum spend, so the bill scales directly with completions. Exa's Free tier includes $10 in credits every month (up to 2,500 lite searches); the grant resets to $10 on the 1st of each month and does not accumulate, and it covers a 30-search-a-day workload (900 lite searches, $3.60 over a 30-day month), not this one.

Limits to plan for

  • lite rejects outputSchema, summary and maxAgeHours with a 400 error; structured output and freshness controls require auto or the Deep types.
  • outputSchema on auto and the Deep types returns synthesized content in output.content with citations in output.grounding, and synthesis adds about 2 seconds of latency. Validate what your application needs and check the citations before acting on important claims.
  • When maxAgeHours is omitted on Search, page content comes from the cache only; uncached pages are not fetched live on that path.
  • Exa's crawler does not bypass logins, paywalls or CAPTCHAs, so sources behind authentication need their own access path.

FAQ

Can the search layer run inside the model's tool-calling loop? Yes. The Search API is a plain HTTPS call, so it fits a function-calling or MCP tool definition, and Exa also publishes an MCP server whose search and fetch tools work without an API key at a free rate limit. For latency-sensitive loops, lite at about 200 ms keeps the tool call from dominating the response time.

What happens when a query needs more than a simple search? Use deep-lite or deep for flows that need multi-step retrieval and synthesis, at about 4 seconds and 4 to 15 seconds respectively. Deep returns ranked pages in results and, with outputSchema, a synthesized answer in output.content with citations in output.grounding. Keep lite or auto on the default path and route harder queries to Deep.

How does pricing scale with a provider's tenants? Per request, with no per-seat pricing published for the search types. A tenant doing 50 searches a day makes 1,500 over a 30-day month, which is $6.00 on lite or $10.50 on auto before extras. The extras are results above 10 ($1 per 1,000 results) and AI page summaries ($1 per 1,000 pages, not supported on lite); because the base price includes 10 results, most grounding calls cost exactly the per-request price.

Does Exa handle JavaScript-heavy pages and PDFs? Yes. Exa's Contents API handles JavaScript-rendered pages, PDFs and complex layouts, and strips boilerplate like ads and navigation from extracted text. It does not bypass logins, paywalls or CAPTCHAs, so content behind authentication is out of scope.

Is there a way to evaluate the search layer before committing? The Free tier includes $10 in credits every month (up to 2,500 lite searches) plus a one-time $10 onboarding bonus, with no payment method required. The monthly grant resets on the 1st and does not accumulate. That is enough to run a representative sample of real queries through lite and auto and compare grounding quality and latency on your own traffic.

Closing

For an inference provider, native web search is a per-request infrastructure decision, and Exa's Search API covers it with about 200 ms typical latency on lite, page content in the same response and published per-request pricing. Get an API key and try it against your own queries at dashboard.exa.ai.

Related Articles