ip_not_allowed
The message text is shown in the example below.
⚠️
Preview — this feature is being built; the design below is the spec. Not in the public error catalog: planned for preview endpoints.
| HTTP status | 403 |
type | permission_error |
| Retry? | No, not unchanged |
| Status | Preview |
| Extra fields | none |
When it happens
The request came from outside the key’s IP allowlist.
Example
{
"error": {
"type": "permission_error",
"code": "ip_not_allowed",
"message": "Requests from this address are not allowed for this key.",
"param": null,
"request_id": "req_6f1c2a9e0b7d4c3a8e5f1b2d"
}
}How to fix it
- Call from an allowed address, or add your egress range to the allowlist.
Detect it in code
err = resp.json().get("error", {})
if resp.status_code == 403 and err.get("code") == "ip_not_allowed":
log.warning("%s (%s)", err["message"], err["request_id"]) # fix the request; do not retry unchangedRelated
Was this page helpful?