Skip to content

Custom provider docs incorrect #5937

Closed as not planned
Closed as not planned

Description

@cgilly2fast

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

Activity

  1. github-actions commented on Dec 22, 2025

    @github-actions
    Contributor

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

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

  2. rekram1-node commented on Dec 22, 2025

    @rekram1-node
    Contributor

    Oof good catch!

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

  3. rekram1-node commented on Dec 23, 2025

    @rekram1-node
    Contributor

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

  4. opencode-agent commented on Dec 23, 2025

    @opencode-agent
    Contributor

    Created PR #6014

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

  5. aiyinyuedejustin commented on Jan 3, 2026

    @aiyinyuedejustin

    +1

  6. Aaalice233 commented on Jan 6, 2026

    @Aaalice233

    +1

  7. Aaalice233 commented on Jan 6, 2026

    @Aaalice233

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

  8. Zhen-Bo commented on Jan 6, 2026

    @Zhen-Bo

    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.

  9. mudssky commented on Jan 7, 2026

    @mudssky

    opencode web cannot select custom providers

  10. RomainTFasst commented on Jan 12, 2026

    @RomainTFasst

    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?

  11. 6 remaining items

  12. Zhen-Bo commented on Jan 19, 2026

    @Zhen-Bo

    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

  13. rekram1-node commented on Jan 19, 2026

    @rekram1-node
    Contributor

    @srggrs just don't set this "setCacheKey": true

  14. srggrs commented on Jan 19, 2026

    @srggrs

    Thank you it worked!

  15. lucapette commented on Jan 23, 2026

    @lucapette

    I used this

    "provider": {
        "qwen-coding-plan": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Qwen Coding Plan",
          "options": {
            "baseURL": "https://coding-intl.dashscope.aliyuncs.com/v1",
            "apiKey": "{env:QWEN_API_KEY}"
          },
          "models": {
            "qwen3-coder-plus": {
              "name": "qwen3-coder-plus"
            }
          }
        }
      },

    for the qwen coder coding plan. Docs are def out of sync because the schema doesn't match anymore

  16. merge-maestro commented on Feb 22, 2026

    @merge-maestro

    I'm also having the same issue.

  17. lahwaacz commented on Mar 19, 2026

    @lahwaacz

    Why do we have to set models manually in the config? Can we let opencode connect to v1/models to fetch the full list of models on the custom provider?

  18. LeiCraft commented on Apr 19, 2026

    @LeiCraft

    +1

  19. LOYINuts commented on Apr 22, 2026

    @LOYINuts

    It's been a year. When are you gonna fix this piece of shit bug?

  20. brlin-tw commented on May 1, 2026

    @brlin-tw

    The documentation corresponding to this issue is: Custom provider | Providers | OpenCode

    Please either:

  21. brlin-tw commented on May 1, 2026

    @brlin-tw

    For llama.cpp users you can also refer to llama.cpp | Providers | OpenCode.

  22. removed
    bugSomething isn't working
    on May 3, 2026
  23. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  24. tanvirrb commented on Sep 22, 2026

    @tanvirrb

    There is no "other" option when using /connect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions