Skip to main content
cURL

Get your Exa API key

Create a key in the dashboard. New accounts start with free credits.
/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
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.

model
enum<string>
default:exa

The model used to generate the answer.

Available options:
exa,
exa-pro,
exa-research,
exa-fast
systemPrompt
string

Additional instructions that guide generated output or agent behavior. Use this for source preferences, novelty constraints, duplication constraints, or other behavior guidance.

userLocation

The end user's location, as a two-letter ISO 3166-1 country code (e.g. US) or an object with country, a latitude and longitude pair, or both. The country localizes results. Coordinates are used only for queries that name no place but depend on where the user is, such as "coffee near me". They do not set a country, so send country with them to localize results. Send only the precision your use case needs.

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.

userIdentifier
string | null

An opaque ID your platform assigns to the end user this request is made for, such as a UUID. Lets Exa attribute usage to that end user rather than your whole team. Must not contain personal information such as an email address, phone number, username, or name. Hash such values before sending them. 1 to 64 characters: letters, digits, underscores, and hyphens. Retained even when your team has Zero Data Retention enabled. Does not affect results.

Required string length: 1 - 64
Pattern: ^[A-Za-z0-9_-]+$
Example:

"7f3a9c52-1d4e-4b8a-9e60-2c5d8a1f0b37"

Response

OK

answer
required

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

requestId
string

Unique identifier for the request.

citations
object[]

Search results used to generate the answer.

costDollars
object

Estimated dollar cost of the request. Which fields appear depends on the endpoint.