Skip to main content
POST
cURL

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

x-api-key
string
header
required

Pass your Exa API key in the x-api-key header. You can also authenticate with Authorization: Bearer .

Body

application/json
query
string
required

Natural-language question or instructions for the request.

Minimum string length: 1
Example:

"What is the latest valuation of SpaceX?"

stream
boolean
default:false

If true, the response is returned as a server-sent events (SSE) stream.

text
boolean
default:false

If true, returns full page text with default settings. If false, disables text return.

outputSchema
object

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

answer
required

The generated answer based on search results. Returns a string by default, or a structured object matching the provided outputSchema.

Example:

"$350 billion."

requestId
string

Unique identifier for the request.

Example:

"b5947044c4b78efa9552a7c89b306d95"

citations
object[]

Search results used to generate the answer.

costDollars
object

Endpoint-dependent estimated dollar cost breakdown for the completed request. Billing is computed from usage counters rather than this response object.