---
title: IP Allowlist & CIDR Restrictions for AI APIs | APIkit
description: Restrict sensitive AI endpoints to whitelisted IPv4/IPv6 CIDR blocks alongside API key authentication.
canonical: "https://apikit.ai/j/restrict-endpoint-access-ip-allowlist"
modified: 2026-11-14
author: apikit.ai editorial team
source: "https://apikit.ai"
category: API Key Auth, Scopes & Quotas
category_url: "https://apikit.ai/j#group-api-auth-permissions"
---

# Lock internal AI endpoints to approved IP and CIDR ranges

> Ensure B2B partner integrations and internal admin pipelines only accept traffic from static VPN, VPC NAT, or enterprise IP blocks.

## Prepared starting prompt

Our enterprise partner integration requires IP allowlisting so only their static NAT gateway IPs can hit a custom extraction endpoint.

### Quick scenarios
- **CIDR subnet ranges:** Allow whole IPv4/IPv6 CIDR blocks for cloud NAT gateways or corporate VPN egress.
- **Per-key IP binding:** Bind specific tenant API keys to their own allowed IPs while keeping other keys unrestricted.
- **Clean 403 audit log:** Log rejected source IPs in security events so teams verify firewall rules easily.

- [Request early access](https://apikit.ai/#waitlist-f73a0d)

## Checklist for clean IP allowlist rules

1. **Verify static NAT egress first** — Confirm your serverless or VPC functions route via static NAT IPs before turning on strict blocks.
2. **Bind allowlists per key when multi-tenant** — Apply IP restrictions per enterprise API key rather than breaking mobile users on shared endpoints.
3. **Label CIDR entries clearly** — Tag every whitelisted range with the office, staging cluster, or partner name for future audits.
4. **Pair IP checks with secret keys** — Treat CIDR rules as an extra network layer alongside bearer tokens—never as standalone auth.

## Frequently Asked Questions

### Can different B2B customers each set their own allowed IP list?

Yes. Per-key IP allowlists restrict each enterprise key to its own NAT IPs without impacting other tenants.

### What happens if an allowed key is leaked and run from a stranger's laptop?

Requests from outside the approved CIDR range are dropped at the edge with HTTP 403 before execution.

### Does APIkit support IPv6 CIDR notation?

Yes, both IPv4 and IPv6 addresses and CIDR subnet masks are supported in allowlist configurations.

## Related tasks in this category

- [Issue scoped API keys per customer and environment](https://apikit.ai/j/issue-scoped-tenant-api-keys.md)
- [Meter and cap monthly token quotas per tenant](https://apikit.ai/j/enforce-monthly-token-quotas-tenants.md)
- [Rotate API keys smoothly with overlapping grace windows](https://apikit.ai/j/rotate-compromised-keys-grace-window.md)
- [Verify end-user JWT claims directly at your AI endpoint](https://apikit.ai/j/validate-end-user-jwt-tokens.md)
- [Configure exact CORS origin policies for browser clients](https://apikit.ai/j/configure-cors-origins-browser-calls.md)
- [Shield public unauthenticated AI forms from bot abuse](https://apikit.ai/j/protect-public-forms-abuse-shields.md)

---

*Published by **Wondel.ai sp. z o.o.** · [apikit.ai](https://apikit.ai) · [About](https://apikit.ai/about) · [Editorial Guidelines](https://apikit.ai/editorial) · [Contact](https://apikit.ai/contact) · [Wondel.ai Products](https://wondel.ai/products)*