Sometimes, when you create a bot in TradeSanta, you might see the error “Invalid API Key.”
In this case, the bot won’t start trading, and the bar below the “Stop Bot” option turns red, showing the same message — Invalid API Key.
So what does this mean, and how can you fix it?
⚙️ What Causes the “Invalid API Key” Error
This error usually means that your API key was created with incorrect permissions or that the IP whitelist wasn’t set properly when connecting your exchange to TradeSanta.
In other words, the API key doesn’t allow TradeSanta to access trading data or execute trades due to missing or incorrect settings.
Let’s go through what you should check depending on the exchange you’re using.
🟡 Binance
If you connected Binance and saw “Invalid API Key,” please verify the following permissions on your API Management page in Binance:
Required permissions:
- ✅ Enable Reading — must be turned on
- ✅ Enable Spot & Margin Trading — must be turned on
- ❌ Enable Withdrawals — must be off
- ❌ Enable Symbol Whitelist — must be off
- 🔒 IP address restrictions:
- Should be Restricted with TradeSanta’s IP whitelist for added security
You can find your unique IP list in your TradeSanta account under
Your exchanges → Binance → IP List.
Make sure all IPs are copied and pasted into the “Restrict access to trusted IPs only” field on Binance.
If the whitelist is missing or incorrect, the API key will not work and the bot will show Invalid API Key.
You can find the full step-by-step setup here:
How to create API key on BinanceHow to enable IP whitelist on Binance/Binance Futures
🔵 HTX (Huobi)
If you’re using HTX (formerly Huobi), open your API Management page and check that your key permissions match the following:
Required permissions:
- ✅ Read-only — on
- ✅ Trade — on
- ❌ Withdraw — off
- 🌐 Bind IP address: remain empty
If your permissions were set incorrectly, or you no longer have the option to edit them, create a new API key and make sure to enable the correct options above.
You can find the full step-by-step setup here:
How to create API key on HTX⚫ OKX
If you’re connecting OKX, check your key permissions and settings carefully.
Common reasons for “Invalid API Key” on OKX include missing trade permission, wrong passphrase, or unconfigured IP whitelist.
Required permissions:
- ✅ Read — on
- ✅ Trade — on
- ❌ Withdraw — off
- 🧩 Passphrase: must match exactly the one you entered in TradeSanta
- 🌐 IP whitelist: blank
You can find the full setup guide here:
How to create API on OKX🧭 What to Do if the Error Persists
If your API key was created with the wrong permissions or IPs, and you can’t edit it anymore, please:
- Delete the old key in your exchange account.
- Create a new key with the correct permissions and IP whitelist.
- Reconnect your exchange in TradeSanta.
You can learn how to safely replace your old API key with a new one here:
How to update access point with new API key✅ Final Checklist
Before reconnecting, make sure that:
- All required permissions are enabled (Read + Trade, no Withdraw).
- TradeSanta’s IPs are correctly added to the whitelist.
- Passphrase (for OKX) matches exactly.
- The API key and secret were copied correctly, without extra spaces.
Once all settings are correct, reconnect the exchange in TradeSanta — your bot should start trading successfully.