---
title: "Answer"
method: POST
path: "/answer"
---

# Answer

`POST /answer`

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

## Request body

- AnswerRequest
  - `query` string, required — Natural-language question or instructions for the request.
  - `stream` boolean — If true, the response is returned as a server-sent events (SSE) stream.
  - `text` boolean — If true, returns full page text with default settings. If false, disables text return.
  - `outputSchema` object — A [JSON Schema Draft 7](https://json-schema.org/draft-07) specification for the desired answer structure. When provided, the answer is returned as a structured object matching the schema instead of a plain string.
    - `type` string — The root schema type (typically "object").
    - `properties` object — An object where each key is a property name and each value is a JSON Schema describing that property (with `type`, `description`, etc).
    - `required` string[] — List of required property names.
    - `description` string — A description of the schema.
    - `additionalProperties` boolean — Whether to allow properties not listed in `properties`.

## Response `200`

OK

- AnswerResponse
  - `requestId` string — Unique identifier for the request.
  - `answer` union, required — The generated answer based on search results. Returns a string by default, or a structured object matching the provided outputSchema.
    - string
    - object
  - `citations` object[] — Search results used to generate the answer.
    - `title` string, required — The title of the search result.
    - `url` string, uri, required — The URL of the search result.
    - `publishedDate` string, date-time — An estimate of the creation date, from parsing HTML content. Format is YYYY-MM-DD.
    - `author` string, nullable — If available, the author of the content.
    - `id` string — The temporary ID for the document. Useful for the /contents endpoint.
    - `image` string, uri — The URL of an image associated with the search result, if available.
    - `favicon` string, uri — The URL of the favicon for the search result's domain.
    - `text` string — The full text content of each source. Only present when text contents are requested.
  - `costDollars` CostDollarsOutput — Endpoint-dependent estimated dollar cost breakdown for the completed request. Billing is computed from usage counters rather than this response object.
    - `total` number, float — Estimated total dollar cost for the completed request. This response value is not an invoice record.
    - `search` object — Endpoint-dependent estimated search cost breakdown by retrieval mode. Instant, fast, and auto search responses may include neural search cost. Deep search modes may be reflected only in total.
      - `neural` number, float — Cost of neural search operations.
      - `keyword` number, float — Cost of keyword search operations.
    - `summary` number, float — Cost of synthesized summary generation for search requests.
    - `contents` object — Estimated cost breakdown for standalone content retrieval (text, highlights, and summaries billed outside the bundled search price).
      - `text` number, float — Cost of text extraction.
      - `highlights` number, float — Cost of highlight extraction.
      - `summary` number, float — Cost of per-result summary generation.

## Other responses

- `400` — The request body or query parameters failed validation.
- `401` — The API key is missing or invalid.
- `402` — The team is out of credits or a spending budget has been exceeded.
- `429` — A rate limit was exceeded.
- `500` — An unexpected error occurred while processing the request.

## Changes

- **2026-08-27** `67abccbd77b6` — 1 warning
  - deleted the `header` request parameter `Exa-Version`
- **2026-08-26** `bcc51991b48a` — 1 info
  - added the new optional `header` request parameter `Exa-Version`
- **2026-08-25** `659cf16a7325` — 11 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `402`
  - added the non-success response with the status `429`
  - …7 more

[Change history](https://skmtc.dev/exa/apis/exa-public-api/changes/answer/post.md)

---

[API](https://skmtc.dev/exa/apis/exa-public-api.md) · [All operations](https://skmtc.dev/exa/apis/exa-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/exa/exa-public-api/revisions/67abccbd77b6/schema)
