---
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.

---

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