Introduction
Connecting your exchange API to a trading bot is the essential first step toward automated crypto trading. Whether you use Binance, Bybit, OKX, KuCoin, or Bitget, the process follows a universal pattern -- but each exchange has its own quirks that can trip you up. Having multi-exchange support means understanding how each platform handles API key creation, permissions, and security.
This guide provides a universal 5-step process for connecting any exchange API, exchange-specific notes for the top 5 exchanges, security best practices, and troubleshooting for the most common connection issues.
The Universal 5-Step Process
Regardless of which exchange you use, the API connection process follows these five steps:
Step 1: Enable Two-Factor Authentication (2FA)
Before creating API keys, ensure your exchange account has 2FA enabled. Most exchanges require this as a prerequisite for API access. Use an authenticator app (Google Authenticator, Authy) rather than SMS-based 2FA for stronger security.
Step 2: Navigate to API Management
Every exchange has an API management section, typically found under:
- Account Settings > API Management
- Security > API Keys
- Profile > API
The exact path varies by exchange, but the destination is the same: a page where you can create, view, and manage API keys.
Step 3: Create API Keys with Correct Permissions
This is the most critical step. When creating API keys:
Always enable:
- Read/View -- allows the bot to read your account balance and open positions.
- Trade/Order -- allows the bot to place and cancel orders.
Never enable:
- Withdraw -- a trading bot never needs withdrawal permission. Enabling this creates unnecessary security risk.
- Transfer -- unless you specifically need sub-account transfers.
Security options to configure:
- IP whitelist -- restrict the API key to specific IP addresses. This is the single most important security measure.
- Expiration -- some exchanges allow setting an expiry date. Use this if available.
- Label -- give the key a descriptive name (e.g., "Sentinel Bot - BTC Strategy").
Step 4: Securely Store Your Credentials
After creation, the exchange will display your API Key, Secret Key, and possibly a Passphrase. This is typically the only time you can view the Secret Key. Store these credentials securely:
- Use a password manager (1Password, Bitwarden, KeePass).
- Never share API keys via email, chat, or unencrypted channels.
- Never commit API keys to code repositories.
- Consider using separate API keys for different bots or strategies.
Step 5: Connect to Your Trading Bot
Paste the credentials into your bot platform. On Sentinel Bot, navigate to the exchange management section, select your exchange, enter the credentials, and test the connection.
Sentinel Bot uses a zero-knowledge architecture -- your API keys are encrypted and stored locally on your device, never on Sentinel's servers. This means even if Sentinel were compromised, your exchange credentials would remain safe.
Exchange-Specific Guides
Binance
Path: Account > API Management > Create API
Binance-specific notes:
- Binance requires you to choose between "System Generated" and "Self-Generated" keys. Choose System Generated for simplicity.
- Binance has separate permissions for Spot, Margin, and Futures. Enable the ones you need.
- IP restriction is mandatory for new API keys as of 2025. You must either restrict to specific IPs or select "Restrict access to trusted IPs only."
- If using Binance.US (US users), the API is different from global Binance. Ensure your bot supports Binance.US specifically.
- Binance has a 90-day key expiration policy for keys without IP restrictions.
Common Binance issues:
- "API key does not exist" -- ensure you are using the correct Binance domain (global vs US).
- "Timestamp for this request was 1000ms ahead" -- sync your system clock. Binance requires time accuracy within 1 second.
Bybit
Path: Account & Security > API Management > Create New Key
Bybit-specific notes:
- Bybit separates permissions by product: Unified Trading, Derivatives, Spot.
- For Unified Trading Account (UTA) users, enable "Unified Trading" permission.
- Bybit API keys expire after 90 days by default. Set a reminder to renew.
- Bybit supports both HMAC and RSA key types. HMAC is simpler and works with most bots.
- Rate limits: Bybit has aggressive rate limits on certain endpoints. If your bot trades many pairs, monitor for 429 errors.
Common Bybit issues:
- "Invalid API key" -- check that the API key status is Active, not Expired.
- Permission errors -- ensure UTA permissions are enabled if your account is UTA.
OKX
Path: Account > API > Create API Key
OKX-specific notes:
- OKX requires a Passphrase in addition to API Key and Secret Key. This passphrase is needed for every API call, so store it carefully.
- OKX has three permission levels: Read, Trade, and Withdraw. Select Read + Trade only.
- OKX supports sub-accounts with separate API keys, which is useful for isolating bot strategies.
- IP restriction is optional but strongly recommended.
- OKX uses a different API endpoint for Demo Trading (
https://www.okx.comvshttps://aws.okx.com). Ensure your bot connects to the correct one.
Common OKX issues:
- "Invalid passphrase" -- the passphrase is case-sensitive. Copy-paste rather than retyping.
- Sub-account permissions -- sub-account API keys need explicit permission grants from the master account.
KuCoin
Path: Account Security > API Management > Create API
KuCoin-specific notes:
- KuCoin also requires a Passphrase (separate from your login password).
- KuCoin has separate APIs for Spot and Futures. If you want to trade futures, you need to create keys specifically for the futures platform.
- Trading password is required during key creation -- this is the secondary password you set when enabling trading.
- KuCoin rate limits are more restrictive than other exchanges. Configure your bot to respect a conservative request rate.
Common KuCoin issues:
- "KC-API-KEY not exists" -- KuCoin Spot and Futures keys are different. Use the correct key for the correct API.
- IP binding issues -- KuCoin's IP whitelist can take a few minutes to propagate.
Bitget
Path: Account > API Management > Create API
Bitget-specific notes:
- Bitget requires a Passphrase (like OKX and KuCoin).
- Permissions include: Read, Trade, and (for some key types) Transfer.
- Bitget supports IP whitelist but does not mandate it. Enable it anyway.
- Bitget's API documentation is comprehensive but organized differently from other exchanges. Refer to the Bitget bot setup guide for specific configuration.
- USDT-M and Coin-M futures use different API endpoints.
Common Bitget issues:
- "Incorrect signature" -- usually a passphrase or secret key encoding issue. Ensure no trailing spaces in your credentials.
- Rate limit errors during high volatility -- Bitget throttles API access during extreme market moves.
Security Best Practices
API keys are the keys to your trading account. Treat them accordingly:
- Never enable withdrawal permissions. A trading bot should only read account data and place orders.
- Always use IP whitelisting. This ensures that even if your API key is compromised, it cannot be used from an unauthorized IP.
- Use separate keys for each bot. If one key is compromised, you only need to revoke that one.
- Rotate keys regularly. Replace your API keys every 60-90 days as a precaution.
- Monitor for unauthorized activity. Check your exchange's order history regularly for trades you did not authorize.
- Use a zero-knowledge bot platform. Sentinel Bot's architecture means your keys stay on your device, never on third-party servers.
Troubleshooting Common Issues
"Connection Failed" or "Invalid API Key"
Checklist:
- Verify the API key is active (not expired or disabled).
- Check for trailing whitespace in copied credentials.
- Ensure you are using the correct exchange (Binance vs Binance.US, for example).
- Verify that the required permissions (Read + Trade) are enabled.
- If using IP whitelist, confirm your current IP matches the whitelisted IP.
"Insufficient Permissions"
Checklist:
- Verify "Trade" permission is enabled for the specific product (Spot/Futures/Unified).
- For exchanges with sub-accounts, ensure the API key belongs to an account with trading access.
- Check if the exchange requires additional account verification (KYC) for API trading.
"Timestamp Error" or "Request Expired"
API requests include a timestamp that must be close to the exchange server's time. If your system clock is off by more than a few seconds:
- Sync your computer's clock with an internet time server.
- On Windows: Settings > Time & Language > Sync now.
- On Mac/Linux:
sudo ntpdate pool.ntp.org. - If running a bot on a VPS, ensure NTP is configured and running.
"Rate Limit Exceeded" (HTTP 429)
Your bot is making too many API requests:
- Reduce the polling frequency for account updates.
- Use WebSocket connections instead of REST polling where possible.
- Batch order operations when supported.
- Check your bot platform's rate limiting settings.
Testing Your Connection
After connecting, verify everything works:
- Read test: Check that your bot can see your account balance.
- Order test: Place a small limit order well below market price, verify it appears on the exchange, then cancel it.
- Position test: Open a small position and verify it shows in both your bot and the exchange UI.
- Error handling: Intentionally disconnect your internet briefly to see how the bot handles connection drops.
Conclusion
Connecting your exchange API is a one-time setup that unlocks the full power of automated trading. By following the universal 5-step process, applying exchange-specific configurations, and adhering to security best practices, you can have a secure, reliable connection running in under 15 minutes.
Sentinel Bot supports all five major exchanges covered in this guide, with a zero-knowledge architecture that keeps your credentials safe. Create your free account and connect your first exchange today.
Disclaimer: This article is for educational purposes only and does not constitute financial advice. Cryptocurrency trading involves substantial risk of loss. Past performance and backtesting results do not guarantee future results. Always trade with capital you can afford to lose and conduct your own research before making trading decisions.