Build With Exa
Build applications and agents with Exa's API: search, contents extraction, answer, Agent API, monitors, websets, OpenAI-compatible endpoints, and exa-py/exa-js SDKs. Use when choosing Exa endpoints, writing Exa API calls, integrating semantic web search or research into products, or debugging Exa request shapes.
- Skill ID
- exa-labs/agent-skills/build-with-exa
- Publisher
- exa-labs
- Repository
- agent-skills
- Installs
- 0
- Files
- 14
- Synced
- Sep 23, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
exa-labs/agent-skills/build-with-exaInstalls these files- SKILL.md
- references/agent.md
- references/answer.md
- references/common-mistakes.md
- references/contents.md
- references/http-requests.md
- references/migrate-websets-to-agent.md
- references/models-and-modes.md
- references/monitors.md
- references/openai-compat.md
- references/prompting-and-patterns.md
- references/sdks.md
- references/search.md
- references/snapshot.md
What this skill tells the agent
Build with Exa
Scope
Included by default:
- Core retrieval APIs: search endpoint, contents endpoint, answer endpoint
- Long-running research workflows: Agent API (
/agent) - Async and recurring workflows: Monitors API
- Legacy surface: Websets API (existing integrations only; new collection-building work uses the Agent API)
- SDK guidance: Python
exa-py, TypeScriptexa-js
Note on data retention:/search,/answer, and/agent/offer Zero Data Retention (ZDR). Websets and Monitors are not ZDR. If a use case requires ZDR, stay on the ZDR surfaces or contact Exa.
Installation
# Python
pip install exa-py
# TypeScript / JavaScript
npm install exa-jsInstall the latest SDK release with the package manager so it resolves the latest release and all SDK surfaces will be available.
Authentication
export EXA_API_KEY="your_api_key_here"Exa accepts either the x-api-key header or Authorization: Bearer <key>.
The recommended Exa search request is the query plus token-efficient content extraction, and nothing else. Content extraction is a recommendation, not a server default: omit contents and results carry only metadata (title, URL, dates), no page content.
{
"query": "latest developments in LLMs",
"type": "auto",
"contents": { "highlights": true }
}Every other request field is gated: add it only when the user's task explicitly requires it. Do not restate server defaults, and do not add controls because they seem plausibly useful. In particular:
typedefaults toauto; statingtype: "auto"explicitly is fine, but do not send another mode unless the task requires it (for example a latency-critical UX or deep synthesis).numResultsdefaults to 10; omitnumResultsunless the task requires a different number of results. Set it only as an intentional product decision, not as boilerplate.- Omit
category. Use it only when the user explicitly asks for category-constrained retrieval. includeDomainsandexcludeDomainsshould be set only when the user explicitly requests a hard allowlist or blocklist and supplies or approves its contents. Express source preferences through query phrasing orsystemPromptinstead.maxAgeHoursshould be set only when extracted page content must be current. It caps cache age before a live crawl; it is not a publication-recency filter.- For "recent stories" tasks, put the recency in the query ("latest", "recent").
startPublishedDate/endPublishedDateare hard filters that drop undated and misdated pages; add them only when the task states a bounded window that must be enforced ("from the last seven days", "published in 2026"). Do not reach formaxAgeHours. highlightsshould be set totrueby default for all tasks unless otherwise specified. Do not addmaxCharactersor other highlight options without an explicit budget requirement in the task.
API Decision Workflow
Before picking an endpoint, decide which workflow shape fits:
- Raw web content for your own LLM or agent: use
/searchwith the recommended request above - A specific output shape, or fields that have to be extracted or synthesized from the pages: use
/searchand addoutputSchema(andsystemPromptif behavior guidance is needed). The user does not have to say "JSON" or "schema": "the funding amount each article reports", "name, title, and company for each person", or a field the result must carry that result metadata only sometimes has (a required author) are all structured-output requests. Fields every result already carries (title, URL, published date) are not: "10 articles with title and URL" is the recommended request withnumResults. A compact schema (author and URL per article) stays onauto;type: "deep"when the schema is wide or its fields take more than one search to fill, since it runs several. See Structured Output inreferences/search.md. - Long-running multi-step research, list-building, or enrichment with structured output: use the Agent API (
/agent), with the sameoutputSchemarule for its fields
Default to the search endpoint. Use the search endpoint (/search) for most new integrations, then move to a more specialized Exa surface only when the task shape clearly calls for it.
- Need general semantic web retrieval, synthesized output, or content extraction from search results: use the search endpoint (
/search) - Already know the URLs and need clean page extraction or freshness controls: use the contents endpoint (
/contents) - Need pages related to a known seed URL: use the search endpoint (
/search) with a query derived from the page (for example title, topic, or text from/contents) - Need a grounded answer with citations and no LLM of your own doing generation: use the answer endpoint (
/answer). If the product already has a chat LLM, give it/searchas a tool instead. - Need OpenAI SDK drop-in compatibility for chat or responses clients: use the OpenAI-compatible endpoints (
/chat/completions,/responses) - Need asynchronous multi-step research, list-building, enrichment, or follow-up questions over prior research: use the Agent API (
/agent) - Need scheduled recurring search with webhook delivery: use the Monitors API (
/monitors) - Maintaining an existing Websets integration: see the migration guide (
references/migrate-websets-to-agent.md) and transition to the Agent API (references/agent.md). Do not use Websets for new work; use the Agent API instead. - Need page content as it was at a past datetime (backtesting agents, reproducible evals, comparing earlier versions of docs, pricing pages, policies, or filings): use Exa Snapshot, the
snapshotAsOffield on/contents(top level) or/search(insidecontents). Seereferences/snapshot.md.
Quick Start
For more complete examples, see the relevant reference file in the table below.
Python (/search):
from exa_py import Exa
exa = Exa(api_key="YOUR_EXA_API_KEY")
result = exa.search(
"latest developments in LLMs",
type="auto",
contents={"highlights": True}
)
for item in result.results:
print(item.title, item.url)TypeScript (/search):
import Exa from "exa-js";
const exa = new Exa();
const result = await exa.search("latest developments in LLMs", {
type: "auto",
contents: { highlights: true }
});
for (const item of result.results) {
console.log(item.title, item.url);
}Raw HTTP (/search):
curl -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "x-api-key: $EXA_API_KEY" \
-d '{
"query": "latest developments in LLMs",
"type": "auto",
"contents": {
"highlights": true
}
}'Critical Pitfalls
- Do not decorate the recommended request without reason. Adding
category, domain filters, boilerplatenumResults, or freshness controls without an explicit task requirement is the most common integration mistake. - Do not answer an extraction request with a bare search. A field that has to come out of the page, or a metadata field the user requires on every result, goes in
outputSchema; keep/drop rules go insystemPrompt;queryis retrieval intent only. If a clause of the query saysonly,include,exclude,drop, orreturn, it is in the wrong field. Do not addoutputSchemafor fields every result already carries (title, URL, published date). - On the search endpoint,
text,highlights, andsummarybelong insidecontents, not at the top level. - On the contents endpoint,
text,highlights, andsummaryare top-level fields, not nested insidecontents. - Pick one of
highlights,text, orsummary. Do not stack them.summaryrequires an explicit user request for Exa-side per-result synthesis.
More from exa-labs
Use this skill in a project
Open any RiverX project, search the Skills panel for exa-labs/agent-skills/build-with-exa, and install it in one click.
