Skip to content

[bug] Country, region, or territory not supported error #8796

Closed

Description

@justcarlson

Summary

Opencode session fails with Country, region, or territory not supported while running an explore task, resulting in a streamed AI_APICallError.

Version

opencode v1.1.19

Steps to Reproduce

  1. Start a session in Opencode.
  2. Run an explore task (e.g., "Explore templater config") that triggers tool calls.
  3. Observe the stream error.

Expected

The task runs or returns a recoverable error without blocking the session.

Actual

Session stream errors with a 403 and unsupported_country_region_territory.

Logs (truncated)

INFO  2026-01-16T02:57:39 service=llm providerID=opencode modelID=gpt-5.2-codex sessionID=ses_43b8c320bffeOAdNNVlKAbWmBa agent=plan stream
ERROR 2026-01-16T02:57:40 service=llm error={
  "name":"AI_APICallError",
  "url":"https://opencode.ai/zen/v1/responses",
  "requestBodyValues":{"model":"gpt-5.2-codex","stream":true},
  "statusCode":403,
  "responseBody":"{\"error\":{\"code\":\"unsupported_country_region_territory\",\"message\":\"Country, region, or territory not supported\"}}",
  "data":{"error":{"message":"Country, region, or territory not supported","type":"request_forbidden","code":"unsupported_country_region_territory"}}
} stream error

Screenshot

Image

Activity

  1. justcarlson commented on Jan 16, 2026

    @justcarlson
    Author

    This has basically made Opencode unusable, unfortunately.

  2. changed the title [-]Country, region, or territory not supported error[/-] [+][bug] Country, region, or territory not supported error[/+] on Jan 16, 2026
  3. justcarlson commented on Jan 16, 2026

    @justcarlson
    Author

    Interesting. This doesn't appear to affect Big Pickle. Might just be affecting OpenAI models in Zen.

  4. irth commented on Jan 16, 2026

    @irth

    +1

    fwiw Sonnet 4.5 thru Zen (Black sub) gives me

    Forbidden: {
      "error": {
        "type": "forbidden",
        "message": "Request not allowed"
      }
    }

    immediately.

    5.2-codex sometimes does a bit of thinking before returning country unsupported.

    gemini-3-pro seems to work

  5. rekram1-node commented on Jan 16, 2026

    @rekram1-node
    Collaborator

    networking issue that is being investigated

  6. fwang commented on Jan 16, 2026

    @fwang
    Contributor

    @justcarlson @irth i'm also having issues w/ gpt and claude models.. so far we know it's impacting some part of Canada. where are you guys physically?

  7. irth commented on Jan 16, 2026

    @irth

    @fwang Poland here

    edit: same thing happens thru mullvad los angeles endpoint

  8. AdiRishi commented on Jan 16, 2026

    @AdiRishi

    From Australia here, just started getting hit by this too. I'm using OpenCode Zen as well. No crazy setup, just my laptop and an API key to Zen.

  9. fwang commented on Jan 16, 2026

    @fwang
    Contributor

    can y'all give it a try and see if it's fixed?

    ^ upstream network routing issue.. just rolled out a workaround

  10. irth commented on Jan 16, 2026

    @irth

    tried sonnet, seems to work
    opus at first was sending messages that were like,

    Now
    
    Now I have 
    
    Now I have a clear
    
    picture, which
    

    very slowly, one by one, (I reverted and switched to sonnet, maybe it's in logs but I don't wanna mess with the session as I moved on), but I cannot reproduce this behaviour now and it also seems to work for me

  11. justcarlson commented on Jan 16, 2026

    @justcarlson
    Author

    @justcarlson @irth i'm also having issues w/ gpt and claude models.. so far we know it's impacting some part of Canada. where are you guys physically?

    I am in the Northeast USA, not behind a proxy, so I should be connected (I hope) to US-East.

  12. justcarlson commented on Jan 16, 2026

    @justcarlson
    Author

    Alright! Looks like it's fixed! Tool calls with opencode/gpt-5.2-codex are now successful.

  13. lennerd commented on Feb 2, 2026

    @lennerd

    I'm still having this problem. Located in Germany. Using GPT directly (without Zen) seems to fix it. Using GPT 5.1.

  14. 7 remaining items

  15. sra commented on Feb 17, 2026

    @sra

    Add me to this list

  16. mikailbayram commented on Feb 17, 2026

    @mikailbayram

    Experiencing the same issue with codex 5.2 through zen provider.

  17. roks0n commented on Feb 17, 2026

    @roks0n

    Just got this today also using GPT5.2-codex on zen. Big pickle works fine. I got the error on a vps though. Haven't tested on localhost.

  18. pierre-H commented on Feb 17, 2026

    @pierre-H

    Same issue with GPT5.2-Codex : no VPN, from Paris FR.

  19. al3rez commented on Feb 17, 2026

    @al3rez

    same error, bankgko Thailand no vpn

  20. psyanite commented on Feb 17, 2026

    @psyanite

    I had this issue suddenly today, it was working up until today. GPT5.2-codex with Zen Sydney Australia, I am not running a VPN but maybe my eero thing updated but I had the same issue with my phone internet.
    I just tried Claude and also the same problem...

  21. jamilnerd commented on Feb 17, 2026

    @jamilnerd

    Same here (Berlin, Germany) independent from being in a corporate network for OpenCode Zen provided models.

    Looks like only not free models are affected.

    Not working:

    Claude Opus 4.5, 4.6
    Claude Sonnet 4.5
    GPT 5.2

    Working:

    minimax-m2.5-free
    GLM-5 Free

  22. irth commented on Feb 17, 2026

    @irth

    same error, zen black, sonnet 4.5

    minimax-m2.5 works

  23. cauboy commented on Feb 17, 2026

    @cauboy

    Same here (Germany). I'm using opencode Zen (pay per use). Neither Sonnet, nor Opus nor Codex work.

  24. jud3v2 commented on Feb 17, 2026

    @jud3v2

    same issue in france

  25. Hughzu commented on Feb 17, 2026

    @Hughzu

    same issue in Belgium

  26. jamilnerd commented on Feb 17, 2026

    @jamilnerd

    Looks like this has been fixed. Would be cool to know, what caused the issue.

  27. github-actions commented on Apr 19, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  28. alimohyudin14 commented on Sep 11, 2026

    @alimohyudin14

    same issue with Muse spark 1.3 contributor:
    ❌ Test failed: POST /chat/completions failed: 403 {"type":"error","error":{"type":"RegionError","message":"This model is not available in your country."}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

zenRelates to Zen

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions