Skip to main content

Connect OKX

Trade uses OKX Multi-currency margin mode to trade spot, cross margin and USD-margined perpetuals. This guide covers what to prepare on OKX and what to enter in Trade.

Prepare on OKX

  1. Set your OKX account mode to Multi-currency margin and turn on Auto-borrow.

  2. Create an API key. Set a passphrase for it and keep a note of it.

  3. Tick Read and Trade. Don’t tick Withdraw.

  4. If you bind the key to IP addresses, add your Trade server’s egress IPs. The Add account window lists them under Server egress IPs. Choose Copy all egress IPs.

A sub-account is a separate exchange account. Use the sub-account’s own API key and add it in Trade as its own account.

Account mode and position mode

The only account mode is Multi-currency margin mode: spot, cross margin and USD-margined perpetuals share one account, with assets in several currencies counting as margin. Spot mode, Futures mode and Portfolio margin mode can’t be saved. Multi-currency margin mode with Auto-borrow off can’t be saved either. Trade doesn’t switch the account mode for you.

USD-margined perpetuals must use Two-way positions. Trade verifies this when you save and switches it where OKX allows. If OKX refuses because positions or orders are open, close them, then save again.

Contract leverage is set in the combo, and Trade applies it on the exchange.

Enter it in Trade

In Trade, open Accounts, choose Add account and select OKX. For the general steps, see Connect an exchange.

FieldWhat to enter
API keyYour OKX API key
Secret KeyThe secret for the same key
PassphraseThe passphrase you set when you created this key
Account nameA name of your choice
Account modeMulti-currency margin mode
Supported marketsSpot, cross margin and USD-margined perpetuals. Select the ones you trade

Choose Verify and add.

Common questions

The actual mode shows “Multi-currency margin mode with Auto-borrow off”

Turn on Auto-borrow on OKX, then save again.

The API key didn’t pass verification

A missing or wrong passphrase makes verification fail. Use the one you set when you created the API key.

The account can’t connect after saving

If you turn off Auto-borrow on OKX, or change the position mode to one-way, the account is refused the next time it reconnects, and the exchange may reject orders before then. It recovers on its own once you change it back.

Was this article helpful?