How to Connect OKX to ZeroLoss: API Key Setup
ZeroLoss trades OKX USDT-margined perpetual swaps on your own OKX account. It connects through an API key that you create on OKX, not through your password, and the key only needs permission to read your account and trade futures. Your money stays on OKX the whole time. This guide shows how to create that key, restrict it, and connect it to ZeroLoss. It takes about five minutes.
Want to see the bot trade before connecting anything? The free 7-day paper test needs no exchange at all.
Before you start
- An OKX account with two-factor authentication turned on. If you are in the EEA use eea.okx.com, and in the US us.okx.com: keys from one site do not work on another. In some regions OKX asks for at least 100 USD in assets before it lets you create a key.
- An account mode that allows futures. In Trade settings → Account mode, choose any mode other than Spot mode; Spot mode blocks contract trading. This can only be changed on the website or app.
- At least 100 USDT in your Trading account. Use Assets → Transfer, from the Funding account to the Trading account.
- A ZeroLoss account. You can start with the free paper test and connect later.
Step 1: Create the API key on OKX
- On the OKX website open Profile → API and connections (in the app: Menu → API), then Create API key.
- Name the key, choose your main account (or the sub-account that holds the USDT) and the purpose for your own API trading.
- Add the IP allowlist (Step 3) and the permissions (Step 2).
- Set a passphrase. Use a strong one with upper and lower case letters, a number and a symbol, and write it down: OKX cannot show or recover it, and ZeroLoss needs it.
- Confirm, then copy the API key and the Secret key.
Step 2: Choose the permissions
- Read: on.
- Trade: on. This places and cancels orders.
- Withdraw: off.
- Transfer, Loan and Earn: off. ZeroLoss never needs them.
Step 3: Restrict the key to ZeroLoss’s IP addresses
Restricting a key to a few IP addresses means it only works from those servers, even if someone copied it. In the ZeroLoss app, open Connect Exchange; the step Add our IPs lists ZeroLoss’s server addresses with a Copy all button. Paste them into the IP restriction field on OKX.
OKX takes up to 20 addresses per key, separated by commas or spaces. A trading key with no IP allowlist is deleted automatically after 14 days without use; keys with an allowlist do not expire.
Step 4: Connect the key in ZeroLoss
- Log in to ZeroLoss and open Connect Exchange.
- Under 1 · Pick your exchange, choose OKX.
- Under 2 · Paste your API key, paste your API key, secret key and passphrase. The passphrase is the one you typed when you created the key on OKX; OKX cannot show it again.
- Click Verify & connect. ZeroLoss checks the key and reads your futures balance. The connection needs at least 100 USDT in your OKX Trading account.
Check that the key is safe
Open the API management page on OKX and look at the key you created. It should allow reading and futures trading, with withdrawals off. To stop ZeroLoss at any time, delete the key on OKX; trading through it ends immediately, without any action from us. Our guide to trade-only API keys explains why this is the setting that matters.
Common problems
- Orders refused although the key is fine: the account is in Spot mode. Change the account mode in OKX’s trade settings.
- Key, secret and passphrase look right but fail: they must all come from the same account (main or sub-account), and from the right regional site (okx.com, eea.okx.com or us.okx.com).
- Lost passphrase: OKX cannot show it. Delete the key and create a new one.
- “Invalid API Key or Secret”: a character was missed when copying. Copy both again; if the secret was not saved, delete the key and create a new one.
- “API key missing required permissions”: futures trading or reading is not ticked on the key. Edit the key, or create a new one with both.
- “API IP restriction issue”: the key is restricted, but not to all of ZeroLoss’s addresses. Use Copy all in the app and paste the full list again.
- “Minimum 100 USDT required in Futures wallet”: your USDT is in the Funding account. Transfer it to the Trading account on OKX and try again.
Crypto futures trading carries a high risk of loss, and automation does not remove it. Exchange screens change from time to time; if a menu looks different, the permission names above are what to look for. This page is general information, not financial advice. See our Risk & Liability Disclaimer.