Answer
Get an LLM answer to a question informed by Exa search results. /answer performs an Exa search and uses an LLM to generate either:
- A direct answer for specific queries. (i.e. “What is the capital of France?” would return “Paris”)
- A detailed summary with citations for open-ended queries (i.e. “What is the state of ai in healthcare?” would return a summary with citations to relevant sources)
The response includes both the generated answer and the sources used to create it. The endpoint also supports streaming (as stream=True), which will return tokens as they are generated.
Alternatively, you can use the OpenAI compatible chat completions interface.
Get your Exa API key
/answer supports structured output via the outputSchema parameter. Pass a JSON Schema object and the answer will be returned as structured JSON matching your schema instead of a plain string.Authorizations
Pass your Exa API key in the x-api-key header. You can also authenticate with Authorization: Bearer .
Body
Natural-language question or instructions for the request.
1"What is the latest valuation of SpaceX?"
If true, the response is returned as a server-sent events (SSE) stream.
If true, returns full page text with default settings. If false, disables text return.
The model used to generate the answer.
exa, exa-pro, exa-research, exa-fast Additional instructions that guide generated output or agent behavior. Use this for source preferences, novelty constraints, duplication constraints, or other behavior guidance.
"Prefer official sources and avoid duplicate results."
The two-letter ISO country code of the user, e.g. US.
"US"
A JSON Schema Draft 7 specification for the desired answer structure. When provided, the answer is returned as a structured object matching the schema instead of a plain string.
Response
OK
The generated answer based on search results. Returns a string by default, or a structured object matching the provided outputSchema.
"$350 billion."
Unique identifier for the request.
"b5947044c4b78efa9552a7c89b306d95"
Search results used to generate the answer.
Endpoint-dependent estimated dollar cost breakdown for the completed request. Billing is computed from usage counters rather than this response object.