GrepBoard/Manuals
605 manuals ·

Fix OpenAI API 403 "unsupported_country_region_territory"

·Tested on OpenAI API official docs · 2026-10·Test scope ↓·5 steps

OpenAI API 403 unsupported_country_region_territory means your egress IP was placed outside supported countries. Check the server IP; report a misplacement.

output
Error code: 403 - {'error': {'code': 'unsupported_country_region_territory', 'message': 'Country, region, or territory not supported', 'param': None, 'type': 'request_forbidden'}}

OpenAI placed the origin of the request outside its supported countries and refused it; what counts is the location of the IP the request actually leaves from (that IP is also what OpenAI support asked for when checking a misplacement). Keys and billing have nothing to do with it, so a different key gives the same result. Find where your server egresses from, and if that is inside a supported country, send that IP to OpenAI support to have the geolocation checked.

[1] Confirm where the code actually runs. If it works from your laptop but fails on the server, the server's region (cloud function, container, CI runner) is what matters. In your cloud console, check the service's region and the NAT or static IP it uses for outbound traffic.

[2] Print the egress IP from inside the server, since the console settings and the real path can differ.

console
$ curl -s https://ifconfig.me ; echo

Any external IP lookup service works. The address it prints is what you use in [3] and [4]. Don't post it publicly.

[3] Check that the IP's country is on OpenAI's supported countries list (Supported countries on developers.openai.com). South Korea, for example, is on the list.

CaseWhat to do
The server region itself is outside supported countriesMove the API calls to a server or region in a supported country
Supported country, still blockedReport the misplacement as in [4]
Traffic exits through a corporate proxy or security gatewayRe-check that device's exit country with [2]

[4] If you are in a supported country and still blocked, the IP geolocation may be wrong. In June 2025, on the official forum, Cloud Run services in the Seoul region suddenly got this error; OpenAI support replied that South Korea is supported and asked for the IP in use to check whether it was being geolocated to a blocked region. Three days later support replied that the issue was fixed. In the same situation, collect the IP from [2], the service region, the raw error, and the time it started, and contact the OpenAI help center.

[5] Keep the service from failing loudly while you sort it out. Resending gets the same answer, so exclude this error from retries. When code is unsupported_country_region_territory, skip the retry and raise an operations alert instead, which stops tight loops of identical requests.

One more IP-related error exists: 401 IP not authorized means the IP is missing from the IP allowlist set on your project or organization, not a country problem. For a 401 caused by the key, see Fix OpenAI API 401 "Incorrect API key provided". Gemini has its own location error: Fix Gemini API 400 "User location is not supported".

Check it with the HTTP status codes tool ↗ — calculated in your browser.

#openai-api#403#region#cloud