# Connect an agent

There are two ways in. MCP is the main one: your agent calls Voxoria as a set of tools. The [REST API](/docs/api) is the alternative for your own code.

Browsing the catalog needs no sign-in. Everything else needs your Voxoria account, connected with OAuth or an API key. See [Account and API key](/docs/get-started) for how to create a key. The examples read it from the `VOXORIA_API_KEY` environment variable, so the secret stays out of your config files.

## Connect over MCP

The server address is `https://mcp.voxoria.ai` and the transport is streamable HTTP. Connect with OAuth, or send your API key in the header `Authorization: Bearer <key>`.

### Sign in with OAuth

Clients that support OAuth, such as Claude, can connect without a key. Add `https://mcp.voxoria.ai` as a custom connector. When a tool needs your account, the client opens Voxoria in your browser. Sign in, pick the workspace and the scope, and approve. You need an admin role in the workspace to approve.

The connection acts as you, and never does more than your current role allows. If your role drops to viewer, the connection becomes read-only. If you leave the workspace, it stops working.

Every connection is listed on the **MCP** page in the portal. Revoke one there and the client is refused from its next request.

### Claude Code

```bash
claude mcp add --transport http voxoria https://mcp.voxoria.ai
```

Then run `/mcp` in Claude Code and sign in with OAuth.

For headless use, without the browser sign-in, send your API key:

```bash
claude mcp add --transport http voxoria https://mcp.voxoria.ai \
  --header "Authorization: Bearer $VOXORIA_API_KEY"
```

Your shell fills in the key when you run the command.

### Cursor

Add the server to `~/.cursor/mcp.json`, or to `.cursor/mcp.json` in a project:

```json
{
  "mcpServers": {
    "voxoria": {
      "url": "https://mcp.voxoria.ai"
    }
  }
}
```

Then connect it in Cursor's MCP settings and sign in with OAuth.

If Cursor can't sign in with OAuth, send your API key:

```json
{
  "mcpServers": {
    "voxoria": {
      "url": "https://mcp.voxoria.ai",
      "headers": {
        "Authorization": "Bearer ${env:VOXORIA_API_KEY}"
      }
    }
  }
}
```

### VS Code

Add the server to `.vscode/mcp.json` in a project:

```json
{
  "servers": {
    "voxoria": {
      "type": "http",
      "url": "https://mcp.voxoria.ai"
    }
  }
}
```

VS Code signs in with OAuth when it first connects.

### Codex

Add the server to `~/.codex/config.toml`:

```toml
[mcp_servers.voxoria]
url = "https://mcp.voxoria.ai"
bearer_token_env_var = "VOXORIA_API_KEY"
```

### Other clients

Any client that speaks MCP over streamable HTTP can connect. Give it the address `https://mcp.voxoria.ai`, and either let it sign in with OAuth or give it the header `Authorization: Bearer <key>`.

## Browse without signing in, call when connected

Without a key or OAuth, an agent can browse the catalog: `search_tools`, `list_tools` and `get_tool`. Every other tool is refused with HTTP 401, which tells an OAuth client to sign you in. A wrong, expired or revoked key or token is refused with HTTP 401 too.

Calling a tool and labelling a call need the **All endpoints** scope. A read-only key or connection can use every tool except `call_tool` and `label_call`.

## What an agent can do over MCP

- `search_tools(query, platform?, category?, limit?)`: find tools by keyword, best match first.
- `list_tools(platform?, category?, callable?)`: browse the whole catalog.
- `get_tool(tool)`: one tool's input and output JSON Schemas, and each provider's price.
- `quote_tool(tool, input, provider?, require?)`: price a call before making it. Free.
- `call_tool(tool, input, provider?, require?, idempotency_key?, fields?, max_items?, reuse_within?, label?, wait?)`: call a tool. A call draws on your balance.
- `get_balance()`: read your balance, and how much of it new calls can draw on.
- `list_calls(limit?, cursor?, tool?, status?, input?, provider?, require?, label?)`: list past calls, newest first, without their output.
- `get_call(call_id, fields?, max_items?, wait?)`: read one call, with its output. `wait` waits for a call still running.
- `label_call(call_id, label)`: name a call, or clear its name with `null`. Free.
- `whoami()`: see which workspace the connection acts for, and its `credential`: the API key or OAuth connection, with its `kind` and current `scope`.
- `send_feedback(kind, message, call_id?, tool?)`: tell us about a missing tool, a wrong result or another problem. Free.

Live tools cover Google (search results, news, maps and reviews, shopping, images and video, keywords, AI Overviews and AI Mode), the content of any web page, and posts on X. The [catalog](/catalog) marks which tools are live; the rest, and scheduled checks, are not open yet.

## Call a tool over MCP

Call `get_tool` first. Build the call's `input` from its `input_schema`.

You are charged only when a call succeeds: the call's price, shown in `cost`. The [catalog](/catalog) lists each tool's price. A failed call is not charged. See [Billing](/docs/billing).

### Know the price first

Call `quote_tool` with the same `tool`, `input`, `provider` and `require` you would send to `call_tool`. It names the `provider` that would serve the call and its `cost`. It also gives `max_cost`: the most the call can cost if a fallback provider serves it. Your balance must cover `max_cost` for the call to run.

A quote is free. No provider is called and nothing is recorded. An unknown tool, invalid input, or a `provider` or `require` the call would refuse gets the same error. A quote ignores your balance and takes no idempotency key. Any key or connection can quote, read-only and test keys included.

### Keep the output small

A tool can return more than your agent needs. Two arguments shape what comes back:

- `fields`: paths from the root of the output. `results.title` keeps each row's `title`.
- `max_items`: the most rows to return from each list.

They are free. They never change the cost or what is stored. `get_call` without them returns the whole output.

### Slow tools

Some providers take a minute or more to answer. A call waits up to `wait` seconds for its result: 25 by default, anything from 0 to 50. Most calls finish well inside that.

A call still running when the wait is up comes back with `status: "pending"`. It is not an error, and the call goes on running. Read its result with `get_call`, passing its `id` and a `wait`. Repeat while the status is `pending`.

You are charged only if the call succeeds, as with any other call. A call is never cut short because your agent stopped waiting.

Over REST, a call still running answers 202 with the pending call and a `Location` header. Read it from `GET /v1/calls/{call_id}?wait=50`:

```bash
curl "https://api.voxoria.ai/v1/calls/$CALL_ID?wait=50" \
  -H "Authorization: Bearer $VOXORIA_API_KEY"
```

### Read a call back

If a connection drops before your agent has the answer, the call may still have finished. Find it with `list_calls`, then read it with `get_call`. An error result names its `call_id` when the call was recorded.

When we are too busy to return a result, a call that ran answers with the code `CALL_RESULT_DEFERRED` and its `call_id` (503 over REST, with a `Location` header). The call ran and was charged as usual. Read it with `get_call`, or `GET /v1/calls/{call_id}`. Do not call again: that makes, and charges, a new call, unless you send the same idempotency key.

## Use a result again

We keep the output of every call with no time limit. Reading it again is free, so an agent never needs to pay twice for the same data.

### Reuse a recent result

Send `reuse_within` with a call, in seconds, up to 30 days. If your workspace already has a successful call with the same tool, `input`, `provider` and `require` from within that window, you get the newest one back:

- `reused` is `true`.
- `id` and `cost` are the earlier call's.
- No provider is called, you are not charged, and no new call is recorded.

With no match, the call runs as usual. A reuse needs the same key or connection as a call. An idempotency key is checked first: a retry with a key gets its own call back.

### Find a past call

`list_calls` and `GET /v1/calls` take the request you made. Pass `tool` and `input`, plus `provider` and `require` if you sent them. You get the calls of exactly that request, matched as `reuse_within` matches them. Over REST, send `input` as URL-encoded JSON:

```bash
curl -G https://api.voxoria.ai/v1/calls \
  -H "Authorization: Bearer $VOXORIA_API_KEY" \
  --data-urlencode "tool=google.serp.organic" \
  --data-urlencode 'input={"query": "crm for small teams", "country": "gb"}'
```

### Label a call

A label is a name you give a call, up to 100 characters. Send `label` with the call, or set it later with `label_call` or `PATCH /v1/calls/{call_id}`. Send `null` to clear it. Filter with `label` to list the calls that carry it. Labels need not be unique. A reused or replayed call keeps its own label.

## Which provider serves a call

A tool can have more than one provider. Voxoria tries the cheapest first. If that provider fails, it tries the next, until one answers or none is left. You are charged only for the provider that served the call, and the response names it in `provider`.

To use one provider only, send its name as `provider` in the call. Voxoria then tries that provider alone.

## Retry a call safely

A connection can drop after a call has been charged and before your agent has the answer. If the agent then sends the call again, that is a second call and a second charge. To avoid that, send an idempotency key with the call.

Over MCP, pass it as `idempotency_key` to `call_tool`. Over REST, send it as the `Idempotency-Key` header:

```bash
curl https://api.voxoria.ai/v1/tools/google.serp.organic/calls \
  -H "Authorization: Bearer $VOXORIA_API_KEY" \
  -H "Idempotency-Key: weekly-report-2026-10-12-step-3" \
  -H "Content-Type: application/json" \
  -d '{"input": {"query": "crm for small teams", "country": "gb"}}'
```

The key is any text you choose, up to 128 printable ASCII characters. Use one key for one call, and send the same key each time you retry it.

- **The first call succeeded.** A retry within 24 hours returns that call. No provider is called and you are not charged again. The `cost` in the response is what the first call cost. Over REST, the response carries the header `Idempotent-Replayed: true`.
- **The first call failed.** Its key is free again, so a retry makes a new call.
- **The first call is still running.** A retry waits for that call and returns it. It does not start a second call. If the call is still running when the wait is up, the retry returns it pending (202 over REST). If the call was cut off on our side, we close it within 30 minutes and the key is free again.
- **The key comes with a different request.** A key belongs to the tool and input it was first sent with. Anything else is refused with the code `IDEMPOTENCY_KEY_REUSED` (422 over REST).

Without a key, every request is a new call, even when two requests are identical. That is deliberate: asking twice is how you get fresh results.

## Errors

Over MCP, a failed tool returns an error result with a `code` and a `detail`. Invalid input adds a list of `errors`, one per field. The body is the same as the REST API's.

Over REST:

- **401**: the key is missing, wrong or revoked.
- **403**: the key's scope does not allow the endpoint.
- **429**: too many requests. See [Rate limits](#rate-limits).

## Rate limits

- **With a key**: 600 requests a minute per API key, REST and MCP together.
- **With OAuth**: 600 requests a minute per connection.
- **Without either**: 60 requests a minute per IP address.

Over the limit, REST answers 429 with a `Retry-After` header. MCP returns an error result with the code `RATE_LIMITED`, and `detail` says when to retry.

Providers have rate limits of their own. When every provider that could serve a call refuses it for one, the call fails with the code `PROVIDER_RATE_LIMITED` and is not charged. REST answers 429 with a `Retry-After` header; over MCP, `detail` says when to retry.

## Over REST

Send your API key as a bearer token. The REST API takes API keys only, not OAuth tokens.

```bash
curl https://api.voxoria.ai/v1/ping \
  -H "Authorization: Bearer $VOXORIA_API_KEY"
```

The [REST API reference](/docs/api) lists every endpoint, with its parameters, responses, errors and an example request. `GET /v1/tools` and `GET /v1/tools/{tool}` also answer without a key.