Repository navigation
Description
Summary
On the desktop app, connecting OpenCode Go from the connect picker runs the OpenCode Console sign-in instead of the API-key flow opencode-go actually declares. The app reports success ("OpenCode Go connected"), but the credential is stored under the Console integration (opencode), so /models only shows Zen/Console models and every request fails with Upstream request failed: Insufficient account funds. A paid Go subscription is never used, and no Go models appear.
Environment
- opencode version:
v2.0.13(desktop app,OPENCODE_CLIENT=desktop) - OS: Windows 11 (
10.0.26200.9457) - Terminal: desktop app
- Shell:
cmd.exe - Install/channel: latest
- Active plugins:
@tarquinen/opencode-dcp@latest
Reproduction
- Have an active OpenCode Go subscription (console Go page: "You are subscribed to OpenCode Go", usage 0%).
- Open the desktop connect/providers UI and choose OpenCode Go.
- The dialog titled "Connect OpenCode Go" instead asks: "Sign in with your OpenCode Console account … pick a workspace and select Authorize" (device code).
- Authorize in the browser. The app shows a success toast: "OpenCode Go connected — you can now use OpenCode Go models."
- Open
/models. The only group isPersonal / OpenCode(Console: Claude / Gemini / Big Pickle / …). Noopencode-gomodels are listed. - Send any message →
Upstream request failed: Insufficient account funds.
Expected Behavior
Either:
- picking OpenCode Go presents the API-key form for the
opencode-gointegration (its only declared method), or - Console sign-in actually grants the workspace's Go entitlement, so Go models are listed and usable.
The success toast must not claim "OpenCode Go connected" when only a Console credential was created.
Actual Behavior
Only Console credentials are created — five attempts, none for opencode-go:
11:11:08 credential created ... integrationID=opencode type=oauth
11:23:43 credential created ... integrationID=opencode type=oauth
11:26:58 credential created ... integrationID=opencode type=oauth
11:27:23 credential created ... integrationID=opencode type=oauth
11:30:05 credential created ... integrationID=opencode type=oauth
GET /api/integration confirms the mismatch:
opencode(OpenCode Console):methods: [key, env, oauth],connections: 5opencode-go(OpenCode Go):methods: [key, env],connections: 0
Then every request fails: AI.Error: Upstream request failed: Insufficient account funds, and opencode models lists only opencode/* plus deepseek/* — zero opencode-go/* entries.
Additional Context
The Go key, the subscription and the gateway are all fine — only the onboarding path is broken:
- Direct probe with the Go API key:
POST https://opencode.ai/zen/go/v1/chat/completionswithAuthorization: Bearer <go key>
→ HTTP 400,Error from provider (Console Go): Request is missing x-opencode-session …
(i.e. authentication succeeded; it only asks for the session header that the CLI normally adds). - Connecting the same key via the API:
POST /api/integration/opencode-go/connect/keywith{"key": "..."}→ HTTP 204. - Immediately after:
opencode modelslists 30opencode-go/*models andopencode runsucceeds withglm-5.3-flash.
So the fix is purely in the connect UI/flow: the API-key path for opencode-go is buried (or unreachable) in the desktop onboarding.
Related: #50087, #49981, #49935, #50420, and PR #50267 (merged 2026-09-22) which maps the "OpenCode Go" entry to consoleIntegration("opencode-go") → "opencode". For this account that mapping produced Console (Zen) entitlements only, not Go.
Workaround: call the local server directly —
opencode api get /api/integration # inspect
# POST /api/integration/opencode-go/connect/key {"key":"<go key>"} (needs local service basic auth from `opencode pair`)
Activity
stephenmcconnachie commentedon Sep 29, 2026
I am getting the same issue when using opencode 2 TUI. Using the console auth or the API auth both have the same outcome - 'insufficient account funds' error when using any paid model, when Go levels are not at maximum for day / week / month.
This is only happening for new logins to OpenCode and using the console or API method to add OpenCode Go. Where I am already authenticated against the OpenCode Go service with API key, my prompts are working without errors.
Successful call, uses the Product: go and unsuccessful cal luses the Product: standard - screegrabs below. So new logins are associating with standard, and old logins were associated with go.
gambikules commentedon Oct 15, 2026
Upstream request failed: Insufficient account funds
artimirion commentedon Oct 26, 2026
So, how do I make it /inference/go/openai/v1/chat/completions instead of /inference/openai/v1/chat/completions?
opencodejr commentedon Oct 28, 2026
Thanks for the detailed report and for working out the API-key workaround.
We can't reproduce this in our sandbox. It needs the desktop app and a real OpenCode Console sign-in to a workspace with an active Go subscription, and we have neither here. For now, sending OpenCode Go through the Console sign-in looks intentional (see #50267). The question is why that connection didn't show any Go models for your workspace, even though the app said it was connected. A maintainer with access to the desktop app and a Go account will need to look at that.
To help with that, it would be useful to know:
/connect→opencode) shows Go models for youFor anyone else who hits this: using a Go key through the API-key option for OpenCode Go works, as the report describes. Related: #50087 (closed as a duplicate of this one) and #50885.
firewashing commentedon Oct 30, 2026
Re-tested on the current v2.2.2 desktop build: Connect OpenCode Go now opens the API-key form directly instead of the Console device sign-in described above. The onboarding path from this report no longer reproduces for me, so this looks fixed.
Caveat: I did not re-test the Console sign-in path — the part where a Console connection produced no opencode-go/* models. If that path is still reachable from the UI, it may be bypassed rather than fixed and could still deserve a look.
Leaving this closed. Thanks.