How to Connect Your Exchange API Safely: A Beginner's Checklist
To connect an exchange API safely, scope the key so a bot can trade but never withdraw. In order:
- Create a new, dedicated API key for this bot only.
- Enable trade permission, and leave withdrawal OFF.
- Add an IP whitelist so the key works only from the bot's server.
- Save the secret once, then rotate or revoke it if anything looks off.
An exchange API key is a set of permissions you control, not a password to your account.
A trade-only key lets a bot open and close positions. It cannot move your coins off the exchange or change your login.
So the whole thing comes down to one switch.
Grant trade, deny withdrawal, and the worst a rogue bot or a leaked key can do is place bad trades you can see and stop. It can never empty your account.
Flip the switches below the way you would on your exchange, and watch the safety score move.
A key is a permission slip you write. You decide what the bot can touch, and you can revoke it in one click.
One honest caveat: this protects your coins, not your P&L.
A trade-only key stops theft, not a bad trade, and no API setting removes market risk.
What an exchange API key actually gives a bot
An API key is a set of permissions, not a password. You set them per key, and a trading bot only ever needs two of the three: it is a labelled key to one room, not the master key.
Read lets a bot see your balances and prices. It can look, never act.
Trade lets it buy, sell, open and close. That is the whole job of a trading bot.
Withdrawal lets it send your coins off the exchange. A trading bot never needs this, so you never grant it.
Your coins never leaving your own exchange is the non-custodial model, the safety floor you should refuse to go below. More in custodial vs non-custodial trading bots.
The one permission you must never enable (withdrawals)
Never enable withdrawal permission on a trading-bot key. It is off by default, a bot does not need it to place a single trade, and it is the one setting that turns a survivable mistake into a total loss.
If a bot insists it needs withdrawal access to work, that is the red flag. Close the tab.
A trade-only key that leaks is a headache. A key with withdrawal enabled that leaks is a disaster: not a percentage of your funds, but all of them.
This is not hypothetical. In December 2022, the bot platform 3Commas was breached: attackers leaked roughly 100,000 customer API keys, and around $20 million in user funds was drained.
The keys that got emptied had one thing in common: they allowed more than trading.
Read the last number twice. A key with withdrawals off can move nothing, no matter who holds it. Users who had scoped to trade-only kept their coins.
You cannot control whether a platform gets breached. You can control whether a leaked key can take your money.
Creating a restricted API key, step by step
Open your exchange's API settings, generate a new key, tick trade only, leave withdrawal disabled, add an IP whitelist, and save the secret once. On Binance, Bybit, Coinbase and Kraken alike it takes about five minutes.
The screen differs by exchange, but the switches are the same. We walk the venue steps in the best trading bot for Bybit and the best trading bot for Binance.
What to do if your API key is compromised
Revoke the key on your exchange immediately, then create a fresh one and re-scope it to trade-only. Revocation is instant and one click. If withdrawals were off, you have a scare, not a loss.
If a bot ever pressures you to loosen these settings, read how to spot a crypto trading bot scam before you touch anything.
For the bigger picture, read the pillar guide, grid trading bots explained.
This article is educational, not financial advice. Crypto is high-risk and you can lose money with any automated strategy. No API setting removes market risk. Confirm permissions on your own exchange before connecting anything.
This whole post argues for a key that can trade but never withdraw.
That is the only key TRAPR will ever ask you for: trade-only, with withdrawals disabled at the key level, so it places trades but can never move your coins. The core runs unleveraged, with no liquidation cliff, and every plan from the free Accumulator up connects the same way.
It cannot cash you out, because the permission to do so was never granted. Verify the setup yourself, then start free.
Illustration only. Not a real backtest, not a return promise, and not financial advice.
Common Questions About Connecting an Exchange API
Is it safe to give a trading bot my API keys?+
Can a bot withdraw my crypto with an API key?+
Should I give a trading bot withdrawal permission?+
How do I connect an exchange API to a bot?+
What happens if my API key is leaked or stolen?+
Do I need to whitelist an IP for my API key?+
Is 3Commas safe now after the 2022 breach?+
- CoinDesk and Cointelegraph (December 2022). An anonymous account leaked tens of thousands of 3Commas customer API keys; the company confirmed the breach, with reports of roughly 100,000 keys exposed.
- SiliconANGLE and Halborn breach analysis (December 2022 / 2023). Compromised 3Commas API keys were used to steal an estimated $20 million from affected users; keys scoped without withdrawal permission were not drained.
- Major exchange API documentation (Binance, Bybit, Coinbase, Kraken), 2026. API keys can be scoped per permission (read, trade, withdraw), withdrawal is separate and off by default, and IP whitelisting is supported.
- Bybit Learn, "How to Create a Bybit API Key" (2026). Keys can be scoped to read and trade only; withdrawal is not recommended for a trading bot; keys without an IP whitelist expire after three months.
- TRAPR (TAP) published strategy fact-sheet. Non-custodial by design, trade-only key, withdrawals disabled at the key level; an unleveraged core with no liquidation cliff, leverage optional and off by default, 3 safety orders as the default.