opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Custom provider docs incorrect

Open cgilly2fast opened this issue 3 weeks ago • 7 comments

Description

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
└

OpenCode version

No response

Steps to reproduce

  1. $ opencode
  2. type and run '/connect'
  3. search for "other"

Screenshot and/or share link

No response

Operating System

mac OS 15.5

Terminal

vs code terminal

cgilly2fast avatar Dec 22 '25 06:12 cgilly2fast

This issue might be a duplicate of existing issues. Please check:

  • #5250: Request to include custom providers in /provider and /connect command

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Dec 22 '25 06:12 github-actions[bot]

Oof good catch!

I can fix this, in the meantime try opencode auth login instead

rekram1-node avatar Dec 22 '25 06:12 rekram1-node

/oc can you fix /connect in the tui (and maybe the server too if needed so that you can connect a custom provider too)?

rekram1-node avatar Dec 23 '25 06:12 rekram1-node

Created PR #6014

New%20session%20-%202025-12-23T06%3A11%3A49.345Z opencode session  |  github run

opencode-agent[bot] avatar Dec 23 '25 06:12 opencode-agent[bot]

+1

aiyinyuedejustin avatar Jan 03 '26 14:01 aiyinyuedejustin

+1

Aaalice233 avatar Jan 06 '26 13:01 Aaalice233

I see no reason not to add this feature. Does literally nobody need the custom options?

Aaalice233 avatar Jan 06 '26 13:01 Aaalice233

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 the baseURL with 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 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.

Zhen-Bo avatar Jan 06 '26 14:01 Zhen-Bo

opencode web cannot select custom providers

mudssky avatar Jan 07 '26 16:01 mudssky