Both flows begin with an invited wallet.
Create a browser wallet session
1
Request a challenge
Send the wallet address to The response contains
POST /auth/challenge.data.nonce and data.message.2
Sign the returned message
Ask the wallet to sign the exact UTF-8 bytes in
data.message. Do not reconstruct, trim, or normalize the message.Signing proves control of the address. It does not submit a transaction or spend a token record.3
Verify the signature
Send the address and signature to A successful response sets access and refresh tokens as httpOnly cookies. The JSON body returns the wallet address, access-token expiry, and a CSRF token.
POST /auth/verify. The example stores the returned cookies in session.cookies.4
Send authenticated requests
Include the cookie jar on subsequent requests. Add the CSRF token in
X-CSRF-Token for state-changing session requests.POST /auth/refresh rotates the refresh token and sets fresh cookies. If two refreshes race, one can return 409; retry the original API request after the successful refresh completes.
Create an API token for a backend
API-token creation requires an authenticated browser session and invited access.ss_... token once. Store it before closing the response. Later list responses expose only token metadata and a prefix.
Use the token as a bearer credential:
Credential boundaries
- A valid wallet signature establishes wallet control, not administrator authority.
- API tokens cover data and trading endpoints. Token management and administrative endpoints require a wallet session.
- WebSocket clients can request a short-lived ticket with a browser session or API token. They must renew authentication before the 60-second ticket expires.
- Never place session cookies, CSRF tokens, or API tokens in URLs or logs.
- Revoke a backend token with
DELETE /api-tokens/{id}when it is no longer needed. - Use
GET /auth/sessionsandPOST /auth/sessions/{session_id}/revoketo manage wallet sessions. - Use
POST /auth/logoutfor the current session orPOST /auth/logout-allfor every wallet session.