---
title: "What is an IP allow list for an API key? CIDR examples"
description: "An IP allow list accepts requests only from listed addresses or CIDR ranges. How it protects an LLM API key, how CIDR works, and pitfalls with cloud egress IPs."
url: https://broadrouter.com/glossary/ip-allow-list/
lang: en
updated: 2026-11-14
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# IP allow list

Updated 2026-11-14

An IP allow list is a security control that accepts requests only from listed IP addresses or CIDR ranges and refuses all others. On an API, it limits the damage from a leaked key, because the key does not work from networks that are not on the list.

Also called: IP allowlist, IP whitelist, allowed IPs, IP restriction, allowed\_ips

An API key works from anywhere by default. An allow list ties it to the places you actually run code.

## How it works

The API’s edge checks each request’s source IP against a list. If the address is on the list, or inside a listed range, the request continues to the normal key check. If not, it is refused.

Ranges are written in CIDR notation: an address, a slash, and a prefix length. RFC 4632 explains that the prefix length is how many leading bits are fixed. For IPv4:

| Entry | Covers |
| --- | --- |
| `203.0.113.7` | one address |
| `198.51.100.0/24` | 256 addresses, `198.51.100.0` to `198.51.100.255` |
| `10.0.0.0/16` | 65,536 addresses |

IPv6 uses the same idea with 128-bit addresses, such as `2001:db8::/48`.

The address that matters is your **egress** IP: the public address your server’s traffic leaves from. Behind NAT, a load balancer or a corporate proxy, that is often not the address the machine shows for itself.

## Why it matters

[API keys](https://broadrouter.com/glossary/api-key/) are bearer tokens: whoever holds one can use it. Keys leak through commits, logs, screenshots and laptops. With an allow list, a stolen key fails from the attacker’s network, which turns a leak from a spending incident into a non-event. GitHub, for example, applies its allow list to API calls and personal access tokens as well as web sign-ins.

The cost is some operations work. Each new server, region or CI runner needs its egress IP added, and dynamic IPs need a fixed egress path.

## On BroadNet Inference

In the account page, add one IPv4 or IPv6 address or CIDR range per line, up to 32 entries. An empty list means no restriction. New keys inherit the account list. A per-key `allowed_ips` replaces it for that key:

```bash
curl -X POST https://inference.broadnet.ai/portal/keys \
  -H "Authorization: Bearer $BROADNET_PORTAL_CREDENTIAL" \
  -H "Content-Type: application/json" \
  -d '{"label":"worker-1","allowed_ips":["203.0.113.7","198.51.100.0/24"]}'
```

Requests from other addresses get a 403. After a change or a key revocation, new requests stop within five seconds. Full steps are in [API keys and IP allow lists](https://broadrouter.com/guides/api-keys-ip-allow-lists/), and the error table is in [errors and retries](https://broadrouter.com/guides/errors-and-retries/). For the wider data-protection picture, see the [ZDR checklist](https://broadrouter.com/blog/zero-data-retention-llm-api-checklist/).

## Common mistakes

-   Listing a server’s private address, such as `10.x.x.x`, instead of its public egress IP.
-   Using a very wide range to make errors go away. A `/8` covers over 16 million addresses.

## Questions

### Is an IP allow list enough to protect an API key?

No. It is one layer. Still keep keys on servers, out of code and logs, give each app its own key, and revoke keys quickly when they leak.

### My servers run on serverless or autoscaling infrastructure. Can I use an allow list?

Only if outbound traffic leaves from known addresses. Route it through a NAT gateway or egress proxy with fixed IPs, then list those.

### What error do I get from an IP that is not on the list?

On BroadNet Inference, a 403. Other APIs typically return 403 as well.

## See also

-   [API key](https://broadrouter.com/glossary/api-key/) (term)
-   [Zero data retention](https://broadrouter.com/glossary/zero-data-retention/) (term)
-   [Rate limit](https://broadrouter.com/glossary/rate-limit/) (term)
-   [Lock API keys to your servers with IP allow-lists](https://broadrouter.com/guides/api-keys-ip-allow-lists/) (guide)
-   [BroadNet Inference error codes and when to retry](https://broadrouter.com/guides/errors-and-retries/) (guide)
-   [Zero data retention LLM API: a 10-question checklist](https://broadrouter.com/blog/zero-data-retention-llm-api-checklist/) (article)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-ip-allow-list&utm_content=page-cta) ·

**Sources**

-   [RFC 4632: Classless Inter-domain Routing (CIDR)](https://www.rfc-editor.org/rfc/rfc4632)
-   [GitHub Docs, managing allowed IP addresses for an organization](https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization)
-   [BroadNet Inference API reference, IP allow-lists](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-ip-allow-list&utm_content=sources#ip-allow-lists)
