Skip to content

OKX · CEX

Trade OKX with Ninja Terminal

OKX CEX
  • Spot
  • Perpetual swaps

Updated Ninja Terminal team

Short answer

Ninja Terminal connects to OKX Spot and perpetual swaps with your own API key, secret, and passphrase. Orders execute on your OKX account and funds stay on OKX. You can place Market, Limit, Stop, and Stop Limit orders, set leverage and margin mode, attach TP/SL, and watch OKX positions next to Binance, Bybit, and Hyperliquid in one workspace.

OKX combines a spot market and a large perpetual swap market under one API, and many traders hold an OKX account next to Binance or Bybit. Ninja Terminal connects OKX through its v5 API and treats each OKX account as one entry in a shared workspace. Positions, orders, and balances from OKX sit in the same lists as your other venues.

What can you trade on OKX through Ninja Terminal?

Market What it is Notes
Spot Coin-for-coin trading Market and Limit orders
Perpetual swaps Perpetual futures contracts, which OKX calls swaps Sized in contracts; leverage, cross or isolated margin, TP/SL

A new OKX account in Ninja Terminal starts with both markets enabled. See perpetual futures if the term is new to you.

Which order types and features work on OKX?

Feature Spot Perpetual swaps
Market and Limit Yes Yes
Stop and Stop Limit No Yes (Open mode)
TP/SL on positions n/a Yes
Reduce-only n/a Yes, in net mode
Leverage setting n/a Per instrument
Margin mode (cross or isolated) n/a Per instrument
Hedge (long/short) mode n/a Supported

Stops and stop limits are sent as OKX trigger orders. On OKX spot, a trigger order fires on the last price only. In net mode, a closing order uses reduce-only so it cannot flip your position. In hedge mode, the position side (long or short) identifies the position instead, and OKX rejects reduce-only there. Market orders above an instrument’s maximum market size are split into batches before they are sent. For more, see take-profit and stop-loss by exchange and market order size limits.

How does connecting an OKX account work?

OKX needs three values: an API key, a secret, and a passphrase.

  1. In OKX, open API management and create an API key for API trading. Name it and create a passphrase. This is not your OKX login password.
  2. Paste the IP addresses Ninja Terminal shows you into the key’s IP allowlist.
  3. Under permissions, select Read and Trade. Leave Withdraw off.
  4. Submit, complete OKX’s verification, and copy the key and secret.
  5. Enter the key, secret, and passphrase in Ninja Terminal and run the connection test.

Use your live trading account. OKX cannot recover a forgotten API passphrase, so store it with the key and secret. The step-by-step version is in How to create an OKX API key, and the API key security checklist covers what to verify before you save. Keys are encrypted with AES-256-GCM and stay on your device.

What should OKX traders know?

Spot market order sizes. The OKX API reads the size of a spot market buy in quote currency (for example USDT) unless the request says otherwise, while a spot market sell is read in the base coin. Ninja Terminal states the unit on every market order it sends, so the amount you enter matches what is placed. Read OKX spot market order size for the mechanics.

Contracts, not coins. Swap sizes are in contracts, and OKX defines contract value per instrument. Ninja Terminal sends the native contract count.

Margin mode changes. OKX does not allow a margin mode change while you hold an open position on the instrument. Close first, then switch.

Position mode. The terminal detects net or long/short mode from your account and rereads it in the background. If you change it in OKX, the terminal follows. See hedge mode vs one-way mode.

Using OKX alongside other venues

OKX positions, orders, and balances show up in the same views as Binance, Bybit, and Hyperliquid. In Quick Entry, a command like eth s 50k perp previews the size and lets smart routing choose the best account or split the order across several, with checks on margin ratio, equity reserve, and liquidation distance. If you use more than one OKX account, give each a nickname and switch with Alt+1 through Alt+9. See also Binance, Bybit, and Hyperliquid.

Ninja Terminal is not an exchange, custodian, or broker. Nothing here is investment advice.

Frequently asked questions

Why does Ninja Terminal ask for an OKX passphrase?

OKX API keys have three parts: key, secret, and the passphrase you chose when you created the key. OKX requires the passphrase on every private request, and it cannot recover a forgotten one. Store it with the key.

Which OKX markets does Ninja Terminal trade?

Spot and perpetual swaps. Both are enabled by default for a new OKX account in the terminal, and you can change which markets each account trades.

Does Ninja Terminal support OKX hedge mode?

Yes. Ninja Terminal reads whether your OKX account uses net (one-way) or long/short (hedge) position mode and shapes each swap order to match. You switch the mode in OKX, not in the terminal.

Are OKX swap order sizes in contracts or coins?

OKX sizes swap orders in contracts, and the amount Ninja Terminal sends is in that native unit. Contract value differs by instrument, so check the contract size before you size a trade.

Sources

  1. OKX — API v5 documentation
  2. OKX — API FAQ

Trade every venue from one tab.

Binance, OKX, Bybit, and Hyperliquid with news, charts, and one-command orders. Included with Ninja Squad Pro membership.