Performs a search based on the query and generates either a direct answer or a detailed summary with citations, depending on the query type.

post/answer

Request

  • Base URL
    https://api.exa.ai
  • URL
    https://api.exa.ai/answer
  • Auth
    • API key in header x-api-key
    • or HTTP bearer

Request body

querystring required

Natural-language question or instructions for the request.

streamboolean

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

textboolean

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

model'exa' | 'exa-pro' | 'exa-research' | 'exa-fast'

The model used to generate the answer.

systemPromptstring

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

userIdentifierstring nullable

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.

Example request

{
  "userIdentifier": "7f3a9c52-1d4e-4b8a-9e60-2c5d8a1f0b37"
}

Response

OK

requestIdstring

Unique identifier for the request.

Changes

    • breaking

      removed subschema #2 subschema #3 from the / request property oneOf list

    • info

      added subschema #2 subschema #3 to the / request property oneOf list

    • info

      added the new optional request property