Skip to content

Configuring OKX API Keys ​

The API Key is the credential that lets TodoAI talk to your OKX account. Once configured, all "place order / cancel / check balance" actions can actually execute.

1. Create an API key on OKX ​

Follow the detailed OKX steps below.

2. Paste into TodoAI and save ​

Sidebar gear → pick the mode (Paper / Real) → fill three fields → save

3. Auto-test connection ​

Saving triggers it — a green "Connection OK · X USDT · Y open orders" means you're connected

4. Run strategies ​

Once connected, the engine places orders through these keys on every tick

Create an API key on OKX (step by step) ​

Live API Key ​

  1. Sign in to OKX → avatar (top right) → API
  2. Click Create API Key → choose API Trading
  3. Name it (anything, e.g. TodoAI-Web)
  4. Permissions: tick Read + Trade. Do NOT tick Withdraw — non-negotiable.
  5. Passphrase: set your own — this is what you'll paste into TodoAI as "Passphrase". OKX does not show it in plain text later
  6. IP Whitelist: by default TodoAI does not require a fixed server IP. If you restrict it, add the server's outbound IP; otherwise leave it open
  7. After creation, the page shows API Key + Secret Key + Passphrase. The Secret is shown exactly once — copy it into a password manager
  8. Paste all three into TodoAI's Configure modal → click Test Connection

Paper / Demo API Key ​

⚠️ Most common pitfall: paper API keys must be created at OKX Demo Trading, NOT the main OKX site.

  1. On the Demo Trading page, avatar → Demo API
  2. Same steps as above. The demo account has 100k virtual funds
  3. Back in TodoAI, fill the keys into the Paper tab

What are the three fields? ​

FieldSource
API KeyThe string shown at the top of the OKX creation page (typically 36 chars)
Secret KeyThe Secret OKX shows at creation, usually starting with "OK-"; shown exactly once
PassphraseThe one you set yourself when creating the API — not your OKX login password, not your funds password

💡 There's a ? tooltip next to the Passphrase field. Hover it for the explanation.

Test connection failed — what now? ​

After saving, TodoAI automatically runs a connection test. On failure it tells you exactly what's wrong:

MessageHow to fix
API Key invalid or deletedRe-copy the Key from OKX
Passphrase is wrongYou might be using the login password; use the one you set at creation
Server IP not in OKX whitelistDisable the whitelist, or add the server IP
API Key lacks required permissionsEnable Read + Trade; do NOT enable Withdraw
Signature invalidSecret may be truncated — paste the full string
Request timestamp expiredClock skew; refresh and retry (usually transient)

Pre-live checklist ​

  • [ ] Strategy has been running on Paper for some time and performs as expected
  • [ ] /risk has max-drawdown and global stop-loss set
  • [ ] /backtest has been run
  • [ ] API Key ticks Read + Trade, NOT Withdraw
  • [ ] You are not on an unfamiliar network or public Wi-Fi when saving the Key
  • [ ] You know where the Panic button is (bottom of Sidebar)

Clearing stored keys ​

If you need to rotate or reset, click Clear stored keys at the bottom-left of the Configure modal. A confirmation pops up; confirming only clears the keys for the current mode + current exchange, the other mode is unaffected.

Common misconceptions ​

  • "My key works on OKX, why is it failing here?" — Most likely an IP whitelist or permission issue, not the Key itself
  • "I want two accounts running side by side" — Each account needs its own wallet; wallet address is the identity
  • "Paper went well, so live will too" — Liquidity and matching differ slightly from mainnet. Watch the first days after switching to REAL closely

TodoAI · Turn trading ideas into automated strategies