STA / Blog / Guides

Exchange API keys: what they are and how to use them well

Gopal SinghGopal Singh, co-founder of STA · 22/11/2026 · 6 minutes read
Two old iron keys on a ring: exchange API keys open only the doors you created them for, if you choose the permissions well
In short. Exchange API keys are a pair of codes that lets a program read your account or operate on it, without knowing your password. Each key has separate permissions, usually read, trading and withdrawal. The rule that protects you most is to grant only what is needed, bind the key to an IP address and revoke it at the first doubt.

What are exchange API keys and what are they for?

A API key is an authorization you create yourself, inside your account on an exchange, to let a program talk to that account. The program can be a bot, a signals service, an app that keeps your portfolio in order or tax software. Instead of your password you hand it two codes: the key itself and a secret. On many exchanges a third is added, a passphrase chosen by you.

The advantage is simple. Your password opens everything, while an API key opens only what you decide. That is why it is the right tool for any external software, and why it is worth understanding the permissions well before you press «create».

Which permissions can an API key have?

The names change from one exchange to another, but the categories are almost always these, and you switch them on one by one.

PermissionWhat it allowsRisk if the key ends up with a stranger
ReadSeeing balance, positions, orders and history.It sees your data, it moves nothing.
TradingOpening and closing orders.It can place trades in your place, even losing ones.
WithdrawalMoving funds to other addresses.It is the most delicate: it can take money out.

The principle to keep in mind is called least privilege: each key has only the permissions its task needs, and not one more. An app that only has to show you your balance needs read access. A service that operates on your account needs trading as well. Withdrawal is a separate permission: if a service asks for it, it has to tell you which exact function needs it, and that explanation has to be written on a public page. How it works in detail on OKX is in the guide to OKX API key permissions.

How do you create an API key in an orderly way?

The procedure is in your account settings, in the section dedicated to APIs. The habits that matter are few.

  1. One key for each service. If one day you revoke one, the other services keep working.
  2. A name that makes sense. «Signals, read and trading» says more than «key 3», especially six months from now.
  3. Only the permissions that are explained. If you cannot say what a permission is for, leave it off.
  4. Copy the secret right away. Many exchanges show it only once. Store it in a password manager, not in a chat and not in a file on your desktop.
  5. Test first, real money after. If the service has a test account, connect it there first.

What is the IP address list and why is it worth using?

An IP address is, in simple words, the number that identifies the computer or server a request comes from. When you bind a key to an address, the exchange accepts requests only from there. If someone copies the key and tries to use it from somewhere else, they are turned away.

It is one of the most effective protections, because it turns a stolen code into an almost useless one. Some exchanges make it close to mandatory: keys with trading or withdrawal permissions that are not bound to an IP can be deleted after a period of inactivity. Check your exchange's rules, because they change over time.

How do you recognize a service that handles your keys well?

A few questions to ask before pasting any code. Who runs the service and where do you find their details? Which permissions does it ask for, one by one, and what is each one for? Are the keys stored encrypted? Can you revoke them yourself at any time, without asking anyone's permission? Is there a history of operations you can check on your own, including the losing ones?

If an answer goes around in circles, stop. And remember a rule with no exceptions: no serious service asks you for your password, your two-factor verification codes or the key's secret in a chat, by email or over the phone. Whoever asks for them is trying to get in. For a wider picture of how to recognize who is trustworthy, there is the guide to serious trading platform, and to understand who holds your funds, the one onregulated crypto exchange.

What should you do if an API key is compromised?

Time matters more than precision. If you suspect a key has slipped out of your control, for example you pasted it in the wrong place or you see operations you do not recognize, follow this order.

  1. Revoke the key from the exchange. It takes a few seconds from the API page and makes the key useless at once.
  2. Check orders, positions and transactions. See whether anything was opened or moved, and close whatever you did not decide yourself.
  3. Change your password and check two-factor authentication. The problem may not be just the key.
  4. Create a new key with minimal permissions, bound to an IP, and reconnect the service.
  5. Write to the exchange's support if you see transactions you do not recognize.

For this reason a key with fewer permissions is a smaller problem: if it cannot withdraw, it cannot take funds out of the account, and with trading alone the damage is limited to the operations. It is still damage, which is why a loss limit on every position and cautious sizes are used as well, as the article on risk management in trading.

Are API keys also used by trading bots?

Yes, that is exactly how a bot connects to the exchange: it reads prices and sends orders through the key. That is why the security of the key matters as much as the quality of the strategy. An excellent bot with a key left lying around is still a risk, and a mediocre bot with wide permissions is an even bigger one. What these programs really do and what they promise is in the article on crypto trading bots, while the big picture of automation is in the guide to automated trading.

Where STA fits in

STA is a card service for crypto and US stocks on OKX: ten artificial intelligence agents analyze 175 markets on OKX Europe, including 44 US stocks and ETFs, twice a day, with a debate between a Bull and a Bear, and every card has its own stop. Your funds stay in your OKX account. The permissions requested from keys and their purpose are explained on the page about security, and before connecting a real account you can try everything with the DEMO, free forever, with real prices and the same cards as the REAL. You need an account. For now, web version only.

Frequently asked questions

What is an exchange API key?It is a pair of codes, created by you in your account, that lets a program read data or operate without using your password. Each key has separate permissions, such as read, trading and withdrawal, and you can revoke it at any time.
Which permissions should you give an API key?Only the ones the task needs. An app that shows your balance needs read access, a service that operates on the account needs trading as well. Withdrawal is the most delicate: switch it on only if the service explains in writing what it is for.
What should you do if an API key is compromised?Revoke it right away from the exchange's API page, check orders and transactions, change your password and verify two-factor authentication. Then create a new key with minimal permissions, bound to an IP address.
Telegram channel

STA's cards, including the ones that went wrong

Every card as soon as it closes, with the result and what STA learned from it. It's free and you don't need to sign up.

Follow the channel

See how STA thinks, without risk

A DEMO account with virtual capital and real prices, the same cards as REAL users.

Try DEMO for free →

This article is for information only and is not investment advice. Trading crypto-assets involves a high risk, including the total loss of the capital used. Numerical examples are for illustration.

Keep reading
Sign inTry DEMO