Skip to content

Security

Is It Safe to Give an API Key to a Trading Bot or Terminal? A Security Checklist

Updated Ninja Terminal team

Short answer

It is safe to give a trading tool an exchange API key only if the key is limited. Use trade-only permission with withdrawals off, restrict it to listed IP addresses, create a separate key per tool, rotate it on a schedule, and delete it when unused. Ninja Terminal stores keys encrypted with AES-256-GCM on your device.

Any tool that trades through an API holds a credential for your account. The risk is not that the tool exists, but how much that credential can do if it leaks. This checklist limits the damage. It applies to every exchange and every tool, including Ninja Terminal.

What are the rules for a safe trading API key?

# Rule Why it matters
1 Trade and read only A trading tool needs to read balances and place orders. Nothing else
2 Withdrawals off A key without withdrawal permission cannot move funds off the exchange
3 IP whitelist on The exchange rejects the key from any other address
4 One key per tool Revoke one tool without breaking others, and see which key misbehaves
5 Rotate on a schedule Limits how long a leaked key stays useful
6 Use sub-accounts for size limits Cap the funds a key can touch
7 Keep secrets out of chat, email, and screenshots These are the common leak paths
8 Delete unused keys An old forgotten key is still a live key

How do you apply them?

  1. Create the key with the minimum permissions. Turn on reading and trading for the markets you use. Leave withdrawal and transfer options off unless a feature clearly needs them.
  2. Add the IP whitelist before anything else. On some exchanges, extra permissions stay locked until IPs are set. Binance, for example, requires IP restrictions before it allows anything beyond Reading on a system-generated key.
  3. Name each key after the tool. “Ninja Terminal” is easier to audit than “key 3”.
  4. Create separate keys for separate tools. Do not paste one key into a bot, a terminal, and a portfolio tracker.
  5. Use sub-accounts where the exchange offers them. Fund a sub-account only with what the tool should risk. A key on that sub-account cannot touch the rest.
  6. Rotate keys. Create a new key, connect it, check that trading works, then delete the old key at the exchange.
  7. Test the connection. A connection test confirms the key works without placing an order.
  8. Review keys after any incident. If a device is lost or a secret appears somewhere it should not, delete the key at the exchange first, then create a new one.

Exchange rules differ. OKX, for example, deletes Trade or Withdraw keys that have no IP binding after 14 days of inactivity, and it lets you link up to 20 addresses per key. Hyperliquid works differently: you approve an API wallet instead of creating a key. See the exchange guides: Binance, OKX, Bybit, and Hyperliquid.

How does Ninja Terminal handle your keys?

  • Trade-only guidance. Setup tells you to keep withdrawal permissions off.
  • IP list during setup. For Binance, OKX, and Bybit, the Add Account flow shows an IP list with a copy button. You paste it into the exchange so the key works only from those addresses. The list is created for the account you are adding. Copy it from that screen for each account.
  • Local encrypted storage. Keys are encrypted with AES-256-GCM and stored on your device, in your browser.
  • Non-custodial. Orders execute on your own exchange account through the API. Funds never move to Ninja Terminal.
  • Device transfer and backup. You can move accounts to another device with a QR code or link protected by a PIN and an expiry. You can also export an encrypted backup protected by a passphrase and import it later.
  • Hyperliquid. Ninja Terminal asks for an API wallet private key and never accepts a main wallet private key.

More detail is on the accounts and key security page.

What does this not protect against?

A trade-only key cannot withdraw, but it can still place orders. A leaked key can open or close positions on your account until you delete it. Limit this risk with an IP whitelist, small sub-accounts, and fast deletion. Ninja Terminal is not an exchange, a custodian, or a broker, and nothing here is investment advice.

Frequently asked questions

Should an API key for a trading terminal have withdrawal permission?

No. Placing and canceling orders does not need withdrawal permission. A key without it cannot move funds off the exchange, even if the key leaks.

What is an IP whitelist for an API key?

It is a list of IP addresses the exchange will accept requests from for that key. A stolen key cannot be used from any other address.

How often should I rotate exchange API keys?

Rotate on a fixed schedule you will actually keep, and immediately after any suspected leak, lost device, or change of tools. Delete keys you no longer use.

Where does Ninja Terminal store my API keys?

On your device, in your browser, encrypted with AES-256-GCM. Funds never move to Ninja Terminal. Orders go to your own exchange account.

Trade every venue from one tab.

Binance, OKX, Bybit, and Hyperliquid with news, charts, and one-command orders. Included with Ninja Squad Pro membership.