Home / Guides / API key permissions
Safe API key permissions on Binance, OKX and Bitget
This page answers: which permissions a trading tool's API key should have, whether to bind it to an IP address, whether to use a sub-account, and what to do first if a key leaks.
Enable read and trade. Never enable withdrawals. Bind the key to an IP if you can, and put it on a sub-account that only holds the money you are willing to let software trade.
Start from the worst case
An API key is a credential that works without your password or two-factor code. Whoever holds it can do anything its permissions allow. So don't ask "might I need this permission later?" Ask "if this key leaked today, what is the worst that could happen?"
For a trading tool the answer is always the same:
- Read: yes. Balances, positions and open orders depend on it.
- Trade: yes. Placing orders, cancelling them and placing stop-losses depend on it. For USDT-margined futures, enable the futures permission too.
- Withdraw: no. A trading tool never needs to move funds off the exchange. With this enabled, a leak can cost you the whole account, not just bad trades.
- Transfers, lending and anything else: only if you actually need them.
TonyTrade follows this rule. It needs read and trade only. When you connect a key it checks the permissions, and if withdrawals are enabled it refuses to use the key. Setup steps are on API key setup; the wider reasoning is on Safety design.
Permission names, side by side
Each exchange uses different labels. This table follows their official docs. Labels change with redesigns, so trust the screen you see when creating the key.
| Binance | OKX | Bitget | |
|---|---|---|---|
| Read | Enable Reading (on by default) | Read | Read-only |
| Spot trading | Enable Spot & Margin Trading | Trade (covers spot and futures) | Trade, under read/write |
| Futures trading | Enable Futures, a separate box | Included in Trade | Covered by trade permission, depending on account type |
| Withdrawals | Enable Withdrawals; requires an IP restriction first | Withdraw | Separate permission; withdrawals only from whitelisted IPs |
| Extra secret | None | Passphrase you choose; cannot be recovered, only replaced with a new key | Passphrase; if lost, delete and recreate the key |
One Binance detail: its docs note that a key created before you opened a futures account may not be able to enable futures later. If you plan to trade USDT-margined futures, open the futures account first. Check Binance's current docs for the exact conditions.
IP whitelists and how long a key stays valid
Binding a key to IPs means the exchange only accepts requests from those addresses. A leaked key is useless from anywhere else. All three exchanges recommend it.
What happens if you don't bind differs by exchange, and the rules change:
- Binance: its key-creation FAQ says withdrawals require an IP restriction. Binance deletes keys that have no IP whitelist and go unused for a long time; for the exact number of days, follow Binance's current docs. Which trading permissions an unrestricted key may hold has changed more than once; follow Binance's current docs.
- OKX: its API FAQ says keys with trade or withdraw permission and no IP binding expire after 14 days of inactivity. Only authenticated calls such as checking balances or placing orders count as use, and demo-trading keys are not affected. Each key can be bound to up to 20 IPs.
- Bitget: its docs strongly recommend binding an IP when creating a key, and withdrawals only work from whitelisted IPs. We could not find an official Bitget statement on whether unbound keys expire. Follow Bitget's current docs.
TonyTrade runs on your own computer and phone. Requests go from your network straight to the exchange, not through our servers, so the whitelist holds your own IP and nobody else's. See How it works.
Sub-accounts limit how much is at risk
Permissions limit what a key can do. A sub-account limits how much it can touch. Create a sub-account, move in only the funds meant for automated trading, and create the key under that sub-account.
- Binance: sub-accounts have separate balances. The master account's API management page creates and edits sub-account keys, and the master account controls transfers between them.
- OKX: choose the sub-account when creating the key. Use that sub-account's own key and passphrase; don't mix them with the main account's.
- Bitget: sub-accounts and sub-account keys are supported. Check Bitget's current docs for where to find them and any limits.
Then a leaked key or a software fault stays inside the sub-account. TonyTrade's fixed limits add another boundary: per-trade size, total exposure, maximum leverage, maximum daily loss, a coin whitelist and a daily order count. See Features.
Checklist when creating a key
- For futures, open the futures account first.
- Create a sub-account and fund it with only what you plan to trade.
- Create a new key under that sub-account with a clear name, such as "TonyTrade laptop".
- Tick read and trade (and futures if needed). Confirm withdrawals are off.
- If your IP is fixed, add it to the whitelist.
- The secret and passphrase are shown once. Paste them straight into the app. Don't keep them in chats, screenshots or cloud notes.
- Go back to the key list and check the permissions again.
TonyTrade encrypts the key and stores it in your operating system's keychain. It is never uploaded. What this website itself collects is on Privacy. Supported markets per exchange are on Exchanges.
If a key leaks
If you suspect a leak, treat it as a leak. Contain first, investigate second.
- Delete the key on the exchange. Deleting is more reliable than editing permissions. Use the exchange's API management page.
- Press stop-all in TonyTrade. Then check your positions and open orders on the exchange.
- Review activity. Look at recent orders, fills, transfers and withdrawals for anything you didn't do.
- Secure the account. Change the login password, check two-factor settings, remove unknown devices.
- Find the cause. A shared screenshot, a public code repository, malware? Fix it or the next key leaks too.
- Contact exchange support if anything looks wrong, with times and records.
- Once safe, create a new key using the checklist above.
More answers are on the FAQ, and trading risks are on Risk. Why stops belong on the exchange: Why stop-losses should sit on the exchange. Handling sudden spikes: Wicks and how to handle them. To hear when a TonyTrade version is available, leave your email. About the team: About. Back to the home page.
Sources
Official exchange pages cited here. Exchanges change their rules; the live page is what counts. Compiled by the TonyTrade team.
- Binance: How to Create API Keys on Binance (permission names, IP restriction for withdrawals, futures permission)
- Binance: How to Use an API Key Securely: 5 Tips From Binance (unused keys without an IP whitelist are deleted)
- Binance: Get API Key Permission
- Binance: Binance Sub-Account Functions and FAQ
- OKX: OKX API FAQ (Read / Trade / Withdraw, unbound keys expire after 14 days of inactivity, up to 20 IPs per key)
- OKX: OKX API v5 docs (key creation, passphrase)
- OKX: Subaccounts, Account Mode, and API Connections FAQ
- Bitget: Bitget API Quick Start (read-only vs read/write, withdrawals only from whitelisted IPs)
- Bitget: Bitget UTA Quick Start (lost passphrase means a new key)
- Bitget: API Key Terms of Use (IP whitelist recommended for all keys)