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

# Brave Search

Fronts the vertical endpoints of [Brave Search](https://brave.com/search/api/), mounting them at `/brave`; the gateway supplies Brave's `/res/v1` base path itself:

```
GET /brave/<vertical>/search   → https://api.search.brave.com/res/v1/<vertical>/search
```

Only `GET` is mounted. Controls such as `q`, `count`, and `country` ride in the query string, which is relayed to Brave without modification.

## Verticals

Exactly these verticals are admitted — anything else is refused with the gateway's own `404` and never reaches Brave.

| Vertical                                                                 | Upstream                                                |
| ------------------------------------------------------------------------ | ------------------------------------------------------- |
| `web`, `images`, `videos`, `news`, `suggest`, `spellcheck`, `summarizer` | `https://api.search.brave.com/res/v1/<vertical>/search` |

The AI "Answers" endpoints on Brave's side (`/chat/completions`, `/llm/context`) are **intentionally left unexposed**.

## Credential handling

* **`X-Subscription-Token` is injected**; a client-supplied value is overwritten.
* **`Authorization` is dropped** before the request goes upstream — your gateway token is meaningless to Brave.

## Examples

#### Web search

```bash
curl "$GATEWAY/brave/web/search?q=cloudflare+workers" \
  -H "Authorization: Bearer $TOKEN"
```

#### News search

```bash
curl "$GATEWAY/brave/news/search?q=cloudflare&count=10" \
  -H "Authorization: Bearer $TOKEN"
```

Responses arrive as Brave's JSON, untouched. Field-level request and response detail lives in [Brave Search's documentation](https://api-dashboard.search.brave.com/app/documentation); the gateway modifies neither.