<!--
Sitemap:
- [Paybox](/index): The non-custodial wallet for AI agents
- [Getting started](/getting-started)
- [Credentials & agents](/concepts/model): The Paybox model
- [Approvals & passkeys](/concepts/approvals)
- [Request lifecycle](/concepts/requests): From intent to result
- [MCP connector](/connect/mcp)
- [OAuth 2.1](/connect/oauth)
- [MCP tools](/reference/mcp-tools): What an agent can call
- [API & endpoints](/api-reference)
- [SDK & CLI](/sdk-cli)
-->

# API & endpoints

Paybox's developer surface is small on purpose: **OAuth 2.1** to authorize, then
**MCP** to act. Connecting wallets and credentials, client management, approvals, and audit are
done by the user in the Paybox app — they are not a public API.

## Origins

| Role | URL |
| --- | --- |
| API origin (OAuth issuer + MCP) | `https://api.paybox.sh` |
| App / consent UI | `https://app.paybox.sh` |

The OAuth **issuer** and the MCP **resource** derive from the API origin: the
resource is `<origin>/mcp`. Always start from discovery rather than hard-coding
paths.

## Public endpoints

| Endpoint | Method | Auth | Purpose |
| --- | --- | --- | --- |
| `/.well-known/oauth-authorization-server` | GET | none | OAuth 2.1 server metadata (RFC 8414). |
| `/.well-known/oauth-protected-resource` | GET | none | Protected-resource metadata (RFC 9728). |
| `/oauth/register` | POST | none | Dynamic client registration (RFC 7591). |
| `/oauth/authorize` | GET | user (browser) | Authorization request (code + PKCE S256). |
| `/oauth/token` | POST | none (public client) | Exchange code or refresh token for an access token. |
| `/mcp` | POST | Bearer access token | The MCP endpoint — all agent operations. |

See **[OAuth 2.1](/connect/oauth)** for request/response shapes, scopes, token
TTLs, and error codes, and **[MCP tools](/reference/mcp-tools)** for everything an
agent can call on `/mcp`.

## Authentication

Agents authenticate to `/mcp` with a **bearer access token** obtained via the
OAuth flow:

```http
POST /mcp
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…
```

The token is **audience-bound** to the MCP resource and carries the **grant set**
the user approved — which credentials, and the approval mode for each. It never
overrides a passkey step-up: sensitive operations still pause for the user. See
**[Approvals & passkeys](/concepts/approvals)**.

A personal **`pbx_live_*` API key** (issued from the app's Clients screen) works
as the same bearer — both resolve to the same scoped client. Keys suit headless
use (CI, servers) where the OAuth browser flow doesn't; the SDK and CLI accept
either.

## Not a public API

The first-party Paybox app (web + mobile) uses internal `/api/*` routes for
sign-in, vaulting credentials, managing clients, reviewing approvals, and reading
the audit log. These are **not part of the developer surface** and are not
documented here — an integration never calls them. Everything an external agent
needs is the OAuth flow plus the MCP tools above.

:::note
A typed Node SDK and CLI ship over this surface — `@paybox-sh/sdk`, with
in-process (iframe-free) wallet signing. See **[SDK & CLI](/sdk-cli)**.
:::
