Repository navigation
Description
Description
When using the built-in opencode-go provider to call gpt-5.6-luna, every request fails with:
AI_APICallError: Upstream request failed: [403] This model is not available in your region.
The error is returned by the opencode-go relay and transparently passed through to the client. It is consistent across ~1 hour of retries, on both the title (small) and build (non-small) agents. Other models on the same provider (e.g. kimi-k3) work fine, which suggests gpt-5.6-luna specifically is geo-restricted at the upstream OpenAI side, and the opencode-go relay's egress IP falls into a disallowed region.
Environment:
- OpenCode Desktop 1.18.13 (packaged, Windows x64)
- Node 24.15.0, Electron 42.3.3
- OS: Windows 11 (10.0.26200)
- ~/.config/opencode/opencode.jsonc has
disabled_providers: ["opencodego"]— id mismatch (actual id isopencode-gowith hyphen), so disabling does not take effect - Auth: only an
opencode-goAPI key in ~/.local/share/opencode/auth.json (no official opencode account token); officialopencodeprovider errors with Insufficient balance / No payment method
Steps to reproduce:
- Start OpenCode Desktop 1.18.13 on Windows.
- Select
opencode-goas provider andgpt-5.6-lunaas model. - Send any message.
What I've tried:
- Routed desktop through an overseas HTTP proxy by setting NODE_USE_ENV_PROXY=1 and HTTPS_PROXY=http://127.0.0.1:7890, then relaunching OpenCode.exe. Still 403. This indicates the geo block is on opencode-go's upstream egress, not the client's egress — so no client-side network change can fix it.
- Confirming the model name resolves by switching the same provider to
kimi-k3, which works.
Questions / Request:
- Is there an officially supported way to point the
opencode-goprovider at a different upstream endpoint (a relay whose egress is in an allowed region) viaproviderconfig in opencode.json? Please share a minimal config example. - Alternatively, can I register a custom OpenAI-compatible provider in opencode.json that maps a model id to
gpt-5.6-lunaand uses my own key/baseURL? What is the minimalproviderblock schema? - Side note:
disabled_providersin opencode.jsonc does not matchopencode-gowhen written asopencodego. Worth normalizing the id or documenting it. - Could the client surface "region not supported" more clearly (e.g. hide/disable region-locked models in the model picker) instead of failing on every message?
Sample log (server-1/opencode.log):
timestamp=2026-08-05T04:37:32.149Z level=INFO message="llm runtime selected" llm.runtime=ai-sdk llm.provider=opencode-go llm.model=gpt-5.6-luna
timestamp=2026-08-05T04:37:34.144Z level=ERROR message="stream error" providerID=opencode-go modelID=gpt-5.6-luna error.error="AI_APICallError: Upstream request failed: [403] This model is not available in your region."
stack: AI_APICallError -> postToApi19 -> OpenAIResponsesLanguageModel5.doStream -> _retryWithExponentialBackoff -> streamStep
Happy to provide more log excerpts on request. I deliberately did not attach the API key.
Plugins
No response
OpenCode version
1.18.13 (Desktop, packaged, Windows x64)
Steps to reproduce
- Start OpenCode Desktop 1.18.13 on Windows.
- In ~/.local/share/opencode/auth.json, have only an opencode-go API key (no official opencode account token).
- Select
opencode-goas provider andgpt-5.6-lunaas model. - Send any message in a session.
Expected: model responds.
Actual: every request fails within ~1-2s with
"AI_APICallError: Upstream request failed: [403] This model is not available in your region."
Consistent across ~1 hour of retries, on both the title (small) and build (non-small) agents. Switching the same provider to kimi-k3 works fine, so the issue is specific to gpt-5.6-luna.
Screenshot and/or share link
N/A — unable to run /share because every message in the session fails with the 403 error before a share can be generated. Full server log is at ~/.local/share/opencode/log/opencode.log and desktop logs at ~/AppData/Roaming/ai.opencode.desktop/logs/; happy to attach specific excerpts on request.
Operating System
Windows 11 (10.0.26200, x64)
Terminal
PowerShell 5.1 (C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE) — but the issue reproduces in the OpenCode Desktop GUI, not the CLI.
Activity
github-actions commentedon Aug 5, 2026
This issue might be a duplicate of existing issues. Please check:
403 Forbidden: {"model":"<model>"}while others work (subscription active, limits not reached) #40343: [Bug] OpenCode Go: some models return403 Forbiddenwhile others work — specifically includesgpt-5.6-lunareturning 403 via theopencode-goprovider whiledeepseek-v4-flash,kimi-k3, and others succeedgpt-5.6-luna/gpt-5.6-terrafail with "Upstream request failed" (403) while other models on the same key workRegionError403 — similar pattern of geo-restriction causing selective 403s on specific modelsfwang commentedon Aug 7, 2026
the error comes from our upstream provider, in this case OpenAI. As the error states, it is not available in your region.