Restrict your API key to the Winrate IP
45.159.172.223OKX connects with an API key. OKX keys have three parts: an API key, a Secret key and a Passphrase you make up yourself. Winrate needs all three.
Winrate shows the spot coins in your OKX Trading account. Futures positions and your Funding account are not counted.
Before you start
- We suggest the OKX website on a computer. It is easier to copy the key from there. (OKX also lets you create keys in its app: Menu → API.)
- Turn on 2FA on OKX.
Create the key
Menu names on OKX can change. If your screen looks different, pick the closest option.
- Log in to OKX and go to Profile → API and connections (it may also show as API).
- Click Create API key.
- Enter a name, for example "Winrate".
- Account: leave Main account, or pick the subaccount you want to connect.
- Used for: choose the API trading option.
- IP address allowlist: enable IP restriction (trusted IPs) for the key and add the Winrate IP: 45.159.172.223.
- This is optional on OKX, but keys with Trade or Withdraw permission and no linked IP expire after 14 days of inactivity.
- Permissions:
- Read to track your balance.
- Trade too, if you want to buy and sell from Winrate. Trading in Winrate needs Premium.
- Keep Withdraw off.
- Passphrase: make up a passphrase and save it somewhere safe. OKX can't show it again or recover it.
- Confirm with your 2FA codes.
- Copy the API key and Secret key.
Good to know: OKX deactivates keys that have Trade or Withdraw permission, have no IP address linked, and are not used for 14 days. Add the Winrate IP 45.159.172.223 to avoid this.
Add the key to Winrate
On the web
- Sign in at winrate.tech. In the sidebar, open Connections. You see Exchange connections.
- Click Add. The New exchange connection form opens.
- Under Choose an exchange, pick OKX.
- Under Connection details, fill in Connection name, API key, Secret key and Passphrase. The connection name is just for you, for example "OKX main".
- Click Add connection. Your balance appears within a few minutes.
In the iPhone app
- Open the Trade tab and tap Connect an exchange. If you already have a connection, open the exchange menu and tap Add connection.
- On Select exchange, pick OKX.
- On Connect exchange, fill in Connection name, API key, Secret and Passphrase.
- Tap Connect.
Your first connection is free. A second connection needs Winrate Premium. Buying and selling from Winrate also needs Premium.
Common errors
Many fixes below need a new key. Winrate can't swap the key on a connection: delete the old connection on the web (on its page) and add a new one. This removes that connection's order history, balances and charts. See Replace or rotate a key.
| What you see | What to do |
|---|---|
| "Invalid API key or secret" or passphrase error | Check all three parts. The passphrase is the one you made up for this key, not your OKX password. |
| Forgot the passphrase | OKX can't recover it. Delete the key, create a new one and add it to Winrate. |
| Key stopped working | A trading key without an IP allowlist expires after 14 days without use. Create a new key and add the Winrate IP 45.159.172.223. |
| Connection fails after adding an allowlist | Check the allowlist on OKX for typos or missing addresses. |
| Wrong balance | Check the key was created for the right account (main or subaccount). Coins in your OKX Funding account are not counted; move them to your Trading account. |
FAQ
Why does Winrate ask for a passphrase for OKX?
OKX keys have three parts. The passphrase is a password you set when creating the key. Winrate needs it to read your account.
Which OKX permissions does Winrate need?
Read to track your balance. Trade if you want to buy and sell from Winrate. Never Withdraw.
Can I create the key in the OKX app?
Yes, OKX allows it (Menu → API). The website is easier for copying the key and secret.
Can I connect an OKX subaccount?
Yes. Pick the subaccount in the Account field when you create the key.
I forgot my OKX passphrase. What now?
OKX can't show or recover it. Delete the key, create a new one and connect it again in Winrate.