unsupported_country_region_territory: Meaning and 4-Step Check

Blog / Troubleshooting

unsupported_country_region_territory: Meaning and 4-Step Check

unsupported_country_region_territory is an error code returned by the OpenAI API, usually with HTTP 403. It means OpenAI looked at where the request came from, decided that country, region, or territory is not on its supported list, and rejected the request. It is not a mistyped key, not an exhausted quota, and not a network timeout. The "unsupported country" message you may see in the ChatGPT web app has the same kind of cause.

Understand what kind of rejection this is before deciding what to do. This article covers what it is, how to confirm it, and what legitimate options exist.

What does this error actually mean?

The response body looks roughly like this (field names and wording depend on the actual response; this is only an illustration):

{
  "error": {
    "code": "unsupported_country_region_territory",
    "message": "Country, region, or territory not supported"
  }
}

A few points to keep straight:

  • It is a rejection at the access policy level. An invalid key is usually a 401, and insufficient quota or rate limiting is usually a 429. This one is usually a 403.
  • The decision is based on the request origin OpenAI sees, not on your nationality or where you live. OpenAI publishes an official list of supported countries and regions, and it changes over time, so rely on its official documentation.
  • Retrying does not help. The same origin with the same key gives the same result every time.

If you can't tell 401, 403, and 429 apart, start with AI API error codes cheat sheet: what 400 to 529 mean and which to retry. 429-type problems are covered separately in OpenAI 429 errors: telling insufficient_quota from rate_limit_exceeded.

I'm in a supported region. Why do I still see it?

This is the most common question. The usual reason: the exit you think you're using is not the exit OpenAI actually sees.

Possible situations include:

  • The program is not using the network path you expect. For example, the browser goes through a proxy while curl in the terminal, a Python script, or an IDE plugin connects directly.
  • Proxy rules cover only some domains, so api.openai.com and chatgpt.com leave through different exits.
  • Your company or school network, or the cloud server itself, is located in a region that is not on the supported list.
  • The server's egress IP is attributed to a different region by geolocation databases.

So the first step is not to change configuration. It is to confirm the facts.

How do you confirm the actual egress? (4-step check)

  1. Check from the same machine and the same terminal that runs the program. The IP you see in a browser does not represent a script's exit. In the terminal, run:

    curl -s https://www.cloudflare.com/cdn-cgi/trace | grep -E "^(ip|loc)="
    

    loc is the country/region code Cloudflare sees. It is a useful reference, but it is not the same as OpenAI's determination.

  2. Open cdnping's IP and environment check in a browser. Its multi-exit check reads the Cloudflare trace of sites such as Claude, ChatGPT, and Grok, to see whether each target sees the same exit. If different targets see different regions, your traffic is being split across multiple paths.

  3. Compare environments. Check whether HTTP_PROXY and HTTPS_PROXY are set in the shell, whether Docker containers and WSL inherit the host's proxy settings, and whether your IDE has its own network settings. For troubleshooting path mismatches, see Developer network self-check list (2026): from egress IP to AI API speed tests.

  4. Rule out a server-side outage. If the failure is only intermittent, first check Is ChatGPT down and OpenAI API status to confirm it isn't an official incident. Region-based rejections are normally reproducible every time, unlike outages that come and go.

After these four steps, the conclusion usually falls into one of three cases:

What you foundWhat it meansNext step
The exit really is in an unsupported regionThe access policy is working as statedSee the compliant options in the next section
Different programs use different exits, and one path lands in an unsupported regionA local network path problemMake all programs use the same path first, then retry
The exit is on the official supported list but the error persistsPossibly a geolocation attribution difference or an account-level issueContact OpenAI support with the request ID, and rely on official documentation

This is an OpenAI restriction. What can I do?

One thing first: region restrictions are the service provider's policy. Using OpenAI services requires following its terms of service and the laws and regulations where you are. This article does not describe any way to bypass region restrictions or evade detection. Doing so may violate the terms and lead to action against your account. For the official reasons an account gets restricted, see Why ChatGPT accounts get banned: checked against OpenAI's official terms. If you received a notification email, see What the OpenAI "Access deactivated" email means and what to do next.

Compliant directions include:

  • Use it from a supported region, in a compliant way. If you are already in a supported region, the problem is most likely the path mismatch described above.
  • Azure OpenAI and other cloud-hosted services. The cloud provider supplies the model capability, and its available regions, application requirements, and compliance rules are set by that provider. Refer to its official documentation.
  • A business entity and official channels. A company can inquire through OpenAI's enterprise and sales process. Whether access can be enabled depends on OpenAI's official answer.
  • A compatible gateway that accepts payment in RMB (Chinese yuan). If your goal is to use LLM capabilities in everyday tools rather than specifically an OpenAI account, an aggregation gateway is another option. Such services have their own terms, so read them carefully before choosing.

As an aside, accounts and the API are two separate systems: a ChatGPT subscription does not include API credit, and vice versa. See ChatGPT Plus vs. the OpenAI API: accounts, billing, and quota are separate.

If you'd rather not depend on an OpenAI account, what is AGI Plan?

AGI Plan is a commercial partner of cdnping. What follows is a factual description only; whether it suits you is your call.

AGI Plan is a multi-provider LLM aggregation gateway. It is sold as a monthly subscription, paid in RMB, with no overseas credit card needed. One subscription includes capability groups such as frontier reasoning, balanced general-purpose, Chinese flagship, and fast lightweight models, and you can switch between them. Tools such as Claude Code and Codex only need a single endpoint URL changed. Codex does not need a ChatGPT account here; for the steps, see Can you use Codex without a ChatGPT account: connecting with an API key and a custom provider.

Three points to note: AGI Plan cannot help you keep using OpenAI services that are region-restricted; it is a different route to using LLMs. The operator states explicitly that it is not an officially authorized channel. Some models are marked "overseas only"; check https://agiplan.dev/models for the models and regions actually available. To see how onboarding works first, go to https://agiplan.dev/startup.

What should you do next?

Go in order:

  1. On the machine that shows the error, use the curl command above and /en/ip to confirm the actual egress.
  2. If the egress differs from what you expected, first unify the network path of all programs on that machine, then retry.
  3. If the egress really is in an unsupported region, stop trying to work around it. Choose one of the compliant options above, and follow local laws and the terms of service.
  4. In every other case, record the request time and request ID and contact OpenAI official support.

If you later hit other connection errors, connection refused vs. timed out vs. reset helps you work out which layer the problem is in.

Related articles

Keep reading