Binance API Key Permissions and IP Whitelist: What Each Setting Allows, and What to Do After a Leak
On Binance, the permission boxes you tick and the IP restriction you set look like two separate settings, but the rules tie them together: a system-generated key with no IP restriction can only read, and withdrawals can't be switched on until you add an IPv4 restriction. The first rule has applied since 2023-01-30 00:00 (UTC); both are in Binance's current Help Center article (checked November 2026). If you want a tool to trade for you without binding an IP, Binance lists exactly three ways out: add an IP restriction, switch to a self-generated Ed25519 or RSA key, or disable the default security controls. Below, the two settings are taken one at a time, what each stops and what it doesn't, followed by how to read error -2015 and what to do after a leak.
Two settings inside one key
An API key lets a program talk to Binance as you. Binance offers two kinds. A system-generated key uses HMAC symmetric encryption, and you get two strings back: the API Key and the Secret Key. A self-generated key uses Ed25519 or RSA: you create the public-private key pair yourself with third-party software and give Binance only the public key. Whichever kind a tool holds, it can act within whatever the key's settings allow.
Two settings decide what a leak costs you, and they tend to get blurred together:
- Permissions decide what the key can do: read, trade, withdraw, transfer. Whatever is ticked, whoever holds the key can do.
- The IP restriction decides where the key works: once you list IPv4 addresses, requests from anywhere else are refused.
They fail in different ways. Permissions don't care who is using the key; they only cap what that person can do. An IP restriction can't stop a request coming from an address on your list, so if the server running your tool is breached, the attacker is already standing inside the whitelist. When a key goes wrong, it's usually permissions opened wider than needed plus a secret that got out. To check the keys you already have, tick through the API Permission Risk Check.
Permissions: what the key is allowed to do
The permission flags in Binance's developer docs (the Get API Key Permission endpoint) map to these switches: reading, spot and margin trading, withdrawals, internal transfer between master and sub-accounts, universal transfer, futures, and vanilla options. A few more cover Portfolio Margin and the FIX API, which everyday tools don't touch. The rule stays simple: tick only what the tool actually uses.
- Prices, bookkeeping, position tracking: reading only. A system-generated key with no IP restriction can't go beyond this anyway.
- Automated trading (quant bots, copy-trading): spot and margin trading, or futures, depending on what the strategy trades. Leave withdrawals off; a trading strategy has no reason to send coins off the account.
- Futures: if the key was created before you opened your Futures account, or you've activated Portfolio Margin, Binance says that key can't enable Futures permission. You'd need a new one.
- Withdrawals: the one switch that can send coins out of your account. It can't be enabled without an IPv4 restriction, and that's a hard requirement.
The two transfer permissions are the ones people tick without thinking. Internal transfer moves funds between your master account and sub-accounts instantly; universal transfer authorizes the key to use a dedicated transfer endpoint across supported currencies. Both move money. Internal transfer stays between your master account and sub-accounts, so coins don't leave your name, but whatever split you set up across sub-accounts can be shuffled; where a universal transfer can send funds is defined by the endpoint docs. If a tool doesn't need them, leave them off as well.
The payoff of least privilege only shows after a leak: someone holding a read-only key can see your balance and orders, and can't move a coin.
IP restriction: where the key can be used
With an IP restriction in place, the key only accepts requests from the IPv4 addresses you list and refuses everything else. A leaked secret is useless to someone sitting on their own network.
How it ties into permissions is spelled out in Binance's Help Center:
- Withdrawals: "Adding IP access(IPv4 format) restrictions is mandatory to enable withdrawal permission."
- Everything else: "Unrestricted-IP-Access HMAC API Key(s) won’t have any permission other than reading." The same article dates it: "Effective from 2023-01-30 00:00 (UTC), the system-generated API key’s permission can only be set to [Enable Reading] if your IP is unrestricted."
| Key type | Reading | Trading and other permissions | Withdrawals |
|---|---|---|---|
| System-generated (HMAC), no IP restriction | Yes | No | No |
| System-generated (HMAC), IPv4 restriction added | Yes | Yes | Can be enabled |
| Self-generated (Ed25519 / RSA) | Yes | Yes; Binance lists it as one way to get other permissions without an IP restriction | Still requires an IPv4 restriction |
Source: Binance Help Center, "How to Create API Keys on Binance?" (article 360002502072, marked updated 2026-11-06). Checked November 2026; go by what the page shows live. Account status can still block a single permission, as with the Futures case above.
The third way out Binance lists is to "disable the default security controls". It does what it says: it removes this protection so an unrestricted key can carry other permissions. We don't recommend it. A leaked key would then work from anywhere.
Home IP keeps changing: which way to go
Most home broadband connections get a public IP that changes. Bind it and the tool loses its connection the day the address rotates; leave it unbound and a system-generated key is stuck at reading. For automated trading there are two steadier options:
- Run the tool on a server with a fixed IP and bind that address.
- Use a self-generated Ed25519 key, which can trade without an IP restriction.
The second deserves a pause. This is our inference, not Binance's wording: a self-generated key with no IP restriction has exactly one thing between it and an attacker, the private key on your machine. Wherever that file lives, and whoever can reach it, becomes the only line of defense. Our own preference is a fixed-IP server whenever one is available, keeping self-generated keys for setups that genuinely have no stable address.
You'll also run into claims that keys without an IP restriction get disabled after 90 days. Binance's current Help Center article doesn't say that, and the endpoint that reports a key's permissions has no expiry field, so we don't repeat it here.
Keeping the secret safe
Permissions and IP limits are backstops for after a leak; not leaking is the front line.
- A system-generated key gives you an API Key and a Secret Key. The Secret Key is usually shown only at creation. The Help Center doesn't spell that out, so plan as if you'll see it once: store it straight away somewhere like a password manager, not in chats, notes or screenshots.
- With a self-generated key, the private key stays with you and Binance holds only the public half. If someone copies that private key file, they have the key itself.
- Don't hard-code a key and push it to a public repository. It's one of the most common ways secrets escape; public repos are scanned by bots around the clock.
- If you suspect a device is infected, treat every key ever used on it as leaked: delete and recreate.
Rotating and cleaning up
A key isn't something you create once and forget.
- Rotate: every so often, create a new key and delete the old one. The longer a key lives and the more places it's been pasted, the better the odds it has leaked quietly; rotate the broadly permissioned ones first.
- Delete what you've finished with: a tool you tried once and never opened again still holds your key. Go back and remove it.
Open API Management on Binance and read down the list: is each key still in use, are its permissions more than it needs, does it have an IP restriction? Where you're unsure, run it through the API Permission Risk Check.
The risk in third-party tools
Pasting a key into a third-party tool hands part of your account's control to that tool and the people running it. The IP restriction helps less here than you might expect: the tool runs on its own servers, the IP you bound is that server's, and if the server is breached the attacker is already on the whitelist.
- Prefer tools with a checkable reputation and a long track record. If a provider reports a security incident, delete the key you gave it and make a new one.
- A tool that only needs to read data but asks for trading or withdrawal permission is a warning sign in itself.
- Anyone asking you to send your Secret Key privately, whether they claim to be the tool's support or Binance's, is running a scam. In a legitimate setup you paste the key into the tool's own settings page yourself.
- One key per tool. When one tool has a problem, you delete only that key and the trail stays clean.
Error -2015: which part failed
When a tool's log shows -2015, the full message reads Invalid API-key, IP, or permissions for action. (Binance's official spot API error codes, code name REJECTED_MBX_KEY). Three possible causes are packed into one line. Check them in this order:
- The key: was the API Key copied wrong or with a stray space, or has the key already been deleted on Binance?
- The IP: is the address the tool actually sends from on your list? A tool moving servers, or a home connection reconnecting, both change it.
- The permission: is the one this action needs switched on? Futures is the classic case: a key created before your Futures account existed can't get Futures permission, so make a new key.
Forum threads and some tool help pages suggest setting the IP to unrestricted "just to test". Don't fix it that way. Under the current rules a system-generated key set to unrestricted drops to reading only, so the trade still fails; switching off the default security controls to get around that strips the protection entirely. Find which of the three it is and fix only that.
Suspected leak: revoke and rebuild
Orders you never placed, a device that held the key may be infected, a tool provider announcing an incident: any one of these is enough. Work through it in order:
- Delete (revoke) the key immediately in Binance API Management so it stops working entirely. That means delete, not merely edit its permissions or IP list; as long as the old secret exists, it can still be used.
- Check recent account activity: order history, asset movements and logged-in devices. If you find operations you didn't perform, the problem runs beyond the API, so handle it end to end with the account-hacked recovery steps: change the login password, review 2FA, and freeze the account if needed.
- Trace where the leak came from: which device, which tool? If you don't close that off, a new key can leak the same way.
- Rebuild a tighter key for any tool you still need: only the permissions it uses, and an IP restriction on a server you control.
A compromised API is often tied up with the account's overall security, so don't stop at the key. The full emergency drill is in the complete account-recovery guide, and the API Permission Risk Check helps map the weak points in the keys you still have.
FAQ
Can a Binance API key be used to withdraw my funds?
Only when three things line up: the key has withdrawal permission, the request comes from an IP on its whitelist, and the secret has leaked, for example because the server running your tool was itself compromised. Withdrawal can't be enabled without an IPv4 restriction, so under the current rules a key with withdrawals on and no IP binding can't be created. If you don't need withdrawals, leave them off; if you do, bind only a server you control.
If I've set an IP whitelist, do I still need to keep the API key secret?
Yes. If an attacker sends requests from an allowed address, say by breaking into that very server, the IP restriction won't stop them, and later changes to your IP settings can open gaps. Use least privilege, an IP restriction and strict secrecy together.
I think an API key has leaked. What's the first thing to do?
First, delete (revoke) the key on Binance straight away so it stops working, rather than just editing its permissions. Then check recent orders, assets and logins for anything odd, confirm the account as a whole is safe, and only then rebuild a fresh key, with tightened permissions and an IP whitelist, for any tool you still need.
Is it OK to use one key for several tools?
Not advisable. Create a separate key for each tool, so if any one has a problem you revoke only that key without dragging in the others, and the investigation stays clean. Feed one key to several tools and a single leak exposes them all.
Do the permission options and IP rules change?
They do, and one big change has already happened: since 2023-01-30 00:00 (UTC), a system-generated key with no IP restriction can only be set to reading. Separately, withdrawals require an IPv4 restriction; Binance doesn't put a start date on that one. Both rules were still in Binance's Help Center when we checked in November 2026. If they change again, go by what Binance's API creation and management pages and Help Center show at the time.
Will a key without an IP restriction be deleted after 90 days?
Plenty of guides say so. Binance's current Help Center article on creating API keys doesn't mention it, so we don't treat it as a rule. Whether a key still exists, and its status, is whatever API Management shows.
Sources
- Binance Help Center · How to Create API Keys on Binance? (article 360002502072, marked updated 2026-11-06; checked 2026-11-13)
- Binance spot API docs · error codes, -2015 REJECTED_MBX_KEY (errors.md on GitHub)
- Binance developer docs · Get API Key Permission (GET /sapi/v1/account/apiRestrictions), permission field descriptions