Setting up your OKX API connection doesn't have to be complicated. Whether you're looking to automate your trading strategy or connect with third-party platforms, this guide shows you two straightforward methods: the quick OAuth setup and the traditional manual configuration. Both approaches give you full control over your trading permissions while keeping your account secure.
Connecting your OKX account through API opens up possibilities for automated trading, portfolio management, and integration with advanced trading tools. The process is designed with security in mind—you control exactly what permissions to grant, and your login credentials stay private.
OKX offers two connection methods to fit different use cases. The Fast API uses modern OAuth 2.0 authentication for instant setup, while the manual method gives you granular control over each configuration step.
The Fast API method uses OAuth 2.0 technology, which means you authorize access through OKX's secure login page without sharing your API credentials with third parties.
Step 1: Configure Your Trading Settings
Before connecting, set up your futures trading preferences:
Navigate to Trade > Futures and click the settings icon
Set Account mode to "Single-currency margin"
Set Position mode to "One-way mode"
For futures trading specifically, isolated margin mode offers better risk management by limiting potential losses to the margin allocated for each position.
Step 2: Initiate the Connection
Log in to your trading platform (like Bitsgap)
Go to My Exchanges and click [Add new exchange]
Select OKX from the exchange list
Choose Fast Connect and click [Connect]
Step 3: Authorize Access
You'll be redirected to OKX's official website:
Enter your OKX credentials and log in
Review the permissions being requested
Authorize the connection
The permissions allow trading operations but never grant access to your personal information or account credentials. Your password and sensitive data remain completely private.
Step 4: Verify the Connection
After authorization, you'll return to your trading platform automatically. Check that:
OKX appears in My Exchanges with Connected status
Your trading balance displays correctly
The setup is complete and ready for trading.
Manual configuration gives you direct control over API key creation and permissions. This method is ideal if you want to customize settings or prefer traditional API key management.
Step 1: Access OKX API Settings
Log in to your OKX account
Navigate to your profile settings
Go to API section
Step 2: Create Your API Key
Click [Create V5 API Key]
Select Linking third-party apps as the purpose
Choose your platform (such as Bitsgap) from the list
Step 3: Configure Permissions
Create a descriptive label for your API key
Set a Passphrase (save this securely—you'll need it later)
Enable these permissions:
Read: On (view account and order data)
Trade: On (place and cancel orders)
Complete the security verification process when prompted.
Step 4: Save Your Credentials
After creation, OKX displays three crucial pieces of information:
API Key
Secret Key
Passphrase (the one you just created)
Copy and store these securely. The Secret Key is only shown once.
👉 Start trading with lower fees on OKX using code SUPER20OFF for permanent 20% discount
Step 5: Connect to Your Platform
Return to your trading platform
Go to My Exchanges and click [Add new exchange]
Select OKX and choose manual connection
Enter your API Key, Secret Key, and Passphrase
Click [Connect]
Step 6: Confirm the Setup
Verify that OKX appears in your exchange list with:
Connected status indicator
Visible trading balance
Accessible trading pairs
Fast API works best when:
You want the quickest setup process
You're comfortable with OAuth authorization
You're using a platform that supports Fast Connect
Manual configuration is better if:
You need custom permission settings
You prefer traditional API key management
You want to create multiple keys for different purposes
Both methods are equally secure when you follow proper key management practices.
Regardless of which method you choose:
Never share your API keys or passphrase with anyone
Use unique passphrases for each API key
Review and revoke unused API keys regularly
Enable IP whitelisting when available for added security
Store credentials in a secure password manager
Connection shows as disconnected:
Verify all credentials are entered correctly
Check that required permissions are enabled
Ensure your API key hasn't expired
Trading balance doesn't display:
Confirm Read permission is enabled
Wait a few moments for data to sync
Refresh the page or reconnect
Orders fail to execute:
Check that Trade permission is enabled
Verify your account has sufficient balance
Ensure the trading pair is available
👉 Join OKX with referral code SUPER20OFF for 20% lifetime fee savings on all trades
Setting up your OKX API connection is straightforward with either the Fast API or manual method. The Fast API offers convenience through OAuth authentication, while manual setup provides detailed control over your configuration. Both approaches maintain strong security standards while enabling automated trading and platform integration. Start with OKX using referral code SUPER20OFF to enjoy permanent 20% reduced trading fees while you automate your trading strategy.