Create a Session
Opening a session takes one owner signature and one unauthenticated request. The steps below describe the raw API. The TypeScript and Python SDKs build, validate and sign the grant for you.
1. Generate a session key
Generate a new Stark key pair for every session. The public key goes into the grant as sessionKey; keep the private key in your app. A key that has ever belonged to the account, including the key of a revoked or expired session, is refused with SESSION_KEY_IN_USE.
2. Build the grant
A SessionGrant has these fields. Field names are camelCase and the order shown is the signed order.
Lifetime
issuedAt must be within the last 24 hours, which leaves time for multisig owners to collect signatures, and no more than 5 minutes ahead of server time. expiresAt must be in the future and at most 30 days after the earlier of issuedAt and the time the server receives the grant. A grant that lists trade:block or account:settings lasts at most 7 days. Seven days is a sensible default for a browser session.
Limits
Limits is part of the signed message and every field must be present:
Session limits are not enforced at launch, so the server only accepts a grant that states no limit: every amount set to "none" and markets set to ["*"]. Any other value returns LIMIT_INVALID. The fields exist so that grants keep the same shape if limits are introduced later. Until then a session can trade up to whatever the account itself can.
Builder
Builder is also part of every grant. A grant that approves no builder sends the empty builder:
An EVM owned account can instead approve a builder, a front end that may add its own fee to the orders the session places. Builder approvals may be limited during rollout.
accountis the builder’s Paradex account, which cannot be the granting account.maxFeeRateis the highest fee the builder may charge, as a decimal fraction above0with at most 8 decimal places, and at most0.01. Each order’s builder fee is also held to the cap Paradex sets for its market kind, which can be lower.expiresAtis0for the approval to expire when the session would, or a future time no later than the grant’sexpiresAt.- The grant cannot list
trade:blockoraccount:settings. - The approval is recorded on every account the grant covers, and outlives the session: revoking the session does not revoke it.
Subaccounts
An EVM owned account can list up to 32 of its EVM subaccounts, and the session key then signs in to each one separately. A listed address must be an onboarded subaccount that the owner’s wallet created under account and has not archived. Any other address, including a Starknet subaccount, returns ACCOUNT_NOT_ELIGIBLE after the owner has signed, so check the list first. Archiving a subaccount does not end sessions that already cover it.
- The owner’s main key session creates an EVM subaccount with
POST /v2/account/subaccounts, which takes no body and returns itsaddressandindex. Access may be limited during rollout. GET /v2/onboarding/subaccounts?eth_address=<wallet>lists a wallet’s EVM subaccounts, lowest index first, without a JWT, so an app can fill in the grant before it signs in. Archived subaccounts are left out.
Grants from Starknet owned accounts cannot list subaccounts, and neither can a grant that opens a new account. Only a main account can anchor a grant; a vault operator account can hold a session for itself alone, from a grant with no subaccounts and no builder.
3. Sign the grant
The owner signs the grant as typed data. Both encodings use the domain name Paradex Session and version 1, which differ from the Paradex domain used for orders and auth, so a grant prompt never looks like an order.
EIP-712 (EVM owned accounts)
SNIP-12 (Starknet owned accounts)
The domain chainId is the chain the wallet is currently connected to, so the wallet never needs to switch networks. The Paradex chain and environment are bound inside the message instead. Sign with eth_signTypedData_v4.
Only signatures from externally owned accounts are accepted: a 65 byte r || s || v signature with a canonical (low) s. Smart contract wallet signatures are refused.
Addresses, keys and the nonce must be 0x hex. Labels and other string fields must be printable ASCII. These rules keep a grant’s meaning identical in both encodings.
The grant id
The grant id identifies the session in every later request. POST /v2/sessions returns it, and you can compute it yourself:
- for an EVM owned account, the EIP-712 struct hash of the
SessionGrantmessage. It does not include the domain, so it does not depend on the chain the wallet signed on; - for a Starknet owned account, the SNIP-12 message hash.
Either way it is written as 0x followed by 64 lowercase hex characters.
4. Open the session
POST /v2/sessions needs no JWT: the owner’s signature is the authentication.
Response 200
Check that grant_id, accounts and expires_at match the grant you signed before you rely on the session.
Each grant can be used once. Sending the same grant again, or another grant with the same nonce, returns NONCE_REUSED.
Open a new account with the first grant
An EVM wallet that has no Paradex account yet can open one with its first session grant, with no separate onboarding call. Sign the grant as usual, with account set to the address the server derives for the wallet, and send it to POST /v2/sessions. GET /v1/onboarding?account_signer_type=eip191ð_address=<wallet> returns that address, without a JWT. Any other address returns INVALID_SIGNATURE after the wallet has signed. The server opens the account and the session together.
- The account is deployed on chain when it is first funded. Until then, RFQ requests return
400 NOT_ONBOARDED. referral_code,marketing_codeandutmwork as they do forPOST /v2/onboarding. They are not part of what the wallet signs, and are ignored for an account that already exists and for a grant that approves a builder.- The grant cannot list subaccounts.
- The wallet must be an externally owned account. Smart contract wallets cannot sign a grant, so they onboard the usual way.
- The request runs the same checks as onboarding, so it can also return the onboarding errors below.
Errors
When the grant opens a new account it can also return:
5. Sign in with the session key
The session key signs in like a subkey: call POST /v1/auth/{public_key} with the session public key in the path, the account address in PARADEX-STARKNET-ACCOUNT, and PARADEX-STARKNET-SIGNATURE signed by the session private key. Repeat for each account in accounts to get one JWT per account.
The public key in the path is required. POST /v1/auth without it checks the signature against the account’s main key, so it refuses a session key’s signature.
- Sign and send both
PARADEX-TIMESTAMPandPARADEX-SIGNATURE-EXPIRATION. The expiration must be at most 15 minutes after the timestamp and no later than the session’s expiry. - A session JWT lasts at most 15 minutes and never outlives its session. Sign in again to refresh it.
- Once the session is revoked or expired,
/authreturnsSESSION_REVOKEDorSESSION_EXPIRED. - If the owner has set an IP allowlist for the session, sign in and every later request must come from an allowed IP, or they return
403 IP_NOT_ALLOWED.
Use the JWT and the session key for REST and WebSocket calls exactly as you would a subkey’s: send the JWT as the bearer token, and sign orders with the session private key. Every request is held to the grant’s scopes.