# Account routes

The routes about your key and your account: what a key may do, your limits, your keys, your usage, your order size cap and your monthly statement. `GET /key` and `GET /limits` take any key; every other route here takes your secret key, from your server. The samples use `BASE` and `MAXY_API_KEY` from [Get a price](https://maxy.co/docs/buy-btc#get-a-price); the answers are real sandbox answers, trimmed.

| Route | What it does |
| --- | --- |
| `GET /key` | The key you called with: its kind, scopes, origins and order size cap ([Authentication](https://maxy.co/docs/authentication#send-the-key)) |
| `GET /limits` | Your cap, the smallest order per route, how long a quote is valid, your rate limit |
| `GET /account` | Your keys by prefix, your usage, your cap requests ([Key security](https://maxy.co/docs/key-security#see-your-keys)) |
| `GET /usage` | Your calls and errors per day |
| `POST /keys` | A new publishable key; with a test key, another test key |
| `POST /keys/rotate` | A new secret key with the same cap ([Key security](https://maxy.co/docs/key-security#rotate-a-secret-key)) |
| `POST /keys/{prefix}/origins` | Replace a publishable key's origins |
| `DELETE /keys/{prefix}` | Revoke a key of your account |
| `POST /limits/requests` | Ask Maxy for a higher order size cap |
| `GET /limits/requests` | What you asked for, and the answers |
| `GET /statements` | A month of your orders with totals, in JSON, CSV or PDF |

## GET /limits

What applies to the key you call with. It never says how large an order can be beyond your cap: an order over it is flagged on its quote (`issues.orderCap`) and refused at `POST /orders`.

```sh
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/limits"
```

```json
{
  "kind": "secret",
  "scopes": ["read", "quote", "place", "orders", "webhooks", "account"],
  "origins": [],
  "orderCapUsd": 100,
  "minOrderSats": 546,
  "routes": { "evm-btc-escrow": { "minSats": 546 }, "evm-btc-gasless": { "minSats": 546 }, "btc-evm": { "minUsd": 10 }, "sol-btc": { "minUsd": 2 }, "btc-sol": { "minUsd": 2 } },
  "quoteTtlSeconds": 60,
  "batchMax": 20,
  "rateLimit": { "limit": 120, "remaining": 102, "resetSeconds": 60, "per": "key", "priceLimit": 1200 },
  "sandbox": true
}
```

`rateLimit` is this call counted, the same numbers as the `RateLimit-*` headers. `priceLimit` is the minute's price reads, counted apart. Limits in full: [Keys and limits](https://maxy.co/docs/keys-and-limits).

## GET /usage

Your calls per day, newest first, counting every key of your account.

| Parameter | Required | Meaning |
| --- | --- | --- |
| `days` | no | 1 to 90; default 30 |

```sh
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/usage?days=7"
```

```json
{ "days": 7, "usage": [{ "day": "2026-11-20", "calls": 590, "errors": 26 }] }
```

## POST /keys

A new key, shown once: Maxy keeps only a hash. It makes a publishable key; with a test key, `kind: "secret"` makes another test key. A new live secret key comes from `POST /keys/rotate`, so a live key asking for one answers `403 scope_denied`.

| Field | Required | Meaning |
| --- | --- | --- |
| `kind` | no | `publishable` (the default) or, with a test key, `secret` |
| `origins` | for a publishable key | Its browser origins, each in full: `https://app.example.com` |
| `note` | no | Your own label |

```sh
curl -s -X POST "$BASE/keys" -H "x-maxy-key: $MAXY_API_KEY" -H "content-type: application/json" \
  -d '{ "kind": "publishable", "origins": ["https://app.example.com"] }'
```

```json
{
  "key": "mxk_pk_test_…",
  "prefix": "mxk_pk_test_ae1lJR",
  "kind": "publishable",
  "origins": ["https://app.example.com"],
  "orderCapUsd": 100,
  "note": "Shown once. Maxy keeps only a hash."
}
```

`POST /keys/{prefix}/origins` takes `{ "origins": [...] }` and applies within a minute. `DELETE /keys/{prefix}` revokes a key within a minute, with every key rotated from it except the one you call with and its own (listed in `alsoRevoked`); the key you call with needs `?confirm=self`. An account holds at most 10 active keys of each kind per environment: past that, `POST /keys` and `POST /keys/rotate` answer `409 conflict`. `GET /account` lists the last 20 keys made or revoked in `keyEvents`. Samples: [Key security](https://maxy.co/docs/key-security).

## POST /limits/requests and GET /limits/requests

Ask for a higher order size cap. A person at Maxy answers; your cap stays as it is until then. `POST` takes `wantedUsd` and a `note`, and answers `201` with the request: its `id`, `createdAt`, and `answer` and `answeredAt` once answered. `GET` lists your requests, newest first. Each request reaches a person, so this page runs only the `GET`.

```sh
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/limits/requests"
```

```json
{ "requests": [] }
```

## GET /statements

A month of your orders with totals, for your books. A test key's statement holds the sandbox orders, a live key's the live ones.

| Parameter | Required | Meaning |
| --- | --- | --- |
| `month` | no | Written `2026-11`; default this month |
| `format` | no | `json` (the default), `csv` or `pdf`. CSV and PDF come as a file download. In a CSV, a text cell that starts with `=`, `+`, `-`, `@`, a tab or a carriage return is written with a leading `'`, so a spreadsheet shows it as text and never runs it |

```sh
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/statements?month=2026-11"
```

```json
{
  "partner": "Your company",
  "month": "2026-11",
  "sandbox": true,
  "generatedAt": "2026-11-20T01:40:40.924Z",
  "totals": { "orders": 3, "completed": 3, "refunded": 0, "open": 0, "failed": 0, "completedSats": 37371, "byRoute": { "evm-btc-escrow": 2, "evm-btc-gasless": 1 } },
  "orders": [
    { "orderId": "0x53414e44424f58e813ff…", "route": "evm-btc-escrow", "chainId": 8453, "state": "completed", "btcTxId": "53414e44424f58d925a4…", "satAmount": 10852, "createdAt": "2026-11-20T01:39:33.897946+00:00", "doneAt": "2026-11-20T01:40:31.826+00:00", "externalId": null, "externalCustomerId": null, "wallet": "0x03406a54928268D6232E93B2A85A5DCE91554639" },
    "…"
  ]
}
```

## Errors

| HTTP | `code` | When |
| --- | --- | --- |
| 400 | `invalid_input` | A malformed body or parameter |
| 401 | `auth_required`, `invalid_api_key` | No key, or a key Maxy did not issue |
| 403 | `scope_denied` | A publishable key on any route here but `/key` and `/limits` |
| 404 | `not_found` | No key with that prefix in your account |
| 409 | `conflict` | Revoking the key you call with, without `?confirm=self` |

---
Source: https://maxy.co/docs/account-routes (Maxy Docs › API reference › Routes)
