Mint a session token
POST/session
Returns a token that replaces the signed headers for 8 hours, on the calls that list it. Send no body. The token can read the account, open RFQs, cancel quotes and decline RFQs; an accept, a quote and a withdrawal still need the account key's signature. A session token cannot grant or remove a viewer or mint a session. The token can end before 8 hours. Mint a new token after a 401 unauthorized.
Authentication
x-crx-addressx-crx-tsx-crx-sigx-crx-addressx-crx-signerx-crx-tsx-crx-sig
Responses
200
Token created.
| Field | Type | Description |
|---|---|---|
token required | string | Value for |
expires_at required | integerminimum 0 | Token expiry time. |
custody required | string | Account the token acts for, in lowercase. |
signer required | string | Wallet that signed, in lowercase. |
ttl_ms required | integer | Token lifetime in milliseconds: 28800000 (8 hours). |
401
unauthorized: a header is missing or malformed, x-crx-ts is out of range, the call was already used, the signature does not match, or the caller lacks access.
code unauthorized
403
not_whitelisted: the account is not approved for this call. setup_pending: the account is approved and its setup is in progress. seat_cannot_sign: the account wallet cannot sign trades. Contract wallets such as a Safe are refused; an EOA with an EIP-7702 delegation is accepted.
code not_whitelisted setup_pending seat_cannot_sign
404
not_found: session tokens are disabled.
code not_found
408
timeout: no answer within 30 seconds.
code timeout
413
payload_too_large: the body is over 4 MiB. Send no body.
code payload_too_large
429
rate_limited: retry after Retry-After seconds.
code rate_limited
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds until the next call is accepted. |
ratelimit-limit | integer | Maximum calls in a burst. |
ratelimit-remaining | integer | Calls remaining before the limit. |
ratelimit-reset | integer | Seconds until the full limit is restored. |
ratelimit-refill | integer | Calls restored per minute. |
502
upstream: a chain read failed. Retry shortly.
code upstream
503
service_unavailable: access cannot be checked now. mark_unavailable: start-up checks are on hold. service_restarting: the service is restarting. Retry shortly.
code service_unavailable mark_unavailable service_restarting