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
The below is incorrect there is no other option after running /connect in opencode
[Custom provider](https://opencode.ai/docs/providers/#custom-provider)
To add any OpenAI-compatible provider that’s not listed in the /connect command:
Tip
You can use any OpenAI-compatible provider with opencode. Most modern AI providers offer OpenAI-compatible APIs.
Run the /connect command and scroll down to Other.
Terminal window
$ /connect
┌ Add credential
│
◆ Select provider
│ ...
│ ● Other
└
Then use opencode auth login {provider.custom_name} (or maybe the connect command?) to cache the api-key for your custom endpoint.
If you don't want to cache it, you can set the apiKey directly inside the provider's options.
You can modify custom_name to whatever endpoint name you prefer.
Important: The top-level model field (indicated in the structure above) is crucial. If it's left blank or incorrect, your opencode will keep receiving 429 errors (I don't even know where these 429s are coming from; my custom endpoint never received those requests).
Finally, open opencode again and type /model. You should be able to see your configured endpoint and model name.
Yesterday, I spent 2 hours digging through the source code and official documentation to debug this. After finally setting it up, I entered my project and ran /init... and opencode just froze dead.
I started the init task yesterday at 22:51:24. I watched my API endpoint logs: it received a request at 22:51:24, a second one at 22:51:28, a third at 22:53:04, and a fourth at 22:53:10. Then, absolutely nothing. No further requests were sent to my endpoint up until 23:07, yet opencode still displayed that it was "running".
It wasted nearly 3 hours of my time yesterday, and I got absolutely nothing out of it.
I saw official accounts on WeChat hyping this thing to the sky, saying how "easy" it is. They even claimed you could just say "Help me install the Oh My OpenCode plugin" inside opencode and it would auto-configure everything. The result? I just got a response saying: "It seems the user has a misunderstanding; opencode is installed successfully but there is no Oh My OpenCode plugin."
Maybe the official team is afraid that once this is actually set up, coding will become a breeze. So, they intentionally set the barrier for configuring custom endpoints as high as the Himalayas, just to ensure you don't miss out on the pain of coding without AI assistance.
Btw: To be honest, this is the biggest pile of sh*t I've eaten in 2026. If I were a QA for opencode, finding such terrible UX, I would absolutely never have let this be released.
Apologies for the outburst, this is the first time I've vented like this on GitHub.
It's just frustrating to see people hyping it up as effortless, when in reality, the actual hands-on experience is incredibly difficult. Combined with the fact that I spent 3 hours—time that should have been used for something meaningful—struggling with configuration only to end up with nothing.
I know that when a product fails like this, it's not just one person's error but usually a chain of oversights, but I just can't help being angry about it.
Reacted by Aaalice, TacticalFreak, Cogcoil2, RomainTFasst, Tomokazu Katayama, LearningBot, imcfy, DeMOLition, jiahwang, Nexulo and 13 more
Thanks @Zhen-Bo for describing your method for creating custom endpoints here! I just spent two hours trying to get it to work. Why isn't it better documented?
Hi followed the instructions above but I get an error about the PromptCacheKeys
Bad Request: Bad request: json: unknown field "promptCacheKey"
opencode version 1.1.25
EDIT: having a look as the opencode node_modules folder in ~/.opencode I can see the npm package @ai-sdk/openai-compatible is not installed, is that the issue?
Use @ai-sdk/openai or @ai-sdk/anthropic instead and try to update your api proxy.
OR you can try to do a fresh install with curl -fsSL https://opencode.ai/install | bash
Activity
github-actions commentedon Dec 22, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 22, 2025
Oof good catch!
I can fix this, in the meantime try
opencode auth logininsteadrekram1-node commentedon Dec 23, 2025
/oc can you fix /connect in the tui (and maybe the server too if needed so that you can connect a custom provider too)?
opencode-agent commentedon Dec 23, 2025
Created PR #6014
opencode session | github run
aiyinyuedejustin commentedon Jan 3, 2026
+1
Aaalice233 commentedon Jan 6, 2026
+1
Aaalice233 commentedon Jan 6, 2026
I see no reason not to add this feature. Does literally nobody need the custom options?
Zhen-Bo commentedon Jan 6, 2026
If you want to use your own endpoint, you need to follow these steps to set it up:
First, configure your
opencode.json(remember to swap thebaseURLwith your own):{ "$schema": "https://opencode.ai/config.json", "model": "new-api/claude-opus-4-5-20251101", "provider": { "new-api": { "npm": "@ai-sdk/openai-compatible", "name": "new-api", "options": { "baseURL": "http://10.10.10.1:2333/v1", "setCacheKey": true }, "models": { "claude-opus-4-5-20251101": { "name": "Claude 4.5 Opus" } } } } }Then use
opencode auth login {provider.custom_name}(or maybe the connect command?) to cache the api-key for your custom endpoint.If you don't want to cache it, you can set the
apiKeydirectly inside the provider'soptions.You can modify
custom_nameto whatever endpoint name you prefer.Important: The top-level
modelfield (indicated in the structure above) is crucial. If it's left blank or incorrect, your opencode will keep receiving 429 errors (I don't even know where these 429s are coming from; my custom endpoint never received those requests).Finally, open opencode again and type
/model. You should be able to see your configured endpoint and model name.Yesterday, I spent 2 hours digging through the source code and official documentation to debug this. After finally setting it up, I entered my project and ran
/init... and opencode just froze dead.I started the init task yesterday at 22:51:24. I watched my API endpoint logs: it received a request at 22:51:24, a second one at 22:51:28, a third at 22:53:04, and a fourth at 22:53:10. Then, absolutely nothing. No further requests were sent to my endpoint up until 23:07, yet opencode still displayed that it was "running".
It wasted nearly 3 hours of my time yesterday, and I got absolutely nothing out of it.
I saw official accounts on WeChat hyping this thing to the sky, saying how "easy" it is. They even claimed you could just say "Help me install the Oh My OpenCode plugin" inside opencode and it would auto-configure everything. The result? I just got a response saying: "It seems the user has a misunderstanding; opencode is installed successfully but there is no Oh My OpenCode plugin."
Maybe the official team is afraid that once this is actually set up, coding will become a breeze. So, they intentionally set the barrier for configuring custom endpoints as high as the Himalayas, just to ensure you don't miss out on the pain of coding without AI assistance.
Btw: To be honest, this is the biggest pile of sh*t I've eaten in 2026. If I were a QA for opencode, finding such terrible UX, I would absolutely never have let this be released.
Apologies for the outburst, this is the first time I've vented like this on GitHub.
It's just frustrating to see people hyping it up as effortless, when in reality, the actual hands-on experience is incredibly difficult. Combined with the fact that I spent 3 hours—time that should have been used for something meaningful—struggling with configuration only to end up with nothing.
I know that when a product fails like this, it's not just one person's error but usually a chain of oversights, but I just can't help being angry about it.
mudssky commentedon Jan 7, 2026
opencode web cannot select custom providers
RomainTFasst commentedon Jan 12, 2026
Thanks @Zhen-Bo for describing your method for creating custom endpoints here! I just spent two hours trying to get it to work. Why isn't it better documented?
6 remaining items
Zhen-Bo commentedon Jan 19, 2026
Use
@ai-sdk/openaior@ai-sdk/anthropicinstead and try to update your api proxy.OR you can try to do a fresh install with
curl -fsSL https://opencode.ai/install | bashrekram1-node commentedon Jan 19, 2026
@srggrs just don't set this
"setCacheKey": truesrggrs commentedon Jan 19, 2026
Thank you it worked!
lucapette commentedon Jan 23, 2026
I used this
for the qwen coder coding plan. Docs are def out of sync because the schema doesn't match anymore
merge-maestro commentedon Feb 22, 2026
I'm also having the same issue.
lahwaacz commentedon Mar 19, 2026
Why do we have to set
modelsmanually in the config? Can we let opencode connect tov1/modelsto fetch the full list of models on the custom provider?LeiCraft commentedon Apr 19, 2026
+1
LOYINuts commentedon Apr 22, 2026
It's been a year. When are you gonna fix this piece of shit bug?
brlin-tw commentedon May 1, 2026
The documentation corresponding to this issue is: Custom provider | Providers | OpenCode
Please either:
brlin-tw commentedon May 1, 2026
For llama.cpp users you can also refer to llama.cpp | Providers | OpenCode.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
tanvirrb commentedon Sep 22, 2026
There is no "other" option when using
/connect