Recommended for most users
Use Fast Connect instead of manual API keys for an easier and faster setup. You’ll be redirected to OKX to approve access securely — no need to copy/paste keys.
BEFORE WE START!
OKX Demo trading account is not supported for on 3Commas. You can only trade with real funds when using OKX through 3Commas.
If you want to connect the OKX Futures account to 3Commas, you must first activate it on the OKX website! Please head to the end of this article to learn how to enable Futures on OKX.
If you don't yet have OKX account, you can take advantage of our new OKX Fast Registration feature. Just head to this page, create an OKX account and you will be redirected straight to the Fast Connection page.
I. Fast Connect.
1. Go to the My Portfolio page and click on Connect a new account
If this is your first exchange to be connected, click on the Connect exchange button:
You can also choose OKX from the onboarding page right after you sign up. After that, move to the Step 3:
2. Click on Exchanges and choose OKX
3. Click on Connect OKX
If you already have an OKX account click on the Connect OKX.
If you still don't have an account, click on Create a new OKX account:
4. This will redirect you to the OKX log-in page
Here you can log in or create a new OKX account:
5. Complete the log-in or sign-up process and Approve the connection
6. OKX Spot and OKX Futures are connected to 3Commas
Can't you see the OKX Futures account on 3Commas? Or don't know how to enable Futures trading on OKX? Please read the tutorial below :)
II. Update with Fast Connect.
1. Go to the API Management page on OKX.
First of all, delete old API keys created manually or by Fast Connect (this eliminates any possible errors while updating with Fast Connect).
2. Go to the My Portfolio page on 3Commas.
Click on the Update API Key button on the needed exchange card.
or:
3. Choose Fast Connect, and click on Reconnect.
4. Proceed with the log-in procedure on OKX.
5. Approve the API connection procedure
6. There, your exchange is updated!
IMPORTANT NOTES:
1) If you changed the email or Security setting (2FA, password, etc.) for your OKX account, this would also make your API connection invalid. In this case, you will have to wait 24 hours and reproduce the steps above!
2) Do not whitelist IP pool.
That's it! These steps will solve any problem you may face while updating or connecting using the usual way or the Fast Connect feature!
III. Manual API keys creation
Reminders
Please note that my.okx.com is not currently supported by 3Commas. Please use the main OKX website for setting up your API connection.
Only use manual API keys if Fast Connect doesn’t work. Manual API setup is more complex and may not work for all users.
1. Follow to API management page
Hover over the profile icon on the top right corner, and click on API button:
You must enable 2FA to add API keys. If you see this message, please follow OKX's instructions:
2. Click "Create APIs"
3. Give it a name
When you have multiple APIs, a proper name helps to manage it.
4. Choose the account where you want to create an API key
It includes all your main and sub-accounts.
5. Choose Linking third-party apps and choose "3Commas"
Can’t find 3Commas in the dropdown?
If "3Commas" doesn’t appear in the third-party app list, try using the Fast Connect method instead — it automatically links your account without needing to search manually.
Still can’t see it? Contact our support team for assistance!
6. Choose the "Trade" permission
7. Enter the Passphrase
It's a "password" for the API key. Remember or save it somewhere safe, as you can't add API to 3Commas without it.
8. Click on Submit all button
9. Enter 2FA code/-s, then click "Confirm"
10. To see API keys, click on Show info
11. Save your created API keys
12. DONE!
Now you have API keys to connect Spot and Futures OKX accounts to 3Commas!
Please follow the steps from the article below:
Connect an exchange using API keys.
That's it! Congratulations!
P.S. If you have any issues, please check possible ways to fix them.
IV. Enable Futures trading on OKX
Video about how to enable OKX Futures and create API keys:
Before we start with the API keys, let's activate Futures trading on OKX!
(if you don't need it, please skip down right to API keys creation tutorial)
1. Go to OKX
Log in or create a new account at https://www.okx.com.
2. Go to Contracts & margin trading page
3. Update for trading
From the Contracts & margin trading page, click on the Upgrade for trading button:
If it's already Updated, then click on the Settings (⚙️) button on the top right corner:
Then click on Account mode:
4. Choose the Single-currency margin mode
Other modes are not supported on 3Commas.
5. Confirm the selection
That's it! Now you can create API keys to connect OKX Spot and Futures accounts to 3Commas!
FAQ
Why can’t I close my position on OKX? ("You're leading trades in Long/Short mode" error)
If you're using an OKX Copy Trading Lead account, position closing behavior is restricted by OKX. Positions can only be closed at market price, and amounts can’t be customized. Bots are not designed to work with Copy Trading accounts, so issues may occur.
More info: Lead Traders FAQ – OKX
Why do I get a “Balance limit reached” error when opening a trade?
This error typically means your position exceeds OKX contract or leverage limits. You’ll need to adjust your trade size or leverage according to OKX’s contract rules.
Check OKX contract rules here: OKX Swap Info
Why is my OKX balance showing incorrectly on 3Commas?
Make sure your funds are in the Trading Account, not in Funding, Margin, or Earn accounts. 3Commas can only access funds located in the Trading section of your OKX wallet.
Tip: Transfer your assets to the Trading Account using OKX’s internal transfer option.
How do I transfer funds to the Trading Account on OKX?
Go to the Assets drop-down on OKX and click Transfer. Move your funds from Funding to Trading Account. Only assets in the Trading Account can be used by bots for Spot trades.