🌍

OpenAI: Country, Region, or Territory Not Supported

The full error is {"error":{"code":"unsupported_country_region_territory","message":"Country, region, or territory not supported","param":null,"type":"request_forbidden"}}, returned with HTTP 403. OpenAI checks where each request comes from, using the IP address that reaches its servers, and refuses requests from places that are not on its supported countries list. The key detail is that it is the location of the machine making the request that counts, not where you or your company are. That is why the error often appears in production but not on a laptop: a cloud server, serverless function, edge worker or proxy may run in a region whose IP geolocates to an unsupported country, or be routed through one. Developers have hit it from cloud regions in supported countries too, when the provider's IP ranges were geolocated incorrectly. The fix is to make sure the requests leave from a supported location, either by choosing a different hosting region or by routing traffic through infrastructure you control in a supported country. OpenAI publishes the list of supported countries and territories for the API and for ChatGPT.

Recommended toolLovableBuild apps and websites by chatting, no coding required.Start building

Affiliate link, we may earn a commission at no extra cost to you.

Symptoms You Might See

⚠️

API calls return 403 with code unsupported_country_region_territory

⚠️

Everything works locally but fails once deployed to a server or edge function

⚠️

Codex or a tool that signs in with OpenAI fails at login or token exchange with this code

⚠️

The error started after moving to a new cloud region or provider

⚠️

Requests fail only when a particular VPN or proxy is on

Common Causes

Requests come from an unsupported location

OpenAI only serves the countries and territories on its published list. Requests originating elsewhere are refused with this error.

Your server or edge runtime runs in another region

Serverless and edge platforms can execute your code in many regions. If any of them sit in an unsupported country, calls from that region fail even though your users and company are elsewhere.

Cloud IP geolocation is wrong

Developer community threads report cloud IPs in supported countries being treated as unsupported because geolocation databases mapped them elsewhere. Changing region or IP usually resolves it.

A VPN, proxy or gateway exits in an unsupported country

Whatever IP reaches OpenAI is the one that counts. A VPN exit node or third-party gateway in an unsupported country triggers the error.

Step-by-Step Fixes

1

Check the official supported list

When to try: First

Compare your server's actual country against OpenAI's API supported countries page (help.openai.com article 5347006) or the ChatGPT supported countries page for consumer apps.

2

Find the IP OpenAI actually sees

When to try: When it works locally but not in production

From the machine making the request, check its public IP and look up its geolocation. On serverless platforms, log the region each invocation runs in.

3

Pin your function or server to a supported region

When to try: For cloud and serverless deployments

Set an explicit region for your serverless functions or move the server to a region in a supported country. On edge platforms, run OpenAI calls in a regional function rather than the global edge.

4

Turn off the VPN or change the exit location

When to try: When the error depends on a VPN or proxy

If you use a VPN or proxy legitimately for work, choose an exit in the country you are actually in, or disable it for OpenAI traffic.

5

Report wrong geolocation

When to try: When you are in a supported country

If your IP is in a supported country but is classified as unsupported, report it to your cloud provider and to the geolocation database it uses, and switch to another region or IP meanwhile.

How to Prevent This

✓

Set explicit regions for any code that calls OpenAI

✓

Route OpenAI calls through backend servers in supported countries

✓

Log the region and egress IP of failing requests

✓

Re-check the supported list when you add new hosting regions

When to Contact Support

Contact OpenAI support if your requests come from a supported country, your IP geolocates correctly, and you still get this error. Include the request ID, timestamp and egress IP. OpenAI cannot add unsupported countries for individual accounts.

Frequently Asked Questions

What does unsupported_country_region_territory mean?▼

OpenAI refused the request because it came from a country, region or territory it does not currently support. The check is based on where the request originates, typically its IP address.

Why does it work on my laptop but not on my server?▼

Your server or serverless function runs from a different location than your laptop. If that region, or how its IP is geolocated, is not supported, the request fails.

Should I use a VPN to get around it?▼

Using a VPN to access OpenAI from an unsupported country can breach OpenAI's terms and risks account suspension. The legitimate fix is running your requests from a supported location you actually operate in.

Does this affect ChatGPT too?▼

ChatGPT has its own supported countries list. The API error with this code mostly affects developers, Codex logins and apps that call the API.

Where is the official list?▼

OpenAI publishes it in the Help Center as 'OpenAI API - Supported Countries and Territories', and there is a separate ChatGPT supported countries article.

Other Common AI Errors

⚠️

ChatGPT Not Working

Service Issues

🚦

Rate Limit Exceeded

Usage Limits

📏

Context Length Exceeded

Input Limits

🔥

Model Overloaded

Service Issues

Don't stop here

What to read next

Hand-picked guides our readers explore right after this one.