Connect an exchange: the API key, step by step
Every screen on OKX and Binance, drawn, with the film and A9's IP line.
The key you make lets A9 place orders in your own account and nothing else. It cannot withdraw or transfer, and it is bound to A9's server addresses, so it is useless to anyone else even if it leaks. A9 connects to OKX and Binance; you can add a key for either or both.
What the key may and may not do
- Trade: on. On OKX tick Trade (and Earn if you want the Flywheel); on Binance tick "Enable Spot, Margin & Stock Trading", plus Enable Futures if a bot will short.
- Withdraw: off. A key that can withdraw is refused when you save it, and nothing is stored.
- A read-only key is refused too: a bot has to be able to place orders.
- IP list: A9's addresses only. The key then works only from A9's servers.
A9 stores the key encrypted. After you save it, the secret and passphrase are never shown again, and the list shows the key only as its first and last four characters.
Before you create it
- OKX: switch the account to one-way position mode (Trade → Futures → ··· → Settings → Position mode → One-way).
- OKX: accept both stock risk notices, Spot and Perpetual. The simplest way is to place a limit order far below the market on xSOXL/USDT and on SOXLUSDT, accept the notice each one shows, then cancel the orders. A sub-account must do this on its own.
- Binance: set one-way mode in Futures settings. On a classic account, futures use a separate wallet, so move USDT there if a bot will short.
- Put USDT in the trading account. The ready-made bots on the getting-started panel need about 500 USDT.
OKX, in short
- Profile menu → More → API → Create API Key. Name it (for example a9) and choose API trading.
- Tick Trade and Earn and nothing that moves money; leave Transfer and Loan off. Markets: Spot & Margin and Perpetual.
- Add every crypto with + Add → Select all → Confirm.
- Turn on Trusted IP addresses and paste A9's line in one go.
- Set a passphrase (8 to 32 characters, with upper and lower case, a number and a symbol) and submit. You will need this passphrase again on A9; it is not your login password.
- Enter the email code, open the key's row and use Copy credentials, or take a screenshot of that page.
Binance, in short
- Search "api" → API Management → Create API → Self-generated. A9 accepts only self-generated Ed25519 keys; a system-generated key is refused.
- On A9, press "Generate an Ed25519 key" on the Exchange keys page and use Copy public key. Paste the whole public key into Binance, give the key a label and confirm with your codes.
- Copy the API key Binance shows back into A9. There is no secret and no passphrase on Binance. The private key is shown once on A9; it is stored with the key when you save.
- A new Binance key is read-only, so press Edit: tick "Enable Spot, Margin & Stock Trading" (and Enable Futures to short), leave Enable Withdrawals off, choose "Restrict access to trusted IPs only", paste A9's addresses and save.
A9's addresses
Production calls the exchanges from a fixed block of 16 addresses, 4.144.67.208/28, plus one more address. Use Copy all on the keys page and paste the whole line: OKX takes the block as one range entry, while Binance needs every address written out, which is how A9 shows it there. A missing address is the most common reason a key fails.
Save and check it
- Me → Trading → Exchange keys. Pick OKX or Binance and an Account: the main account or a sub-account. Choosing a slot that already has a key replaces it.
- Paste the key and secret (OKX's Copy credentials text fills both boxes; the passphrase is always typed), then press "Verify & store".
- A9 runs its checks and lists them with a tick, a "!" when something needs fixing, or a "?" when it could not be read: withdrawals disabled, trade permission, one-way position mode, USDT available and, on Binance, the derivatives permission and IP list.
- Fix any "!" item on the exchange and press Re-check. When everything passes the key reads "Ready to trade: every check passed."
Two OKX items cannot be read through the API, so A9 asks you to confirm them yourself: both stock risk notices accepted, and every crypto added with Select all.
If something goes wrong
- "Wrong passphrase": it is the passphrase you set on the key, not your OKX login password.
- OKX refused our address, or Binance error -2015: the key's IP list is missing some of A9's addresses. Edit the key, paste the full line again and save.
- The signature failed: the secret was copied wrongly. OKX shows the secret only once; if it is lost, create a new key.
- Binance says the key is not Ed25519: delete it on Binance and create a Self-generated key as above.
- A bot on an OKX stock stops with "Action required… accept the disclaimer": a stock risk notice has not been accepted on that account or sub-account.
- To retire a key, press Remove on its row. It is deleted at once. Stop the bots that use it first, and delete the key on the exchange as well.
Pick your exchange below and follow the screens; the last step takes you to the keys page to enter it.
1Prepare the account
Optional — 3 more, only if they apply to you
- 1The quick way: apply A9's settingsOpen the link on this page while signed in to OKX and tap Apply settings. OKX replaces your trading mode, preferences and chart layout with A9's, not only the position mode. If you have your own setup, use the next screens instead.
- 2By hand: open Settings from the trade pageOn the Trade tab choose Futures, tap ··· at the top right, then Settings.
- 3Open Position modeUnder Trading mode, tap Position mode.
- 4Choose One-way modePick One-way mode. OKX will not change it while you have open futures orders or positions, so close those first.
- 5Spot: find xSOXLTrade → Spot, search SOXL, open xSOXL / USDT.
- 6Spot: place a test order far below the marketTap Buy, switch the order type to Limit order, set price 150 and amount 1, then tap Buy xSOXL. Not a market order — that one fills. At 150 the order rests below the market and never fills; it is there only to raise the notice.
- 7Spot: accept the risk noticeThe Risk notice opens: tick the confirmation, Agree and continue.
- 8Spot: cancel the test orderUnder Orders tap Cancel at once. That far below the market it never fills.
- 9Perpetual: find SOXLUSDTStock perpetuals have their own notice. Trade → Futures, search SOXL, open SOXLUSDT Perpetual.
- 10Perpetual: a test order raises the noticePlace a limit open long far below the market — price 150, amount 1. The Risk notice for stock contracts opens: tick the box, Agree and continue.
- 11Perpetual: cancel the test orderCancel it at once under Orders. Done — bots can now trade both. Using a sub-account? Repeat there.
2Create the key on OKX, bound to A9's IP
On OKX, make an API key that can trade and cannot move money — the trusted IPs are on the same form. Then paste the key back here; A9 checks it at once.
- 1Open the menu and find APIIn the OKX app, tap the menu at the top left, scroll down to More and open API.
- 2Create an API keyTap Create API Key at the bottom.
- 3Give it a nameAny name works, such as a9. Leave the purpose as API trading.
- 4Tick Trade and Earn, and nothing that moves moneyTick Trade and Earn (the Dual Investment flywheel needs Earn). Under Markets keep Spot & Margin and Perpetual. Leave Transfer and Loan unticked.
- 5Add every crypto to the keyStill under Trade, tap + Add next to Crypto, then Select all and Confirm. A key with no crypto selected cannot place an order.
- 6Turn on trusted IPs and add A9'sSwitch on Trusted IP addresses and paste the line below into it.
- 7Set a passphrase, then submitMake one up: 8 to 32 characters with upper and lower case, a number and a symbol. Keep it, because A9 asks for it. Then tap Submit all.
- 8Confirm with the code OKX emails youEnter the 6-digit code OKX emailed you. OKX then opens a sheet that says the key is Created.
- 9Tap the new key in the sheetOn the Review your API Key sheet, tap the key's row — not OK. It opens the key's own page with the credentials in the clear. (To find it again later: API list → the key → View credentials, then your passphrase.)
- 10Copy the credentials — or screenshot this pageTap Copy credentials — one tap copies the key and the secret together (or just screenshot this screen: A9 reads its QR code). Back in A9, tap Enter the key below and paste into any box, or upload the screenshot.
3Enter the key on A9
Tap Copy credentials — one tap copies the key and the secret together (or just screenshot this screen: A9 reads its QR code). Back in A9, tap Enter the key below and paste into any box, or upload the screenshot.
Enter the key →