Skip to content

OKX – API Import Guide

This guide explains how to create and bind an OKX API Key to your trading platform.
By connecting your OKX account via API, you can enable automated trading, quantitative strategies, and real-time account synchronization securely.


⚠️ Important Notes Before You Start

Please read carefully before creating an API key:

  • ✅ API access does NOT allow withdrawals (if configured correctly)
  • ❌ Never share your API Key, Secret Key, or Passphrase
  • 🔐 Always restrict permissions and IP addresses if possible
  • 🧠 Recommended: create a dedicated sub-account for API trading

Step 1: Log in to OKX

  1. Visit the official OKX website
    👉 https://www.okx.com
  2. Log in to your account
  3. Make sure 2FA is enabled

📸 Screenshot Example
OKX Login Page


Step 2: Navigate to API Management

  1. Click your profile avatar (top-right corner)
  2. Select API
  3. Enter the API Management page

📸 Screenshot Example
OKX API Management Entry


Step 3: Create a New API Key

  1. Click Create API Key
  2. Enter an API Name, for example:
  3. Select API usage purpose (e.g. Trading)
  4. Set a Passphrase

⚠️ This passphrase is required when binding the API

  1. Complete security verification

OKX will generate:

  • API Key
  • Secret Key
  • Passphrase

📸 Screenshot Example
Create OKX API

⚠️ Save the Secret Key & Passphrase securely.
They will not be shown again.


Step 4: Configure API Permissions (Very Important)

Set permissions carefully to ensure both functionality and security.

✅ Required Permissions

  • ☑️ Read
  • ☑️ Trade
  • ☑️ Futures / Swap (if using derivatives strategies)

❌ Must Be Disabled

  • ⛔ Withdraw
  • ⛔ Transfer (recommended OFF)

📸 Screenshot Example
OKX API Permissions


  1. Enable Bind IP address
  2. Add the platform’s official IP addresses
    (provided by your trading platform)

📸 Screenshot Example
OKX API IP Whitelist

If IP addresses are not available yet,
you may temporarily skip this step and update later.


Step 6: Bind API Key on the Trading Platform

  1. Go to Account → API Management on your platform
  2. Select OKX as the exchange
  3. Enter:
  • API Key
  • Secret Key
  • Passphrase
  1. Select trading scope:
  • Spot / Futures / Both
  1. Click Bind / Connect

📸 Screenshot Example
Bind OKX API on Platform


Step 7: Verify Connection Status

After successful binding, you should see:

  • ✅ API Status: Connected
  • 📊 Account balance synced
  • 🤖 Quant strategies available

📸 Screenshot Example
OKX API Connected Status


Common Errors & Solutions

❌ Invalid API Key / Secret / Passphrase

  • Ensure all fields are entered correctly
  • Check for extra spaces
  • Recreate the API if information is lost

📸 Screenshot Example
OKX API Invalid Error


❌ Permission Denied

  • Ensure Trade permission is enabled
  • Futures bots require Swap / Futures permission

❌ IP Not in Whitelist

  • Add platform IP to OKX whitelist
  • Or disable IP restriction temporarily

Security Best Practices

  • 🔐 Use a sub-account for API trading
  • 🔄 Rotate API keys regularly
  • 👀 Monitor API usage logs in OKX
  • 🛑 Delete the API immediately if suspicious activity is detected

FAQ

Why does OKX require a Passphrase?

OKX adds an extra security layer.
The passphrase is mandatory when binding APIs.

Can the platform withdraw my funds?

No. Withdrawal permission must remain disabled.

Can I edit API permissions later?

Yes. Permissions can be modified anytime in OKX API Management.


🎯 Finished

Your OKX account is now successfully connected.
You can start automated and quantitative trading securely.

For more exchange guides, please refer to other API import documentation.

Released under the MIT License.