TonyTrade.net

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.

BinanceOKXBitget
ReadEnable Reading (on by default)ReadRead-only
Spot tradingEnable Spot & Margin TradingTrade (covers spot and futures)Trade, under read/write
Futures tradingEnable Futures, a separate boxIncluded in TradeCovered by trade permission, depending on account type
WithdrawalsEnable Withdrawals; requires an IP restriction firstWithdrawSeparate permission; withdrawals only from whitelisted IPs
Extra secretNonePassphrase you choose; cannot be recovered, only replaced with a new keyPassphrase; 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.
Binding an IP for software on your own computer. Home connections often change their public IP. If yours is fixed, bind it. If not, a bound key stops working when the IP changes and you will need to update the whitelist. If you leave it unbound, accept the expiry rules above and be even stricter about never enabling withdrawals.

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

  1. For futures, open the futures account first.
  2. Create a sub-account and fund it with only what you plan to trade.
  3. Create a new key under that sub-account with a clear name, such as "TonyTrade laptop".
  4. Tick read and trade (and futures if needed). Confirm withdrawals are off.
  5. If your IP is fixed, add it to the whitelist.
  6. The secret and passphrase are shown once. Paste them straight into the app. Don't keep them in chats, screenshots or cloud notes.
  7. 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.

  1. Delete the key on the exchange. Deleting is more reliable than editing permissions. Use the exchange's API management page.
  2. Press stop-all in TonyTrade. Then check your positions and open orders on the exchange.
  3. Review activity. Look at recent orders, fills, transfers and withdrawals for anything you didn't do.
  4. Secure the account. Change the login password, check two-factor settings, remove unknown devices.
  5. Find the cause. A shared screenshot, a public code repository, malware? Fix it or the next key leaks too.
  6. Contact exchange support if anything looks wrong, with times and records.
  7. Once safe, create a new key using the checklist above.
No withdraw permission does not make a leak harmless. Someone can still use trade permission to place bad orders, for example buying high and selling low on an illiquid coin. Sub-accounts and IP whitelists exist for this case.

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.