Claude API IP Allowlisting Guide (2026): Restrict Where Your Keys Work
On November 5, 2026, Anthropic released IP allowlisting for the Claude Platform in beta. The release notes say the goal is to limit where a leaked API key can be used. Requests to covered endpoints from addresses outside your list get refused. That is a solid control, and it is also easy to misconfigure in a way that breaks your own nightly jobs. This guide covers the setup, the failure modes, and the gaps.
Key takeaways
- Anthropic's Claude API IP allowlisting entered beta on November 5, 2026, and covers the Messages, Message Batches, Token Counting, Models, Files, and Skills endpoints.
- A request from an address outside your allowlist gets HTTP 403 with the error type permission_error and the message "Your IP address isn't in this organization's allowed range."
- Claude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokens, with cache hits at $0.10 per million tokens.
- Claude Opus 5.5 costs $4 per million input tokens and $20 per million output tokens, with a 1,000,000-token context window.
- The allowlist does not apply to Claude in Amazon Bedrock, Claude Platform on AWS, Claude Models on Google Cloud, or Claude in Microsoft Foundry.
Most API key incidents are boring. A key lands in a repo, a CI log, or a shared notebook, and someone else starts calling your endpoint on your bill. An allowlist doesn't fix the leak. It makes the leaked key much less useful, because it only works from networks you approved. It won't stop an attacker who sits on one of your office IPs, so treat it as one layer, not the whole defense.
Which Requests the Allowlist Covers
The allowlist is configured per organization, and the list applies to the whole organization. Per the IP allowlisting docs, covered requests are the Claude Console UI plus these API endpoints when called with an API key or a Workload Identity Federation token: Messages, Message Batches, Token Counting, Models, Files, and Skills. Managed Agents endpoints are covered too. The Admin API and Compliance API are covered only when you use a key scoped to that single organization.
Two gaps matter before you rely on it. First, the allowlist does not cover Claude in Amazon Bedrock, Claude Platform on AWS, Claude Models on Google Cloud, or Claude in Microsoft Foundry. If your traffic goes through one of those clouds, the Claude Platform allowlist won't protect it. Second, the allowlist limits where a key works, not how long it works. The docs recommend a short key expiration or Workload Identity Federation alongside it.
| Control | What it limits | Caveat from the docs |
|---|---|---|
| IP allowlist | Source networks that can use a key | Beta, settings and behavior can change |
| Short key expiration | How long a leaked key stays valid | Does nothing about where the key is used |
| Workload Identity Federation | Replaces static keys with short-lived tokens | Allowlist also applies to WIF tokens on covered endpoints |
Use the three together. The allowlist handles location, expiration handles time, and federation removes the long-lived secret in the first place.
Pricing for the Calls You Are Protecting
Before you lock anything down, know what a leaked key costs you. These are the standard Claude 5.5 rates from the Anthropic pricing page, in USD per 1M tokens.
| Model | Input | Output | Cache hit | Context window |
|---|---|---|---|---|
| Claude Opus 5.5 | $4 | $20 | $0.20 | 1M tokens |
| Claude Sonnet 5.5 | $2 | $10 | $0.10 | 1M tokens |
Opus 5.5 is double Sonnet 5.5 on every line. A stolen key used against Opus at full output length can burn through real money in a single afternoon, so the allowlist is worth the ten minutes. If you want to size that risk, run your expected monthly volume through the API cost calculator, and check prompt sizes with the token counter.
Setting It Up Without Locking Yourself Out
Owners and admins set this up in the Claude Console on the Identity and access page. The steps are short, but the order matters.
- Turn on the IP allowlist toggle. Nothing changes until you save.
- Add every network your servers, CI runners, and office connect from. Separate entries with commas and press Enter. Include the address you are on right now.
- Keep the "Allow admins to access this settings page from any IP address" checkbox ticked. Without it, an admin on the wrong network can't open the settings page to fix a mistake.
- Save, then wait up to 15 minutes for the change to take effect.
After that, watch your logs for 403 responses for at least a few days. Daily and weekly jobs are the ones that bite, because nobody is awake when they fail.
Test It with curl First
Run a tiny request from each network you care about before you trust the list. A 200 means the address is allowed. A 403 with permission_error means it isn't.
curl -s -w "\nHTTP %{http_code}\n" https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 50,
"messages": [{"role": "user", "content": "Reply with OK."}]
}'
Run the same command from your CI runner and from your production host. Those often egress through different NAT addresses, and that's the most common reason a job suddenly fails after you turn the feature on.
Handling the 403 in Python and Node.js
A blocked request is not a transient error. Retrying from the same host will fail again, so don't put it in your backoff loop. Catch it, log the egress address, and page a human.
import os
import sys
from anthropic import Anthropic, PermissionDeniedError
client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
def ask(prompt: str) -> str:
try:
resp = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=300,
messages=[{"role": "user", "content": prompt}],
)
except PermissionDeniedError as err:
# Blocked by the organization's IP allowlist. Retrying from this host won't help.
print(f"Blocked by IP allowlist: {err}", file=sys.stderr)
raise
return resp.content[0].text
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
export async function ask(prompt) {
try {
const msg = await client.messages.create({
model: "claude-sonnet-5-5",
max_tokens: 300,
messages: [{ role: "user", content: prompt }],
});
return msg.content[0].text;
} catch (err) {
if (err.status === 403) {
// Usually means this host's egress IP is missing from the allowlist.
console.error("Blocked by IP allowlist. Check this host's egress address.", err.message);
}
throw err;
}
}
If you route calls through a proxy, NAT gateway, or serverless platform, the address that matters is the egress address the Anthropic API sees, not the private IP of your container. Add that address, and document where it came from so the next person doesn't have to guess.
If you already send requests through KissAPI's OpenAI-compatible endpoint, the same rule applies one hop earlier. Put the allowlist on the addresses that actually reach the upstream API, and test it the same way.
Common Mistakes
- Allowlisting only your laptop. Your office Wi-Fi works, then CI fails at 2 a.m.
- Trusting cloud egress IPs to stay put. If your NAT gateway gets replaced, the address changes and the list no longer matches.
- Unticking the admin access checkbox. It's the only quick way back in if the list is wrong.
- Assuming it covers every Claude path. Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry sit outside it.
- Skipping key expiration. A list stops a stolen key from working on your network. It doesn't stop it from working on someone else's.
FAQ
Does the Claude IP allowlist apply to every API key in my organization?
Yes. The list is set per organization and covers the whole organization. Requests on covered endpoints made with an API key or a Workload Identity Federation token are checked against it.
What does a blocked request look like?
The Messages API returns HTTP 403 with the error type permission_error and the message "Your IP address isn't in this organization's allowed range."
Is an IP allowlist enough to protect my API keys?
No. It limits where a key works but not for how long. Pair it with a short key expiration, or move to Workload Identity Federation so you aren't relying on static keys.
Want one place to manage your Claude traffic?
Create a free account at api.kissapi.ai/register and start testing your requests through an OpenAI-compatible endpoint.
Start Free