---
title: "Crypto Exchange API Key IP Restrictions for Bots"
description: "How Binance, Bybit, OKX, Kraken and Delta Exchange tie API keys to IPs, what an unrestricted key loses, and how to give a cloud trading bot one fixed IP."
canonical: https://fixedmark.com/blog/crypto-exchange-api-key-ip-restrictions
updated: 2026-11-10
source: Fixedmark (https://fixedmark.com), BitMask LLP
---

Algo trading · 10 min read

# Crypto Exchange API Key IP Restrictions for Bots

Most large exchanges let you bind an API key to a list of IPs, and several penalize keys that are not bound. Binance limits unrestricted HMAC keys to reading, Bybit invalidates unbound keys after 90 days, and OKX deletes unbound trading keys after 14 idle days. A cloud bot keeps its key by sending signed calls from a fixed IP, such as a VM's static IP or a static IP proxy.

## What each exchange does to keys without an IP list

Every exchange below lets you attach a list of IP addresses to an API key. After that, the exchange rejects any signed request that comes from another address. The difference is what happens when you leave the list empty. Some exchanges only recommend the list. Others cut permissions, expire the key, or delete it.

_API key IP rules at major exchanges, from each exchange's own docs (checked November 2026)_

| Exchange             | Key without an IP list                                                                             | Notes                                                                                                                         |
| -------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Binance              | A system-generated (HMAC) key can only read. Withdrawals need an IP restriction on every key type. | Self-generated Ed25519 or RSA keys can get other permissions without an IP list. The withdrawal rule asks for IPv4 addresses. |
| Binance.US           | Reset to read-only after 90 days unused.                                                           | The reset applies to keys not secured by IP whitelisting.                                                                     |
| Bybit                | Invalid after 90 days. Also invalid 7 days after the account password changes.                     | Pass IPs as a comma-separated list. Bound keys are exempt from both rules.                                                    |
| OKX                  | Deleted after 14 days of inactivity if it has trade or withdraw permission.                        | Up to 20 IPs per key, IPv4, IPv6, or ranges. Private calls count as activity.                                                 |
| Kraken               | No penalty. IP Address Restriction is an optional setting.                                         | Listed under optional settings in Kraken's API key guide.                                                                     |
| Delta Exchange India | A key with Trading permission cannot be created without whitelisted IPs.                           | IPv4 and IPv6 accepted, several IPs per key.                                                                                  |

Sources for the table are the [Binance API key FAQ](https://www.binance.com/en/support/faq/360002502072), [Binance.US](https://support.binance.us/en/articles/9842812), the Bybit [create key endpoint](https://bybit-exchange.github.io/docs/v5/user/create-subuid-apikey), the [OKX API FAQ](https://www.okx.com/en-au/help/api-faq) and [OKX API docs](https://www.okx.com/docs-v5/en/), [Kraken support](https://support.kraken.com/articles/how-to-create-an-api-key-on-kraken-pro), and the [Delta Exchange API docs](https://docs.delta.exchange/). These rules change. Binance capped trading permission on unrestricted keys at 90 days in [a July 2021 announcement](https://www.binance.com/en/support/announcement/11e4c2f44e7a47b9b5fc0e479c0b256f), and that page now says the rule stopped applying on 2023-10-24. The current Binance rule, read-only for unrestricted system-generated keys, dates from 2023-01-30.

So the premise needs one correction. IP binding is not mandatory for trading everywhere. At Binance an Ed25519 key can trade without an IP list, and Kraken never requires one. What is close to universal is that withdrawals need an IP list, and that keys without one live shorter lives. For a bot that runs for months, an IP list is the only setup that does not need a calendar reminder.

This post covers API security and networking only. It is not investment, legal, or tax advice, and it says nothing about whether crypto assets or any exchange are a good place for your money. Crypto trading is risky, and the rules for it differ by country. Check what applies where you live before you trade.

## Why exchanges push keys toward fixed IPs

An API key and secret are a bearer credential. Anyone who copies them from a leaked `.env`, a public repo, or a compromised laptop can sign requests as you. An IP list turns that copy into something much less useful. The attacker now also needs to send traffic from one of your addresses.

That is why the rules cluster around trading and withdrawals. A read-only key that leaks exposes your balances. A trading key that leaks can be used to trade your funds into a thin market. A withdrawal key that leaks loses the funds outright, which is why Binance makes the IP list mandatory before it will enable withdrawals at all.

The expiry rules are the nudge. An exchange cannot force everyone onto fixed IPs, because many users trade from home connections whose address changes. So it lets unbound keys exist, but makes them expire or shrink. Bybit's 7-day rule after a password change follows the same logic. A password change often follows a suspected compromise, so unbound keys from before it should not live on.

An IP list is one layer, not the whole defence. Keep withdrawal permission off on any key a bot uses. Give each bot its own key, ideally on a sub-account with only the funds it trades. Binance also [recommends Ed25519 keys](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types) and calls HMAC keys deprecated, because with Ed25519 the exchange only ever holds your public key.

## Why a cloud bot breaks the IP list

A bot on your own VPS has one public IP, and the IP list just works. A bot on serverless functions, a PaaS container, or an autoscaling group does not. Those platforms send outbound traffic from shared address pools that change on redeploys, restarts, and scale events. The [post on why serverless egress IPs change](https://fixedmark.com/blog/why-serverless-egress-ips-change) covers each platform's behaviour. You cannot list those addresses, and listing a whole cloud range would admit every other tenant on it, as the [cloud IP ranges post](https://fixedmark.com/blog/cloud-ip-ranges-are-not-an-allowlist) explains.

When the bot's address is not on the list, the exchange answers with an error that often looks like an authentication problem. These are the documented messages.

_IP mismatch errors as the exchanges document them_

| Exchange       | Code                             | Message                                                                                    |
| -------------- | -------------------------------- | ------------------------------------------------------------------------------------------ |
| Binance        | `-2015`                          | `Invalid API-key, IP, or permissions for action.` One code covers all three causes.        |
| Bybit          | `10010`                          | `Unmatched IP, please check your API key's bound IP addresses.`                            |
| Delta Exchange | `ip_not_whitelisted_for_api_key` | The response shows the rejected IP, so you can add it.                                     |
| OKX            | `50110`                          | `Your IP {param0} is not included in your API key's IP whitelist.` Returned with HTTP 401. |

The messages come from each exchange's error reference ([Binance](https://developers.binance.com/docs/binance-spot-api-docs/errors), [Bybit](https://bybit-exchange.github.io/docs/v5/error), [OKX](https://www.okx.com/docs-v5/en/), and the [Delta Exchange docs](https://docs.delta.exchange/)). Binance's single `-2015` code is the hard one, because a wrong key, a missing permission, and a wrong IP all look the same. Check the IP first. It is the cause that changes without you touching anything.

### IPv6 can leave by a different door

A host with both IPv4 and IPv6 may reach the exchange over IPv6 when the API hostname has an IPv6 address. The exchange then sees your IPv6 address, which is not the IPv4 address you listed. Binance's withdrawal rule asks for IPv4 addresses specifically. Delta's docs warn about this mismatch and suggest whitelisting both protocols or turning one off. The [IPv6 egress post](https://fixedmark.com/blog/ipv6-egress-and-ipv4-only-allowlists) shows how to force IPv4 in common clients.

## Three ways to give the bot a fixed IP

1. Run the bot on a VM with a static public IP. This is the simplest option if you are happy to patch and monitor a server. One VM is also one point of failure, and its IP leaves with it if you rebuild it carelessly.
2. Keep the bot where it is and send its traffic through a cloud NAT gateway with a reserved IP. This works inside one cloud and one network, and the NAT bill can exceed the bot's own cost. The [NAT gateway cost calculator](https://fixedmark.com/tools/nat-gateway-cost-calculator) shows the numbers for AWS.
3. Keep the bot on any platform and send only its exchange calls through a static IP proxy. The bot keeps its host. The exchange sees the proxy's IP. This is the option that works on serverless and PaaS platforms that have no static IP of their own.

The [home IP vs VPS vs proxy post](https://fixedmark.com/blog/home-static-ip-vs-vps-vs-proxy-for-algo-trading) compares these for Indian stock broker APIs, and most of it carries over to exchanges. Two points are specific to crypto exchanges.

First, the IP must be yours alone. A shared proxy IP means other customers' traffic also comes from an address on your key's list, so the list stops protecting you from them. Second, exchanges apply some limits per IP. Binance documents request weight as IP-based, and its `-1003` error reads `Way too much request weight used; IP banned until %s.` On a shared IP, another user's traffic can spend your weight or get the address banned.

Use two IPs, not one, and list both. A pair on separate hosts lets the bot keep trading when one host fails. The [static IP pairs post](https://fixedmark.com/blog/static-ip-pairs-and-failover) explains how that failover works. Bybit, OKX, and Delta all document lists of several IPs per key.

## Route only signed calls through the proxy

Most bots talk to exchanges through [ccxt](https://github.com/ccxt/ccxt/wiki/Manual). It has a `httpsProxy` property for REST calls and a separate `wssProxy` property for websocket connections. The proxy tunnels each connection with HTTP CONNECT, so TLS runs end to end from your bot to the exchange. The [HTTP CONNECT post](https://fixedmark.com/blog/http-connect-proxy-explained) walks through that handshake.

Public market data does not need the fixed IP. Order books and trade streams are heavy, and sending them through a proxy costs bandwidth and adds a hop for nothing. A clean pattern is two exchange objects. One reads public data directly. The other holds the key and the proxy.

**Python (async)**

```python
# pip install "ccxt>=4.5"   (Python 3.11+ for an https:// proxy URL)
import asyncio
import os

import ccxt.async_support as ccxt

async def main():
    # Public data goes direct: no key, no proxy.
    public = ccxt.bybit()

    # Signed calls leave from the fixed IPs on the key's list.
    private = ccxt.bybit({
        "apiKey": os.environ["BYBIT_API_KEY"],
        "secret": os.environ["BYBIT_API_SECRET"],
    })
    private.httpsProxy = os.environ["FIXEDMARK_PROXY_URL"]

    try:
        ticker = await public.fetch_ticker("BTC/USDT")
        balance = await private.fetch_balance()
        print(ticker["last"], balance["total"].get("USDT"))
    finally:
        await public.close()
        await private.close()

asyncio.run(main())
```

**Node.js**

```javascript
// npm install ccxt
// For websockets through a proxy, also: npm install http-proxy-agent https-proxy-agent
import ccxt from "ccxt";

const proxy = process.env.FIXEDMARK_PROXY_URL;

// Public data goes direct.
const publicEx = new ccxt.pro.okx();

// Signed REST and private websockets leave from the fixed IPs.
const privateEx = new ccxt.pro.okx({
  apiKey: process.env.OKX_API_KEY,
  secret: process.env.OKX_API_SECRET,
  password: process.env.OKX_API_PASSPHRASE,
});
privateEx.httpsProxy = proxy;
privateEx.wssProxy = proxy;

try {
  const ticker = await publicEx.fetchTicker("BTC/USDT");
  const balance = await privateEx.fetchBalance();
  console.log(ticker.last, balance.total.USDT);
} finally {
  await publicEx.close();
  await privateEx.close();
}
```

We ran ccxt 4.5.92 REST and websocket calls through a local CONNECT proxy and logged each tunnel. Two behaviours are worth knowing before you deploy.

- In ccxt's synchronous Python client, `httpProxy` fills only the `http` key of the requests `proxies` dict. Calls to an `https://` exchange URL then skip the proxy with no error, and the exchange sees your platform's IP. Set `httpsProxy`, which fills the `https` key. The async client passes either property to aiohttp, so both work there.
- In Node, ccxt sends REST calls through undici and needs nothing extra. Websockets through `wssProxy` need both `http-proxy-agent` and `https-proxy-agent` installed. With only one of them, `watchTicker` threw a `NotSupported` error that asks you to install `https-proxy-agent`, even when that package was present.

Treat any connection that authenticates with the key as restricted. That includes private websocket logins and the REST call that creates a user data stream. If you write raw HTTP clients instead of using ccxt, the [selective proxying post](https://fixedmark.com/blog/selective-proxying-no-proxy-and-per-client-agents) covers per-client proxy settings in each language, and why a global `HTTPS_PROXY` is riskier.

## Check what the exchange sees

Do not guess the egress IP. Ask a service that echoes it, through the same proxy URL your bot uses. Then ask the exchange what it thinks of your key.

**Terminal**

```bash
# The IP a destination sees through the proxy. Repeat it to see both IPs of a pair.
curl --proxy "$FIXEDMARK_PROXY_URL" https://fixedmark.com/api/ip

# Connection and TLS timing to an exchange through the same path.
curl -s -o /dev/null --proxy "$FIXEDMARK_PROXY_URL" \
  -w 'connect=%{time_connect}s tls=%{time_appconnect}s total=%{time_total}s\n' \
  https://api.bybit.com/v5/market/time
```

Binance has a signed endpoint, [GET /sapi/v1/account/apiRestrictions](https://developers.binance.com/docs/wallet/account/api-key-permission), that returns `ipRestrict` and each permission flag. Bybit's [GET /v5/user/query-api](https://bybit-exchange.github.io/docs/v5/user/apikey-info) returns the bound `ips`, plus `expiredAt` and `deadlineDay` for keys that will expire. ccxt exposes both as implicit methods.

**check_keys.py**

```python
# pip install "ccxt>=4.5"
import os

import ccxt

proxy = os.environ["FIXEDMARK_PROXY_URL"]

binance = ccxt.binance({
    "apiKey": os.environ["BINANCE_API_KEY"],
    "secret": os.environ["BINANCE_API_SECRET"],
})
binance.httpsProxy = proxy  # httpsProxy, not httpProxy, in sync Python
r = binance.sapiGetAccountApiRestrictions()
print("binance ipRestrict:", r["ipRestrict"],
      "trading:", r["enableSpotAndMarginTrading"],
      "withdrawals:", r["enableWithdrawals"])

bybit = ccxt.bybit({
    "apiKey": os.environ["BYBIT_API_KEY"],
    "secret": os.environ["BYBIT_API_SECRET"],
})
bybit.httpsProxy = proxy
info = bybit.privateGetV5UserQueryApi()["result"]
print("bybit ips:", info["ips"],
      "expiredAt:", info["expiredAt"],
      "readOnly:", info["readOnly"])
```

Run the check from a scheduled job, not once. If `ipRestrict` turns false or `expiredAt` gets close, alert before the bot fails mid-trade. When you rotate keys, create the new key with the same IP list, deploy it, and only then delete the old one. The [credential rotation post](https://fixedmark.com/blog/rotating-proxy-credentials-without-downtime) describes the overlap pattern.

## A fixed IP is not a way around geoblocks

Exchanges also decide who may use them by location, and they enforce it partly by IP. Bybit's error reference lists `You are using U.S IP` as a cause of HTTP 403. Developers calling Binance.com from US servers report HTTP 451 with a message that begins `Service unavailable from a restricted location according to 'b. Eligibility'`, in threads on [Binance's developer forum](https://dev.binance.vision/t/api-error-451-unavailable-for-legal-reasons/13828).

This matters when you pick a region for the bot's fixed IP. Choose an egress location where the exchange operates and where you are an eligible user. Do not pick a region to make your traffic appear to come from a country the exchange restricts or where you do not live. That breaks the exchange's terms, it can freeze the account, and a fixed IP makes it easy for the exchange to see.

For traders in India, note that the static IP rules in [SEBI's algo trading framework](https://fixedmark.com/blog/sebi-algo-trading-static-ip-rules) apply to stock brokers' APIs. Crypto exchange IP rules are each exchange's own policy. Delta Exchange India, for one, requires whitelisted IPs on every key with Trading permission.

## Doing this with Fixedmark

Fixedmark is a static outbound IP proxy, in early access. On the Pro plan (planned at $29 a month) you get a dedicated pair of IPv4 addresses in one region. You list both on the exchange key, set `FIXEDMARK_PROXY_URL` to your proxy URL, and point ccxt's `httpsProxy` and `wssProxy` at it as shown above. Planned regions are Mumbai, Singapore, Newark, and Ashburn. See [regions](https://fixedmark.com/regions), and keep the geoblocking section in mind when you choose.

- TLS passes through end to end and is never decrypted, so the proxy never sees your API key, signatures, or order payloads. See [security](https://fixedmark.com/security).
- [Connection logs](https://fixedmark.com/docs/logs) show the destination, SNI, egress IP, and result of each connection, which helps when an exchange returns an IP error.
- [Destination allowlists](https://fixedmark.com/docs/allowlists), on Business and up, can limit a proxy token to hosts such as `api.bybit.com:443`, so a leaked proxy token cannot reach anything else.
- The trial runs on a shared IP pair. Do not put shared IPs on an exchange key. Use the trial to test your code path, then list the dedicated pair.

Per-language proxy setup is in the [Python](https://fixedmark.com/docs/python) and [Node.js](https://fixedmark.com/docs/node) docs, and [verify your egress IP](https://fixedmark.com/docs/verify-egress-ip) has more ways to confirm the address. If you trade Indian equities too, the [algo trading static IP page](https://fixedmark.com/india/algo-trading-static-ip) covers broker registration.

## Sources

Checked November 2026. Confirm current details on the vendor's site before you decide. Prices and limits change.

- [Binance: How to create API keys](https://www.binance.com/en/support/faq/360002502072)
- [Binance: Updates to API key permission rules (2021)](https://www.binance.com/en/support/announcement/11e4c2f44e7a47b9b5fc0e479c0b256f)
- [Binance developers: API key types](https://developers.binance.com/docs/binance-spot-api-docs/faqs/api_key_types)
- [Binance developers: Error codes](https://developers.binance.com/docs/binance-spot-api-docs/errors)
- [Binance developers: Get API key permission](https://developers.binance.com/docs/wallet/account/api-key-permission)
- [Binance.US: API key best practices](https://support.binance.us/en/articles/9842812)
- [Bybit API: Create sub UID API key](https://bybit-exchange.github.io/docs/v5/user/create-subuid-apikey)
- [Bybit API: Get API key information](https://bybit-exchange.github.io/docs/v5/user/apikey-info)
- [Bybit API: Error codes](https://bybit-exchange.github.io/docs/v5/error)
- [OKX: API FAQ](https://www.okx.com/en-au/help/api-faq)
- [OKX: API v5 documentation](https://www.okx.com/docs-v5/en/)
- [Kraken: How to create an API key on Kraken Pro](https://support.kraken.com/articles/how-to-create-an-api-key-on-kraken-pro)
- [Delta Exchange: API documentation](https://docs.delta.exchange/)
- [ccxt: Manual, Proxy section](https://github.com/ccxt/ccxt/wiki/Manual)
- [Binance developer forum: API error 451](https://dev.binance.vision/t/api-error-451-unavailable-for-legal-reasons/13828)

Keep reading

## Related guides

- [Guide Static IP for algo trading Static IPs for Indian broker APIs under SEBI's rules.](https://fixedmark.com/india/algo-trading-static-ip)
- [Guide Regions Mumbai, Singapore, Newark, and Ashburn.](https://fixedmark.com/regions)
- [Integration AWS Lambda A fixed IP for Lambda without VPC, subnets, and two NAT Gateways.](https://fixedmark.com/integrations/aws-lambda)
- [Integration Railway A dedicated IP pair for Railway services when shared static IPs are not enough.](https://fixedmark.com/integrations/railway)
- [Use case Partner API allowlisting Give Salesforce, SOAP vendors, and payment gateways one dedicated IP pair to allowlist, wherever your code runs.](https://fixedmark.com/use-cases/partner-api-allowlisting)

## Frequently asked questions

### Do Binance API keys need an IP whitelist to trade?

Not always. A system-generated HMAC key without an IP restriction can only read. A self-generated Ed25519 or RSA key can get trading permission without one. Withdrawal permission needs an IP restriction on any key type.

### Why did my Bybit API key stop working after three months?

Bybit's API docs say a key with no IP binding becomes invalid after 90 days, and 7 days after an account password change. Keys bound to IPs are exempt. Create a new key and bind it to your bot's fixed IPs.

### Why was my OKX API key deleted?

OKX deletes keys that have trade or withdraw permission, have no IP binding, and see 14 days without private API calls. Bind up to 20 IPs to the key to stop this.

### Can I whitelist my Lambda or Vercel IP on an exchange?

Not reliably. Those platforms send outbound traffic from shared pools that change. Route the bot's signed calls through a VM, NAT gateway, or static IP proxy with addresses only you use, and whitelist those.

### Should my crypto bot use a shared proxy IP?

No. Other users' traffic would come from an address on your key's list, and IP-based rate limits and bans would be shared with them. Use a dedicated IP, ideally a pair.
