# API reference

Source: https://grounder.net/docs/api

> The base URL, how a request is authenticated, and every endpoint.

## Base URL and authentication

Everything a client needs: the base URL is `https://api.grounder.net`, and every request carries a search key as `Authorization: Bearer $GROUNDER_KEY`. Make one under [Search keys](https://grounder.net/account/keys) on your account. A key searches as your account does: the same sources and saved search choice as MCP, under the same free searches and credit. `POST /v1/search` answers a request with none as a [free search with no sign-in](https://grounder.net/docs/api/search#no-key).

An OAuth access token takes the key’s place on the search addresses only: `POST /v1/search`, `POST /v1/search/{request_id}/cited` and the [drop-in endpoints](https://grounder.net/docs/drop-in). Every other address that checks who you are, `GET /v1/account` among them, takes a search key and answers a token with 401. To get a token, start at `https://api.grounder.net/.well-known/oauth-protected-resource/v1/search`, register a public client, sign in, request `scope=search` for resource `https://api.grounder.net/v1/search`, then refresh the token as needed. A client ends a refresh token it holds at `POST https://api.grounder.net/oauth/revoke` (RFC 7009; the metadata names it as `revocation_endpoint`), and the apps you signed in are listed on your account’s [Profile](https://grounder.net/account/profile), each with Disconnect.

A key made as usual also reads your account from your terminal or agent with `GET /v1/account`. To share one key among people you don’t want to give that, a gateway like LiteLLM for one, make it search-only: under [Search keys](https://grounder.net/account/keys) choose “Search only” when you create it. A search-only key searches, calls the [drop-in endpoints](https://grounder.net/docs/drop-in), and lists `search` and `user_info` over MCP. `user_info` and `GET /v1/account` answer it which Grounder version is answering, and nothing of your account. Everything else of the account answers `403 forbidden`. An OAuth sign-in made with a search-only key stays search-only; a sign-in you do yourself, and every other key, is full.

## The same as MCP

Each MCP tool has an endpoint that does the same with a key.

| MCP tool | HTTP API |
| --- | --- |
| `search` | [`POST /v1/search`](https://grounder.net/docs/api/search) |
| `report_sources` | [`POST /v1/search/{request_id}/cited`](https://grounder.net/docs/api/search#cited) |
| `user_info` | `GET /v1/account` |

## Endpoints

- [GET / PUT `/v1/search/settings`](https://grounder.net/docs/routing#saved-search): Your saved search choice, format and user agent
- [POST `/v1/search`](https://grounder.net/docs/api/search): Search the web, or read pages
- [POST `/v1/search/{request_id}/cited`](https://grounder.net/docs/api/search#cited): Report the sources an answer cited
- [POST `/mcp`](https://grounder.net/docs/mcp): MCP server for agents
- [GET `/v1/dns-query`](https://grounder.net/docs/direct#resolver): Grounder’s DNS resolver (JSON DNS over HTTPS), no account
- [GET `/v1/x402`](https://grounder.net/docs/api/search#x402): What a search costs in USDC with x402, and where to pay
- [GET `/v1/account`](https://grounder.net/docs/api#mcp-tools): Your account, free searches and settings
- [POST `/compat/tavily/search`](https://grounder.net/docs/drop-in): Tavily request format
- [GET `/compat/brave/res/v1/web/search`](https://grounder.net/docs/drop-in): Brave request format
- [POST `/compat/claude-desktop/search`](https://grounder.net/docs/drop-in#claude-desktop): Claude Desktop’s custom web search
- [GET `/health`](https://grounder.net/status): Service status and version
