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
{{ message }}
Repository navigation
Allow Claude Code CLI to connect to OpenCode GO subscription #17133
I love OpenCode, but unfortunately, the model routing is not yet implemented where it switch automatically to a lower cost model for doing basic command like bash, ls, grep, glob, etc.
For this, I am trying to use Claude Code (because it has model routing functionality) to connect to my OpenCode GO subscription via API key to https://opencode.ai/zen/go/v1 but I get 404 - Page Not Found. I thought that Claude Code is blocking the call to OpenCode.ai, but by looking at Claude Code in debug mode, it really shows that OpenCode returned a 404 - Page Not Found html webapge.
Any help is very appreciated. Thank you!
Plugins
No response
OpenCode version
1.2.24
Steps to reproduce
Use Claude Code with OpenRouter settings and it will work. But try OpenCode settings (that is very similar to OpenRouter) and it will not work:
# OpenRouter (working with these environment variables)
ANTHROPIC_BASE_URL="https://openrouter.ai/api"
ANTHROPIC_AUTH_TOKEN="<openrouter-api-key>"
ANTHROPIC_API_KEY=""# Important: Must be explicitly empty
ANTHROPIC_MODEL="stepfun/step-3.5-flash:free"# OpenCode GO (not working for some reason)
ANTHROPIC_BASE_URL="https://opencode.ai/zen/go/v1"
ANTHROPIC_AUTH_TOKEN="<opencode-go-api-key>"
ANTHROPIC_API_KEY=""# Important: Must be explicitly empty
ANTHROPIC_MODEL="minimax-m2.5"
Screenshot and/or share link
Claude Code error:
The HTML response from Claude Code log, put in an html file and opened in Chrome:
While I continued testing, I found the answer to my question. In case other people have this same issue, here is the solution:
# OpenCode GO (now working)
ANTHROPIC_BASE_URL="https://opencode.ai/zen/go" # had to remove /v1 for some reason
ANTHROPIC_AUTH_TOKEN="" # Important: this one must be explicitly empty
ANTHROPIC_API_KEY="<opencode-api-key>"
ANTHROPIC_MODEL="minimax-m2.5"
Enjoy!
(closing the ticket as not planned)
Reacted by ligaolei, endcy, Tastelessor and virgil724
Thanks for sharing. Could you plz tell me that can you use deepseek in claude code cli with opencode go subscription in the manner you shared? Just for confirmation cuzz I want to subcribe go and use deepseek model in cc.
Hi @WodenJay , I tried using my solution and it did not work. I had this error:
Other people also have this [issue](https://github.com//issues/24224) and that same person have a [solution](https://github.com/superheroYu/deepseek-v4-opencode-claude-code-bridge). I did not test his solution, but you could try.
Activity
mstephano commentedon Mar 12, 2026
While I continued testing, I found the answer to my question. In case other people have this same issue, here is the solution:
Enjoy!
(closing the ticket as not planned)
WodenJay commentedon May 16, 2026
Thanks for sharing. Could you plz tell me that can you use deepseek in claude code cli with opencode go subscription in the manner you shared? Just for confirmation cuzz I want to subcribe go and use deepseek model in cc.
mstephano commentedon May 18, 2026
Hi @WodenJay , I tried using my solution and it did not work. I had this error:
Other people also have this issue and that same person have a solution. I did not test his solution, but you could try.
WodenJay commentedon May 18, 2026
Thanks a lot! That's really useful
RishiVagadiya commentedon May 24, 2026
its work opencode go subd now can run claude cli
use this formate env :