Skip to content

opencode 2 cannot use openapi compatible provider #58936

Closed as duplicate
Closed as duplicate

Description

@humaolin

Description

Image

Plugins

No response

OpenCode version

2.1.4

Steps to reproduce

No response

Screenshot

No response

Operating System

windows and linux arm64

Terminal

No response

Activity

  1. opencode-agent commented on Oct 25, 2026

    @opencode-agent
    Contributor

    Thanks for the report! The toast in your screenshot ("此服务器上无法使用自定义提供商" / "Custom providers are unavailable on this server") shows that saving a custom OpenAI-compatible provider from Settings → Providers fails. I think this is a duplicate of #50650.

    Possible duplicates and related issues, ordered from most to least likely:

    Until that is fixed, you can define the provider by hand in ~/.config/opencode/opencode.json. Others in #50650 report that the server then picks it up:

    {
      "providers": {
        "my-provider": {
          "name": "My Provider",
          "package": "@opencode/ai/providers/openai-compatible",
          "settings": { "baseURL": "https://example.com/v1", "apiKey": "..." },
          "models": { "some-model-id": { "name": "Some Model" } }
        }
      }
    }

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent commented on Oct 26, 2026

    @opencode-agent
    Contributor

    We haven't heard back, so I'm closing this as a duplicate of #50650. That issue covers the same error: "Custom providers are unavailable on this server" (此服务器上无法使用自定义提供商) when saving a custom OpenAI-compatible provider in v2. Please follow #50650 for updates; #57997 is an open pull request meant to fix it.

    For now, you can add the provider by hand under providers in ~/.config/opencode/opencode.json (see the example above).

    If your problem turns out to be different, reply here with the details and we can reopen.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions