Guide
Authentication and API keys
Most endpoints need no key. An API key raises your limits and gives your server your balance, ledger and orders, and orders paid from the balance.
Public endpoints need nothing. Create an API key when you want higher limits, or to work with your FeeBolt account from a server: read the balance, the ledger and your orders, and rent energy paid from the balance.
Create a key
- Sign in and open Settings › API keys in the app.
- Name the key and pick its scopes. read: balance, ledger and orders. order: rent energy paid from your balance.
- Copy the key. It is shown once: we keep only a hash, so it can't be shown again. Lost it? Revoke it and create another.
An account can have 10 active keys (names up to 40 characters). Use one per server or environment, so you can revoke one without touching the others.
Send it
Put the key in the Authorization header as a bearer token, on server-to-server calls only. Keep it out of browsers, apps and repositories.
curl https://feebolt.com/api/me \
-H "Authorization: Bearer $FEEBOLT_API_KEY"const res = await fetch("https://feebolt.com/api/me/balance", {
headers: { Authorization: `Bearer ${process.env.FEEBOLT_API_KEY}` },
});
const { balances } = await res.json();Scopes
| Scope | Allows |
|---|---|
read | Balance, ledger, your orders. |
order | Orders paid from the balance. This spends money: give it only to servers that need it. |
| — | Withdrawals are never possible with a key. They stay in the app, behind your sign-in. |
Every key can call Who am I and the optional-key endpoints, whatever its scopes.
Which endpoints take a key
| Endpoint | What | Access |
|---|---|---|
GET /api/price | Current prices | Optional key |
POST /api/quote | Get a quote | Optional key |
POST /api/orders | Create an order | Optional key |
GET /api/orders/{id} | Retrieve an order | Optional key |
GET /api/me | Who am I | API key |
GET /api/me/balance | Get the balance | API key (read) |
GET /api/me/ledger | List ledger entries | API key (read) |
GET /api/me/orders | List your orders | API key (read) |
POST /api/me/orders | Create an order paid from the balance | API key (order) |
POST /api/check-address | Check an address | Optional key |
POST /api/freeze-check | Check a USDT freeze | Optional key |
GET /api/tx-fee | What a transaction paid | Optional key |
POST /api/send/quote | Quote a send | Optional key |
POST /api/send/prepare | Start a send | Optional key |
GET /api/send/status/{id} | Follow a send | Optional key |
GET /api/fee-today | USDT fee today | Public |
GET /api/data/energy-index | Energy Price Index | Public |
GET /api/data/energy-index.csv | Energy Price Index (CSV) | Public |
GET /api/status | Service status | Public |
GET /api/status/history | Status history | Public |
Rules
- A bad, revoked or closed-account key is refused with
401or403on every endpoint that takes keys. It is never silently ignored, so a typo can't downgrade you to per-IP limits unnoticed. - Cookies never authenticate a key endpoint, and a key needs no CSRF token. The app's own routes (
/api/account/*) take the session only; a key can't manage keys. - Revoking a key stops it at once. Closing your account revokes all its keys.
- Creating and revoking keys, and every order a key pays from the balance, is recorded in your account's security log.
- With a key, optional-key endpoints are limited per key at 5× the per-IP limits; see rate limits.
Errors
| HTTP | error | When |
|---|---|---|
| 401 | missing_api_key | This endpoint needs an API key: Authorization: Bearer fb_live_…. |
| 401 | invalid_api_key | The key is malformed or unknown. A bad key is refused on every endpoint that takes keys, never ignored. |
| 401 | api_key_revoked | The key was revoked in Settings › API keys. |
| 403 | insufficient_scope | The key lacks the scope this endpoint needs (read or order). |
| 403 | account_closed | The key's account is closed. |
401 answers carry WWW-Authenticate: Bearer.