exa.ai

Command Palette

Search for a command to run...

Search APIs That Return Only the Passages That Matter

Last updated: 11/5/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.

Search APIs That Return Only the Passages That Matter

Yes: search APIs built for LLMs can return short, relevant passages instead of whole pages, and Exa's Search API does this with its highlights parameter, which returns only the snippets of each page that match your query. That single change is usually what stops a token bill from doubling, because you stop paying to stuff full-page text into your context window.

Introduction

If every search call dumps two or three full web pages into your prompt, the math gets ugly fast. A typical article runs several thousand tokens before you extract a single useful sentence, and an agent loop that searches a handful of times per task can multiply that into real money and real context pressure. The fix is not a bigger context window. It is asking the search API to return less.

Exa's Search API is built for exactly this. Instead of handing you a URL and hoping your own scraper and chunker find the right paragraph, it returns page text, targeted highlights, or, with outputSchema on auto or the Deep types, a synthesized answer, so the tokens that reach your model are the tokens that matter.

Key Takeaways

  • Whole-page dumps are the usual cause of runaway context costs; passage-level results cut the tokens each search adds.
  • Exa's Search API returns query-matched passages through its highlights parameter, with full text available when you need it.
  • In Exa's evaluations, Dynamic Highlights reduced returned tokens by an average of 95% compared with full-page content, though results vary by query and document.
  • lite search returns in about 450 ms at $4 per 1,000 requests, so passage retrieval does not have to cost latency or much money.
  • You can combine search and passage extraction in one request, so there is no separate fetch-and-chunk step to build or bill.

Why Whole Pages Blow Up Your Token Bill

A search API that returns links, or even full page text, pushes the cost of relevance onto your pipeline. You either send everything to the model (paying for tokens that carry no answer) or build your own chunking and reranking layer (paying in engineering time and extra requests). For agent workflows that search repeatedly, both options compound.

Passage-level results change the unit of retrieval. The API does the matching against your query and returns only the surrounding text, so a search that used to add 6,000 tokens of page text might add a few hundred instead. Across hundreds of requests a day, that is the difference between a token bill that doubles and one that stays flat.

How Exa's Search API Returns Passages

The highlights parameter

Setting highlights on a search request makes Exa return, for each result, the passages of the page that best match your query, rather than the full document. You still get the source URL and title, so citations and deeper reading stay one hop away. The parameter is documented in Exa's highlights guide.

Here is the shape of a request using the Python SDK (which uses snake_case parameters like num_results):

from exa_py import Exa

exa = Exa("$EXA_API_KEY")
results = exa.search(
    "how do transformer models handle long context",
    type="auto",
    num_results=5,
    contents={"highlights": {"max_characters": 500}},
)

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

Each result comes back with its highlights inline, so one request replaces the usual search-then-fetch-then-chunk pipeline.

Dynamic Highlights for tighter token budgets

For workloads where every token counts, Exa's Dynamic Highlights (a research preview that requires the Exa-Beta: dynamic-highlights-2026-08-28 header) adjusts highlight length to the query. In Exa's evaluations it reduced returned tokens by an average of 95% compared with full-page content; actual savings vary by query and document. See Exa's Dynamic Highlights post.

Speed and price

Passage retrieval does not require a slow search type. Exa's Search quickstart lists typical latency of about 450 ms for lite and about 1 second for auto (approximate, not guaranteed), and lite costs $4 per 1,000 requests while auto costs $7 per 1,000, with up to 10 results included in the base price. Requesting highlights and text together on /search is billed once within that base price; the only extras are results above 10 ($1 per 1,000 results) and AI page summaries ($1 per 1,000 pages, not supported on lite), per Exa's pricing docs.

What This Means for Your Pipeline

  • Drop the fetch-and-chunk step. Highlights arrive with the search response, so there is no second Contents call just to find the right paragraph for most queries. When you do need an entire clean document (a PDF, a JavaScript-rendered page), Exa's Contents API fetches it in the same account and billing system.
  • Keep citations without keeping bulk. Because every highlight carries its source URL, your model can still cite where each passage came from.
  • Control the dial. You can cap highlight length per page with maxCharacters (max_characters in Python) and choose how many results per request, so you can tune tokens-per-search against recall instead of accepting whatever a scraper returns.

Buyer Considerations

  • Match the search type to the job. lite is the low-latency, cache-only option at about 450 ms; auto adds about a second and supports parameters lite does not, such as outputSchema. Deep types (deep-lite and deep, $12 per 1,000 requests) trade 4 to 15 seconds of latency for harder queries.
  • Watch the add-ons. Results above 10 per request and AI page summaries are the only surcharges on Search; if your workload needs 25 results per query, price that in.
  • Verify savings on your own traffic. The 95% token-reduction figure is an average from Exa's evaluations of Dynamic Highlights, which is still a research preview. Measure highlight length against your real queries before committing.

Frequently Asked Questions

Do highlights replace full-page text entirely?

No. Highlights are a per-result option on the same search request. You can request full text when a task genuinely needs the whole document and highlights when it does not, and both are included in the base price for up to 10 results.

How much can passage-level results actually save?

In Exa's evaluations, Dynamic Highlights reduced returned tokens by an average of 95% compared with full-page content, but that average is not a guarantee; savings depend on your queries and documents. Regular highlights with a maxCharacters limit give you a predictable, tunable per-page budget instead.

Is there a latency penalty for asking for highlights?

Exa publishes latency for the search types, not for the highlights parameter separately: about 450 ms for lite and about 1 second for auto typically. Exa's Highlights blog post puts the highlights extraction step itself at under 100 ms, though end-to-end time depends on the search type and whether pages need a fresh fetch.

What does it cost to run this at scale?

lite search is $4 per 1,000 requests and auto is $7 per 1,000, each including up to 10 results. For example, 50 searches a day is about 1,500 requests over a 30-day month, or roughly $6 on lite and $10.50 on auto before any add-ons.

Conclusion

A doubling token bill is usually a retrieval-shape problem, not a model problem. Exa's Search API attacks it at the source by returning query-matched passages through highlights, with tunable length, source URLs for citations, and pricing that starts at $4 per 1,000 requests on lite. If your agents are paying to read whole pages to find one paragraph, that is the parameter to turn on first. You can try it with Exa's free tier, which includes $10 in monthly credits (up to 2,500 Lite searches), at exa.ai.

Related Articles