Skip to main content
An API key authenticates every request that is not public market data — orders, cancels, balances, trades, fills, positions, and funding. It is also required to fetch a realtime connection token and to register or cancel a heartbeat. Public market-data routes work without one. See Authentication by route for the full list of authenticated vs unauthenticated routes

Generating API Key

  1. Visit sx.bet and register or log in to your account. You can connect your MetaMask wallet, or log in using your Fortmatic email address.
  2. If using MetaMask, sign the Signature Request.
  3. Click the Account tab on the top navigation bar.
  4. Click the Overview tab on the account navigation bar.
  5. You will see an API Credentials card. Click GENERATE API KEY NOW. An API Key will be displayed.
  6. The API Key generated will not be displayed again, so please copy and save this key for future use.
If you lose your key, you can generate a new one by following the same steps. Any previous keys used will be unauthorized if you generate a new key. Only one key can be active at a time.
For Toronto testnet, generate the key on toronto.sx.bet — keys are per-environment. See Environments.

Usage

Pass your API key in the x-sx-api-key header. The example above fetches a realtime token used to authenticate WebSocket connections. See Initialization. Once your API key is generated, add it as an HTTP header named x-sx-api-key on every authenticated request.
x-api-key is a different, legacy credential and the wrong header here.
Last modified on August 11, 2026