Setup

How to Create OKX API Keys

To create OKX API keys, please follow the steps below.

If you do NOT have an OKX account

Please sign up here. Use referral code 89707490 during signup to support us.

OKX signup

If you already have an OKX account

Please log in to your account.

OKX login

Verify Your Account (if not verified)

  1. Follow any of the verification options in your account settings
  2. Complete the verification steps
  3. You should see a "verified" badge at your profile page

Switch Account to Portfolio Mode

  1. Go to the spot trading page
  2. Click the settings gear icon on the top right corner
  3. Click Account Mode, scroll down and select Portfolio Mode
  4. Switch on the "auto-borrow" preference

Create API Key

  1. Go to the API keys page
  2. OKX API keys page
  3. Click "Create API Key"
  4. Create API Key button
  5. Fill in the form:
    • "API key name" — any string related to the key usage
    • "Permissions" — extend to include Trade permission
    • "Passphrase" — any string meeting OKX requirements. Remember it — you'll need it later
  6. OKX API key form
  7. Share with the BlackSwan bot: API key, Secret key, and Passphrase.
  8. OKX API key info
  9. You can use the "Copy API key info" button to copy all info at once.
  10. Copy API key info button

Telegram Bot

Then go to the Black Swan Telegram bot for further instructions.

Important Notes

  • OKX requires a Passphrase in addition to API key and secret
  • Portfolio Mode is required for options trading
  • Only enable Trade permissions — never enable withdrawal access
  • Your funds remain on OKX at all times
  • You can delete API keys at any time from OKX's API management page