You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.18-series CLI (choco-installed 1.18.31, verified also on a fresh 1.18.32 win-x64 binary) can no longer authenticate for freshopencode run invocations. The gateway rejects with "Invalid credential", and opencode auth login opencode itself is broken with "Failed to load auth provider metadata from opencode: fetch() URL is invalid".
Desktop 2.0.11 works fine (device-flow OAuth), and the already-running 1.18 server/TUI still works (holds an in-memory session credential) — only a non-interactive fresh run spawns a new server that fails. This makes opencode run unusable from scripts/CI on 1.18.
Expected Behavior
opencode run --model opencode/big-pickle "..." with a valid stored opencode API key in auth.json should succeed, as it did before ~Sep 21 2026.
opencode auth login opencode → Error: Failed to load auth provider metadata from opencode: fetch() URL is invalid (exit 1)
— same on 1.18.31 and freshly downloaded 1.18.32 (tested in isolation).
Diagnostics collected
Shared auth.json (C:\Users\pc.local\share\opencode\auth.json) contains a valid-looking legacy opencode API key (67-char sk-9h0V…).
Direct POST https://opencode.ai/zen/v1/chat/completions with that key → HTTP 400 {"error":{"type":"server_error","message":"Upstream request failed: Model is unavailable."}} — note this is not 401, so the key itself authenticates; the failure is upstream model routing on the zen route.
POST https://opencode.ai/zen/go/v1/chat/completions with same key → HTTP 400 MissingSessionID (documented go route behavior).
The 1.18 auth login opencode provider-metadata fetch URL is invalid — "fetch() URL is invalid" implies the 1.18 binary resolves an auth endpoint that no longer exists / was renamed server-side.
Root metrics on 1.18 CLI auth list: only opencode (api key) + deepseek; the desktop 2.0.11 stores its working credential as a device-flow OAuth token in opencode.db (credential table, label "Default") which 1.18 does not read.
Cause hypothesis: the "opencode" provider's auth metadata / zen model-routing endpoints changed around Sep 21 2026 (the same window as #50282 / #50084), breaking the 1.18 zen api-key path while the 2.0.11 console-OAuth path keeps working.
Environment
OpenCode version: 1.18.31 (choco) and 1.18.32 (downloaded release)
You're on OpenCode v1 (1.18.x). v1 only gets fixes for critical problems such as data loss, security issues or crashes with no workaround, so this is unlikely to be fixed there. Since Desktop 2.0.11 already works for you, the best path is to upgrade to v2. For scripts and CI, the v2 CLI is the npm package @opencode/cli, which installs the opencode command. You can sign in there with opencode auth login and then use opencode run.
Some notes that may help:
The auth login opencode → fetch() URL is invalid error is a v1 CLI bug: the provider name opencode gets treated as an enterprise login URL. A fix was proposed in fix(auth): fix opencode auth provider metadata URL (#50593) #52673 but wasn't merged, because v1 no longer takes changes.
Closing this as not planned. It's about OpenCode v1 (1.18.x), which only gets critical fixes, and we haven't heard back that this also happens on v2. Desktop 2.0.11 already works for you, so the way forward for scripts and CI is the v2 CLI (@opencode/cli): sign in with opencode auth login, then use opencode run.
If you see Invalid credential or the auth login failure on v2, please open a new issue with your v2 version, the exact command and the full error. #54833 and #59706 track the same Invalid credential error on v2 and may be useful to follow. Thanks again for the detailed diagnostics!
Activity
github-actions commentedon Sep 22, 2026
This issue might be a duplicate of existing issues. Please check:
fetch() URL is invaliderror onopencode auth loginfor a different provider (openai) on 1.18 — same root symptom of the auth-provider metadata fetch failingauth.jsonAPI-key credentials failing on v1.18.21 with model unavailable errors — similar 1.18 auth.json credential resolution failuresopencode/*free models (also filed by you — your issue here appears to be a related but distinct failure: theauth login opencodemetadata fetch breaking, vs. the zen routing outage)Y-470: the opencode ACP test skips when the hosted model refuses (#443)
opencodejr commentedon Oct 28, 2026
Thanks for the detailed report and diagnostics!
You're on OpenCode v1 (1.18.x). v1 only gets fixes for critical problems such as data loss, security issues or crashes with no workaround, so this is unlikely to be fixed there. Since Desktop 2.0.11 already works for you, the best path is to upgrade to v2. For scripts and CI, the v2 CLI is the npm package
@opencode/cli, which installs theopencodecommand. You can sign in there withopencode auth loginand then useopencode run.Some notes that may help:
auth login opencode→fetch() URL is invaliderror is a v1 CLI bug: the provider nameopencodegets treated as an enterprise login URL. A fix was proposed in fix(auth): fix opencode auth provider metadata URL (#50593) #52673 but wasn't merged, because v1 no longer takes changes./zen/v1/chat/completionscall returnedModel is unavailable. That matches the Sep 21 gateway outage in All opencode/* free models return Upstream request failed: Model is unavailable (gateway-wide) #50282, which has since been resolved.Related issues, ordered by likelihood:
Upstream request failed: Invalid credentialerror on v2 (2.0.27)Model is unavailableoutage on allopencode/*free modelsIf you think this is critical, or you see the same failure on v2, please reply here with your v2 version and the exact command and error.
opencodejr commentedon Oct 29, 2026
Closing this as not planned. It's about OpenCode v1 (1.18.x), which only gets critical fixes, and we haven't heard back that this also happens on v2. Desktop 2.0.11 already works for you, so the way forward for scripts and CI is the v2 CLI (
@opencode/cli): sign in withopencode auth login, then useopencode run.If you see
Invalid credentialor theauth loginfailure on v2, please open a new issue with your v2 version, the exact command and the full error. #54833 and #59706 track the sameInvalid credentialerror on v2 and may be useful to follow. Thanks again for the detailed diagnostics!