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
I set up a brand new opencode server docker container on my sandbox host system. I added credit to my opencode Zen account in the default workspace. I connected the opencode web UI from a client laptop and set up a new project and added my API key from my opencode zen account to give access to paid-for models. I chose a paid-for model and attempted to send a test message but received the following error:
Upstream request failed: Invalid credential
I tested with a free tier model and received the same error.
Plugins
No response
OpenCode version
1.19.2
Steps to reproduce
Spin up a docker container of opencode server using the official opencode docker image: ghcr.io/anomalyco/opencode:1.19.3
Connect to the web UI of the host machine running the container image on the correct port number exposed by docker.
Thanks for the report and the screenshot! Version 1.19.x is OpenCode v1, which now only gets critical fixes. Every model failing on a fresh server could count as critical, but first we need to work out whether the gateway is rejecting the key itself or the server is sending the wrong credential. Could you share:
The exact model ID you picked (e.g. opencode/...) for both the paid and the free test.
How you added the API key: through the web UI's provider/connect dialog, an OPENCODE_API_KEY environment variable on the container, or a mounted auth/config file? Was the key created in the same Zen workspace you added credit to? (Please don't paste the key.)
If you remove the stored key (or start a fresh container without one), do the free models work?
Does the same key work outside Docker, e.g. with a local opencode install, or with v2 (@opencode/cli, 2.x)?
Any related lines from the container logs (docker logs <container>) from when you send the message, with secrets redacted.
You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
These issues look related, ordered from most to least likely. None of them clearly matches your setup:
all models "Error: Upstream request failed: Invalid credential" #54833: same error on v2. That cause (a gateway endpoint change) is reported to have been fixed on the service side on 2026-10-14, before you opened this issue. Its baseURL workaround is now reported to break the free tier, so please don't add it.
i added the key using the web UIs provider connect box. the model Id i tested for paid model was claude sonnet 5.5 and the free model was big pickle. free models appear to work in a fresh container without ad API key added.
the same key does not work outside of docker, the same error is produced when connecting an opencode account in an iterm2 session with the api key.
i don't think docker logs are useful since the issue exist outside of docker as well.
Thanks for testing both inside and outside Docker, that narrows it down a lot. Invalid credential means the gateway doesn't recognize the key itself, so it isn't the container: usually the key was revoked, copied incompletely, or belongs to a workspace (or service account) that was deleted.
The quickest fix is to create a fresh key: in the Console open your account menu → Account → Personal API keys → Add API key, pick the workspace you added credit to, and copy it straight away (it's only shown once). Then reconnect with that key.
If a brand-new key from that workspace still gives Invalid credential, please email help@anoma.ly with your account email and workspace name so we can look at the account. Closing this here since it's key-specific rather than an OpenCode bug.
We're closing this for now because we haven't heard back with the details we asked for: the exact model ID, how the API key was added, whether free models work without the stored key, whether the same key works outside Docker or on v2, and the container logs. Without them we can't tell whether the gateway is rejecting the key itself or the 1.19.x (v1) server is sending the wrong credential. v1 now only gets critical fixes.
If you still see Upstream request failed: Invalid credential, please reply here with those details and we can reopen this. If it also happens on v2 (@opencode/cli, 2.x), please mention that too. You can also follow #54833 and #50593, which report the same error. Thanks for taking the time to report it!
Activity
opencode-agent commentedon Oct 19, 2026
Thanks for the report and the screenshot! Version 1.19.x is OpenCode v1, which now only gets critical fixes. Every model failing on a fresh server could count as critical, but first we need to work out whether the gateway is rejecting the key itself or the server is sending the wrong credential. Could you share:
opencode/...) for both the paid and the free test.OPENCODE_API_KEYenvironment variable on the container, or a mounted auth/config file? Was the key created in the same Zen workspace you added credit to? (Please don't paste the key.)opencodeinstall, or with v2 (@opencode/cli, 2.x)?docker logs <container>) from when you send the message, with secrets redacted.You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
These issues look related, ordered from most to least likely. None of them clearly matches your setup:
baseURLworkaround is now reported to break the free tier, so please don't add it.Invalid credentialandopencode auth login opencodeis broken.m477r1x commentedon Oct 19, 2026
i added the key using the web UIs provider connect box. the model Id i tested for paid model was claude sonnet 5.5 and the free model was big pickle. free models appear to work in a fresh container without ad API key added.
the same key does not work outside of docker, the same error is produced when connecting an opencode account in an iterm2 session with the api key.
i don't think docker logs are useful since the issue exist outside of docker as well.
neriousy commentedon Oct 20, 2026
Thanks for testing both inside and outside Docker, that narrows it down a lot.
Invalid credentialmeans the gateway doesn't recognize the key itself, so it isn't the container: usually the key was revoked, copied incompletely, or belongs to a workspace (or service account) that was deleted.The quickest fix is to create a fresh key: in the Console open your account menu → Account → Personal API keys → Add API key, pick the workspace you added credit to, and copy it straight away (it's only shown once). Then reconnect with that key.
If a brand-new key from that workspace still gives
Invalid credential, please email help@anoma.ly with your account email and workspace name so we can look at the account. Closing this here since it's key-specific rather than an OpenCode bug.opencode-agent commentedon Oct 22, 2026
We're closing this for now because we haven't heard back with the details we asked for: the exact model ID, how the API key was added, whether free models work without the stored key, whether the same key works outside Docker or on v2, and the container logs. Without them we can't tell whether the gateway is rejecting the key itself or the 1.19.x (v1) server is sending the wrong credential. v1 now only gets critical fixes.
If you still see
Upstream request failed: Invalid credential, please reply here with those details and we can reopen this. If it also happens on v2 (@opencode/cli, 2.x), please mention that too. You can also follow #54833 and #50593, which report the same error. Thanks for taking the time to report it!