The fee recipient address is the account. These endpoints need no API key or
login. Reads are public; saving settings requires a signature from that
recipient wallet. Connecting a wallet alone does not authorize it.

Fee-bearing quotes require a deployment with integrator fees enabled. Your
fees are settled automatically and periodically in USDC: on Solana for a
Solana address, on Base for an EVM address.

Base URL: `https://bridge-api.gum.ag/api/bridge/v2`.
`{recipient}` is a valid Solana or EVM address, URL-encoded in the path.

For fee rates and how to add `fee.recipient` to quotes, see
[Earn fees](/universal-bridge/earn-fees). Open your [dashboard](/bridge#dashboard)
to view earnings and transfer history. Connect the recipient wallet to
manage [fee settings](/bridge#settings) on the same page.

## Read an account

`GET /fees/{recipient}`

```bash
curl 'https://bridge-api.gum.ag/api/bridge/v2/fees/YourSolanaOrEvmAddress'
```

Replace the placeholder with the address to inspect. The response is the
account object directly, with no envelope:

| Field | Meaning |
| --- | --- |
| `recipient`, `family` | Account address and `svm` or `evm` |
| `payoutChain` | `{ chainId, name, minimumUsd }`: the settlement chain, Solana for a Solana address and Base for an EVM address |
| `settings` | Effective rates, overrides and optional label |
| `configured` | Whether the recipient has saved signed settings |
| `totals` | Numeric `transfers` and `delivered`; decimal-string `volumeUsd`, `feesUsd`, `earnedUsd`, `balanceUsd`, `paidUsd`, `gasUsd`, `pendingUsd` |
| `hold` | Optional reason settlement is on hold |
| `transfers` | Latest 50 fee transfers; page through all of them with [`/transfers`](#list-transfers) |
| `payouts` | Latest 20 settlements GUM has recorded; no pagination parameter |

Transfer entries contain `id`, `createdAt`, `status`, `provider`, `from` and
`to` (each `{ chain, symbol }`), `feeBps`, `paid`, and optional `bucket`,
`amountUsd`, `feeUsd`, `earnedUsd`. Missing amounts are unavailable, not zero.
`paid` means the credit is part of a recorded settlement.

Settlement entries in `payouts` contain `id`, `chain`, `amountUsd`, `gasUsd`,
`sentUsd`, `txHash`, `status`, `createdAt`, and optional `settledAt` and
`error`. `sentUsd` is the amount sent on chain. List timestamps are Unix
milliseconds; USD amounts are strings to preserve decimal precision.

## List transfers

`GET /fees/{recipient}/transfers?offset=0&limit=20`

```bash
curl 'https://bridge-api.gum.ag/api/bridge/v2/fees/YourSolanaOrEvmAddress/transfers?offset=20&limit=20'
```

Every fee transfer for the recipient, newest first, one page at a time. The
response is `{ transfers, total, offset, limit }`: transfer entries have the
same shape as in the account, and `total` counts every fee transfer, so
`offset + transfers.length < total` means another page follows. An order
whose wallet never signed is not a transfer: it appears in neither the list,
`total`, nor the account's `totals`.

| Parameter | Meaning |
| --- | --- |
| `offset` | Transfers to skip from the newest; integer from 0, default 0 |
| `limit` | Page size; integer from 1 to 100, default 20 |

A new transfer arriving between requests shifts later pages by one; refetch
from `offset=0` to start over.

## Read the leaderboard

`GET /fees?days=30`

`days` accepts an integer from 1 to 90; omitted or invalid values use 30.
The response is `{ days, recipients, totals }`, with at most 100 recipients
ordered by fees collected, highest first.

Each row has `recipient`, optional `label`, `transfers`, `volumeUsd`,
`feesUsd`, `earnedUsd` and `paidUsd`. The time window applies to credited
transfers and fees, and delivered-transfer volume. `paidUsd` is lifetime
recorded settlements, not settlements in that window. `totals` sums the
returned rows and includes their count as `recipients`; it is not a total for
every account beyond the top 100.

## Authorize a change

All POST bodies are JSON with `Content-Type: application/json`. No private
key is sent to the API. The signature authorizes one action, not a login
session or a transfer from the wallet.

1. Request the exact text with `POST /fees/{recipient}/message`, body
   `{ "action": "settings", "settings": { "majorBps": 25 } }`.
2. Read `{ message, issuedAt, expiresAt }`. Both times are ISO strings.
3. Have the recipient wallet sign `message` exactly as returned, including
   whitespace. Solana signs its UTF-8 bytes with `signMessage`; submit the
   64-byte signature as base58 or base64. EVM uses EIP-191 `personal_sign` and
   a hex signature. Smart-wallet signatures are checked with EIP-1271 on Base.
4. Submit the settings below within 10 minutes. Keep `issuedAt` unchanged.
   An old or reused timestamp is rejected; request and sign a fresh message
   for the next change.

Getting a message does not save settings. A successful save returns HTTP 200
with the updated account object.

### Save settings

`POST /fees/{recipient}/settings`

Body: `{ "settings": { "majorBps": 25 }, "issuedAt": "…", "signature": "…" }`.
Use the same settings that produced the signed message. This replaces the
previous saved settings: omitted fields revert to defaults. Unknown setting
names are rejected.

| Setting | Accepted value |
| --- | --- |
| `stableBps`, `majorBps`, `otherBps` | Integer from 0 to 200 |
| `overrides` | At most 50 `{ chain, token, bps }` entries; `bps` is an integer from 0 to 200, `token` is an address or `native` |
| `label` | Text up to 40 characters, without control characters |

An explicit quote `fee.bps` wins over saved settings. Otherwise the first
matching token override wins, followed by the saved bucket rate, then the
[default rate](/universal-bridge/earn-fees#what-users-pay). Saved changes can
take up to 30 seconds to reach new quotes; existing quotes retain their terms.

SDK builds that expose `bridge.fees` handle message requests and submissions
with `bridge.fees.saveSettings(recipient, settings, sign)`. `sign(message)`
returns a signature string or `Uint8Array`; the SDK encodes bytes as base64.
Check your installed SDK: the published `@gumag/bridge` 0.1.1 does not expose
`bridge.fees` or quote fees. Use these REST endpoints on a fee-enabled deployment
until an SDK release includes them.

## Errors

Errors use `{ "error": "Human-readable reason", "code": "machine-code" }`.

| HTTP | Code | Meaning |
| --- | --- | --- |
| 400 | `invalid-request` | Invalid address, setting, timestamp, missing signature or replay; read `error` for the reason |
| 401 | `bad-signature` | The recipient did not sign this exact message |
| 405 | `method-not-allowed` | Wrong HTTP method; see the `Allow` header |
| 429 | `rate-limited` | Retry after the number of seconds in `Retry-After` |
| 503 | `unavailable` | The fee store or a required service is unavailable; try again later |
