> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.auxiliar.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.auxiliar.ai/_mcp/server.

# Exa

Proxies [Exa](https://exa.ai)'s neural-search API. The gateway exposes Exa's sibling endpoints under `/exa`, all on the single host `api.exa.ai`:

```
POST /exa/<endpoint>   → https://api.exa.ai/<endpoint>
```

`POST` only. Every control travels in the JSON body and is forwarded unchanged.

## Endpoints

The gateway accepts exactly this whitelist; any other subpath returns the gateway's `404` without reaching Exa.

| Endpoint      | Purpose                         |
| ------------- | ------------------------------- |
| `search`      | Neural / keyword web search     |
| `contents`    | Fetch contents for result URLs  |
| `findSimilar` | Find pages similar to a URL     |
| `answer`      | Generate an answer with sources |

Exa's async `/research` API is **deliberately not exposed**.

## What the gateway injects and strips

Exa accepts its key as **either** an `x-api-key` header **or** an `Authorization: Bearer` token. The gateway injects the header and drops the bearer, foreclosing both channels:

* **The `x-api-key` header is injected**, overwriting any client-supplied one.
* **The `Authorization` header is stripped** before forwarding — this also removes Exa's second auth channel, so a client can't smuggle a key past via `Authorization`.

## Examples

```bash
curl -X POST "$GATEWAY/exa/search" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "best neural search papers", "numResults": 5}'
```

```bash
curl -X POST "$GATEWAY/exa/answer" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "What is a vector database?"}'
```

The response is Exa's JSON, returned unchanged. For request and response fields, follow [Exa's documentation](https://docs.exa.ai) — the gateway does not alter them.