Trading ToolsSecurity Guide 2026

Crypto Trading Bot API Setup: How to Connect to Bybit and Binance

Setup takes under 5 minutes. The one rule: trade-only permission, NEVER withdrawal. If keys leak, worst outcome is bad trades — funds cannot leave your exchange. This guide covers Bybit + Binance setup, IP whitelist, sub-account isolation, and connecting 3Commas, Cryptohopper, and Bitsgap.

Ron Nguyen — crypto derivatives trader

By Ron Nguyen — derivatives trader since 2020

April 28, 2026  ·  Security-first API guide  ·  8 min read

Updated 2026
Security-first approachApril 28, 20268 min readCoinmonks 2026 · Cryptowisser 2026
Crypto Trading Bot API Setup — Connect to Bybit and Binance 2026 by Ron Nguyen

Security-First Setup — April 2026 · Ron Nguyen

API setup takes under 5 minutes. The one rule that matters: trade-only permission, NEVER withdrawal. If your keys leak, the worst outcome is bad trades — funds cannot leave your exchange. This guide covers Bybit + Binance setup, IP whitelist, sub-account isolation, and connecting 3Commas, Cryptohopper, and Bitsgap.

Start with Bybit — Best for Bot Trading

0.02% maker fee · 400+ perpetuals · Native grid/DCA bots · No API needed for native bots

Open Bybit Account →
Foundation

What Is an API Connection?

API keys let a bot trade on your exchange — funds stay on Binance/Bybit, never move to the bot platform.

When you connect a bot like 3Commas or Cryptohopper to Bybit, your funds never leave Bybit. The bot platform gets two keys: an API Key that identifies your account, and a Secret Key that signs each request. The bot sends a signed request → Bybit verifies the signature → executes the trade. Your funds stay on Bybit the entire time.

Rate limits matter for high-frequency bots: Binance allows approximately 1,200 requests per minute — exceeding this triggers a 429 error and a temporary IP block (Cryptowisser 2026). Most retail bots stay well under this limit, but it's worth knowing if you run multiple bots on the same key.

API Permission Types — What Each Does

Read

View balances, positions, order history. Safe to enable always.

SAFE
Trading / Spot

Place and cancel spot orders. Required for spot bots.

SAFE
Futures / Margin

Place futures/margin orders. Enable only if bot needs it.

SAFE
Withdrawal

Move funds off the exchange. NEVER enable for any bot.

DANGER
Asset Transfer

Move funds between sub-accounts. Disable unless specifically needed.

DANGER

The One Rule

NEVER enable Withdrawal permission on any API key used by a bot. With trade-only keys, even if your keys are compromised, an attacker can only make bad trades — they cannot move your funds off the exchange. This single rule eliminates the catastrophic risk scenario.

Step-by-Step

Bybit API Setup

Account Security → API Management → Create Key → trade-only → IP whitelist. Under 3 minutes.

Bybit has the cleanest API setup flow of any major exchange. The whole process takes under 3 minutes if you have your bot platform's IP addresses ready. Get those IPs first — I'll show you where to find them in the next section.

1

Login bybit.com → Account Security → API Management → Create New Key → System-generated

Use System-generated keys — not user-defined. System keys are cryptographically stronger.

2

Enable: Contract Orders + Spot Trading. DISABLE: Asset Transfer + Withdrawal

Double-check Withdrawal is OFF before saving. This is the single most important step.

3

IP Restriction: enter bot platform IP, enable trusted IPs only

Get the IP from your bot platform's security docs before creating the key. Whitelist ALL listed IPs.

4

Label the key (e.g. '3Commas-Bot-1'), complete 2FA verification

Use descriptive labels — you'll thank yourself when auditing keys 90 days later.

5

Copy Key + Secret immediately — Secret is shown only once

Store in a password manager (Bitwarden, 1Password). Never in Notion, Google Docs, or plain text.

Bybit API Management — permissions setup showing trade-only configuration with withdrawal disabled

Bybit API Management — enable Contract Orders + Spot Trading, disable Asset Transfer + Withdrawal

Don't have a Bybit account yet?

Sign up in 2 minutes — 5-min KYC, 20,000 USDT demo account included

Create Bybit Account →
Step-by-Step

Binance API Setup

Profile → API Management → Create API → Spot & Margin only → IP whitelist. NEVER enable Withdrawals.

Binance's API setup is slightly more involved than Bybit's, but the same principles apply. One important Binance-specific note: changing permissions on an existing key requires deleting and recreating it. Get the permissions right the first time.

1

Login → Profile → API Management → Create API → System Generated

System Generated is more secure than User Defined. Always use this option.

2

Enable: Reading + Spot & Margin. Futures bot: also enable Futures. NEVER Withdrawals

"If keys leaked, hacker can only make bad trades, not steal funds" — Coinmonks 2026. This is why trade-only matters.

3

IP Restriction: trusted IPs → enter bot IP → 2FA → copy immediately

Binance note: changing permissions requires deleting and recreating the key. Get it right the first time.

Binance API Management — permissions setup showing spot and margin enabled, withdrawal disabled

Binance API Management — enable Reading + Spot & Margin, disable Withdrawals, add IP restriction

Coinmonks 2026 on Key Leaks

"If keys leaked, hacker can only make bad trades, not steal funds." — Coinmonks 2026. This is the entire point of trade-only permissions. A leaked trade-only key is annoying. A leaked withdrawal-enabled key is catastrophic.

Before You Create Keys

Find Your Bot Platform's IP Addresses

Bot platforms publish server IPs in security docs — whitelist ALL of them before creating keys.

This is the step most guides skip. You need the bot platform's server IPs before you create the API key on the exchange. Whitelist all of them — platforms often have multiple server IPs and rotate them. If you miss one, the bot will fail to connect intermittently.

3Commas
Find IPs:Settings → Exchanges → "Our IP addresses"
Connect:My Exchanges → Add Exchange → select exchange → paste credentials → Connect
Note:Set default futures leverage here after connecting.
Cryptohopper
Find IPs:Settings → Account → API whitelist IPs
Connect:Account → Exchange → Add → paste → test
Note:Warns if withdrawal permission is enabled — take that warning seriously.
Bitsgap
Find IPs:Account settings → connected exchanges
Connect:Connect Exchange → paste → Verify
Note:Auto-warns if withdrawal detected. Always run a test order after connecting.

Troubleshooting Connection Failures

If the bot fails to connect after setup: temporarily disable IP restriction on the key to confirm the credentials are correct. If it connects without IP restriction, the issue is a missing IP in your whitelist. Re-enable IP restriction after adding the correct IPs — never leave it disabled permanently.

Advanced Security

Sub-Account Isolation

Create a dedicated sub-account for your bot — limits damage if key compromised, isolates P&L.

This is the setup I use personally. A sub-account dedicated to bot trading means that even in the worst case — a compromised key — the attacker only has access to the capital you transferred to that sub-account. Your main account is completely untouched. It also gives you clean P&L tracking: you can see exactly what the bot is making or losing without it mixing with your manual trades.

Sub-account isolation flow — master account separated from bot sub-account for security

Sub-account isolation — bot capital separated from master account

Sub-Account Setup Process

1

Create sub-account

Binance: Account → Sub Account → Create (max 200 sub-accounts). Bybit: Account → Sub Account → Create (max 20 sub-accounts).

2

Transfer only bot capital

Move only the capital you want the bot to trade. Keep the rest in your master account.

3

Create API keys on sub-account only

Log into the sub-account and create the API key there. Never create bot keys on your master account.

4

Connect bot to sub-account key

Paste the sub-account API key into your bot platform. The bot now only has access to the sub-account.

Compromise = sub-account only

If keys leak, attacker only accesses the sub-account capital. Master account untouched.

Clean P&L tracking

Bot performance is completely isolated from manual trades. No mixing.

Stop bot without touching master

Pause or revoke the bot's key without affecting any other trading activity.

Different leverage per sub-account

Bybit allows different leverage settings per sub-account — useful for running multiple strategies.

Platform Connection

Connect to 3Commas, Cryptohopper, Bitsgap

All three: add exchange → paste Key + Secret → verify → test paper trade. Same process.

The connection process is nearly identical across all three platforms. The key difference is where each platform warns you about dangerous permissions — Cryptohopper and Bitsgap both auto-detect withdrawal-enabled keys and warn you. 3Commas does not, so you need to verify manually.

3Commas — Connection Steps

My Exchanges → Add Exchange → select exchange → paste credentials → Connect

Set default futures leverage here after connecting.

Cryptohopper — Connection Steps

Account → Exchange → Add → paste → test

Warns if withdrawal permission is enabled — take that warning seriously.

Bitsgap — Connection Steps

Connect Exchange → paste → Verify

Auto-warns if withdrawal detected. Always run a test order after connecting.

Always Run a Test Order

After connecting any bot platform, run a test order — even a $1 market buy and immediate sell. This confirms the API key is working, the permissions are correct, and the bot can actually execute trades. Don't skip this step. A key that looks connected but fails silently will miss your first real trade signal.

Reference Table

Permissions by Bot Type

Spot bots need Spot Trading; futures bots need Futures; no bot ever needs Withdrawal.

Use this as your reference when setting up any new bot. Enable only what the bot actually needs — minimum permissions = minimum risk. Audit all active keys monthly and revoke any with Withdrawal enabled immediately.

API Permissions Matrix by Bot Type

Bot TypeReadSpotMarginFuturesWithdrawal
Spot Grid / DCA BotNEVER
Futures / Perps BotNEVER
Margin DCA BotNEVER
Copy Trading BotNEVER
Withdrawal (ANY bot)

Monthly Audit Rule

Audit all active API keys monthly. Check the "Last Used" timestamp on each key. Any key unused for 14+ days should be investigated — either the bot stopped working silently, or the key is no longer needed. Revoke any key with Withdrawal enabled immediately, regardless of when it was last used.

Ongoing Security

Key Rotation

Rotate every 90 days; revoke immediately on any suspicious activity.

Key rotation is the security practice most bot traders skip until something goes wrong. The 90-day cycle is a reasonable balance between security and operational overhead. If you notice any unusual trading activity — orders you didn't place, positions you don't recognize — revoke the key immediately and investigate before creating a new one.

90-Day Rotation Process

1

Create new API key on the exchange

Same permissions as the old key. Same IP whitelist. Label it with the date: 'Bot-3Commas-2026-07'.

2

Update credentials in bot platform

Paste the new Key + Secret into your bot platform. Test with a small order to confirm it works.

3

Verify bot is running on new key

Check the bot executed at least one trade or heartbeat on the new key before deleting the old one.

4

Delete the old key

Once confirmed working, delete the old key from the exchange. Don't leave unused keys active.

Check "Last Used" weekly

Unused 14+ days = investigate. Either the bot stopped silently or the key is orphaned.

Password manager only

Store keys in Bitwarden or 1Password. Never plain text, Notion, Google Docs, or screenshots.

One key per platform

Separate key for 3Commas, separate for Cryptohopper. Enables clean revocation per platform.

Common Questions

FAQ

Not with trade-only permissions. An API key without Withdrawal permission cannot move funds off the exchange — it can only place and cancel orders. Even if your API key is completely compromised, the attacker can only make bad trades on your behalf. Your funds cannot leave Bybit or Binance. This is why the single most important rule is: never enable Withdrawal permission on any bot API key.

Risk Disclaimer — This article represents Ron Nguyen's personal experience and opinions based on publicly available research (Coinmonks 2026, Cryptowisser 2026). It is not financial advice. Automated trading bots do not guarantee profit. Crypto markets are highly volatile. API key security is your responsibility — always verify permissions before saving. Only risk capital you can afford to lose entirely. Ron Nguyen, April 28, 2026.