> ## Documentation Index
> Fetch the complete documentation index at: https://docs.novita.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Exa Answer

Generate an answer to a question using Exa search results, with optional citations and source text. This is a passthrough to Exa's Answer API, exposed through the Novita gateway with a platform route prefix.

To authenticate with your Novita API key, get one from the [Novita dashboard](https://novita.ai/settings/key-management). Base URL: `https://api.novita.ai`.

## Quickstart

```bash theme={"system"}
curl -X POST 'https://api.novita.ai/v3/exa/answer' \
  -H 'Authorization: Bearer <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "How tall is the Burj Khalifa?"
  }'
```

Running the quickstart above returns the following. The request returned 8 citations; three are shown here.

```json theme={"system"}
{
  "requestId": "50bd53d7599d1415761aaefea608f113",
  "answer": "The Burj Khalifa has a roof height of 828 meters (2,717 feet) [1][2][3]. When measured to the tip of its antenna, the total height is 829.8 meters (2,722 to 2,723 feet) [1][2][4].",
  "citations": [
    {
      "id": "https://en.wikipedia.org/wiki/Burj_Khalifa",
      "title": "Burj Khalifa - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Burj_Khalifa",
      "publishedDate": "2026-05-31T00:00:00.000Z"
    },
    {
      "id": "https://www.skyscrapercenter.com/building/burj-khalifa/3",
      "title": "Burj Khalifa - The Skyscraper Center",
      "url": "https://www.skyscrapercenter.com/building/burj-khalifa/3"
    },
    {
      "id": "https://www.britannica.com/topic/Burj-Khalifa",
      "title": "Burj Khalifa | Height, Architect, Top Floor, & Facts | Britannica",
      "url": "https://www.britannica.com/topic/Burj-Khalifa"
    }
  ]
}
```

## Request Headers

All endpoints require platform API authentication.

**Content-Type** `string` *required*

Use `application/json`.

**Authorization** `string` *required* (default: Bearer YOUR\_API\_KEY)

Platform API key, formatted as `Bearer YOUR_API_KEY`.

## Request Body

**query** `string` *required*

Natural-language question or instruction. Minimum length is 1.

**text** `boolean`

Whether to return source page text. Default is `false`.

**outputSchema** `object`

JSON Schema Draft 7 object for structured answer output.

**outputSchema properties**

**type** `string`

JSON Schema root type, commonly `object`.

**properties** `object`

Field definitions for the structured answer.

**required** `string[]`

Required property names.

**description** `string`

Description of the structured output to guide generation.

**additionalProperties** `boolean | object`

Whether undeclared fields are allowed, or a schema for additional fields.

## Examples

### Basic answer

```bash theme={"system"}
curl -X POST 'https://api.novita.ai/v3/exa/answer' \
  -H 'Authorization: Bearer <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "What year was the Eiffel Tower completed?",
    "text": true
  }'
```

### Structured answer

```bash theme={"system"}
curl -X POST 'https://api.novita.ai/v3/exa/answer' \
  -H 'Authorization: Bearer <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "How tall is Mount Everest and where is it located?",
    "outputSchema": {
      "type": "object",
      "properties": {
        "heightMeters": {"type": "number"},
        "country": {"type": "string"}
      },
      "required": ["heightMeters"]
    }
  }'
```

### Answer with source text

Set `text: true` to return the full source text alongside each citation, useful when you want to display or re-verify the evidence.

```bash theme={"system"}
curl -X POST 'https://api.novita.ai/v3/exa/answer' \
  -H 'Authorization: Bearer <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "What are the main causes of coral bleaching?",
    "text": true
  }'
```

### List-shaped structured answer

An `outputSchema` can return an array when you expect several items rather than a single fact.

```bash theme={"system"}
curl -X POST 'https://api.novita.ai/v3/exa/answer' \
  -H 'Authorization: Bearer <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "Which countries border Switzerland?",
    "outputSchema": {
      "type": "object",
      "properties": {
        "countries": {
          "type": "array",
          "items": {"type": "string"}
        }
      },
      "required": ["countries"]
    }
  }'
```

## Response

**requestId** `string`

Unique request identifier.

**answer** `string | object`

Generated answer. It can be structured according to the `outputSchema` provided in the request.

**citations** `object[]`

Search results used to generate the answer.

**citation properties**

**title** `string`

Source title.

**url** `string`

Source URL.

**publishedDate** `string`

Published date when available.

**author** `string`

Author when available.

**id** `string`

Exa document ID.

**text** `string`

Source text when requested.

## Errors

Errors are returned as a JSON envelope with `code`, `reason`, `message`, and `metadata`. The platform validates and authenticates the request before forwarding it to Exa, so some errors originate at the platform and others are surfaced from upstream.

| Status | `reason` | Meaning |
| - | - | - |
| `400` | `MISSING_API_KEY` | The `Authorization` header is absent. |
| `400` | `INVALID_REQUEST_BODY` | The body failed validation, such as a missing or malformed `query`. |
| `403` | `INVALID_API_KEY` | The API key is invalid or not authorized. |
| `404` | `PATH_NOT_FOUND` | The route does not exist. |
| `429` | `RATE_LIMIT_EXCEEDED` | Too many requests. Slow down and retry with backoff. |
| `500` | `TASK_FAILED` | Internal or upstream provider failure. Transient failures are safe to retry. |
| `503` | `SERVICE_UNAVAILABLE` | The service is temporarily overloaded or down. Retry with backoff. |

For validation failures, `message` is a JSON-encoded string carrying the detailed `error` and `tag`. The examples below show that inner detail decoded for readability.

```json 200 theme={"system"}
{
  "requestId": "string",
  "answer": "string",
  "citations": [
    {
      "id": "string",
      "title": "string",
      "url": "string",
      "publishedDate": "string",
      "author": "string",
      "text": "string"
    }
  ]
}
```

```json 400 theme={"system"}
{
  "code": 400,
  "reason": "INVALID_REQUEST_BODY",
  "message": "Invalid request body | Validation error: expected string, received undefined at \"query\"",
  "metadata": {
    "trace_id": "0748a32faccde3d924752336fd5c1a31"
  }
}
```

```json 403 theme={"system"}
{
  "code": 403,
  "reason": "INVALID_API_KEY",
  "message": "invalid api-key",
  "metadata": {}
}
```

```json 404 theme={"system"}
{
  "code": 404,
  "reason": "PATH_NOT_FOUND",
  "message": "path not found for model",
  "metadata": {
    "trace_id": "3c3433f0cb475a04f9a4969b8c6ed903"
  }
}
```

```json 429 theme={"system"}
{
  "code": 429,
  "reason": "RATE_LIMIT_EXCEEDED",
  "message": "rate limit exceeded, please retry later",
  "metadata": {
    "trace_id": "5f2a9c7e41b8d0a36e9f4c2b7d81a0e5"
  }
}
```

```json 500 theme={"system"}
{
  "code": 500,
  "reason": "TASK_FAILED",
  "message": "upstream provider temporarily unavailable, please retry",
  "metadata": {
    "trace_id": "8846379c692d7218173460afe95640f1"
  }
}
```

```json 503 theme={"system"}
{
  "code": 503,
  "reason": "SERVICE_UNAVAILABLE",
  "message": "service temporarily unavailable",
  "metadata": {
    "trace_id": "b7e3f1a9d24c05e8f63a1b9c7e05d2f4"
  }
}
```

## Notes

* All request bodies are JSON.
* Extra Exa parameters not listed here may be passed through.
* Response shapes can vary depending on request options.
* This document intentionally omits billing-related fields.

## References

For more details, see the [Exa Answer API reference](https://exa.ai/docs/reference/answer).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.