Overview
Exchange uses a simple, key-based authentication model. There are no passwords, no JWTs, and no OAuth flows. Two roles exist:- Trader — assigned an API key by an operator. Used for order entry, account queries, and WebSocket trading.
- Admin — holds a static bearer token configured at server startup. Used for operator control-plane actions.
Trader API keys
Each trader account has exactly one API key, generated at provisioning time. Keys have the format:exch_ is followed by a 32-character hex string (a UUID without hyphens). Keys are permanent — there is no rotation mechanism or expiry.
REST authentication
- Trader routes
- Admin routes
Authenticated trader routes require the Example — fetch your profile:The following endpoints require a valid
If the header is missing, the server returns
x-api-key header:x-api-key header:| Method | Path | Description |
|---|---|---|
GET | /api/v1/user | Authenticated user profile |
GET | /api/v1/positions | Open positions |
GET | /api/v1/portfolio | Portfolio snapshot with PnL |
GET | /api/v1/leaderboard | Leaderboard |
GET | /api/v1/open-orders | Resting orders |
GET | /api/v1/fills | Fill history |
POST | /api/v1/orders | Submit a limit order |
PATCH | /api/v1/orders/{order_id} | Amend a resting order |
DELETE | /api/v1/orders/{order_id} | Cancel a resting order |
401 missing authentication. If the key is not recognized, it returns 401 invalid api key.WebSocket authentication
Connect to the WebSocket endpoint:authenticate message:
Market data without authentication
WebSocket market data subscriptions (orderbook snapshots and deltas) can be established before sending an
authenticate message. You do not need an API key to observe public market data.authenticate message. A typical integration subscribes to market data immediately on connect, then authenticates in parallel or shortly after.
Security notes
- There are no passwords. The API key is the only trader credential.
- There is no JWT or OAuth flow. There is no token refresh.
- API keys do not expire. If a key is compromised, an operator must re-provision the affected trader account.
- Store your API key in an environment variable or secrets manager — never hardcode it in source code or commit it to version control.
- Admin tokens are server-side configuration and should be rotated by redeploying the exchange with a new value.