Skip to content

[FEATURE]: Include custom providers in /provider and /connect command #5250

Description

@stefaneidelloth

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I defined a custom provider in my opencode.jsonc file (see below example).

If I start opencode and use the /provider command, I would expect my custom provider "fhgenie" to be shown in the list of providers. Howerver, it is not shown.

I would like to connect to my custom provider similar to github copilot provider, specifying some credentials in the command line.... that are stored as secret.

Currently I hard code my api key in opencode.jsonc. I am able to connect to the models using /models command.

=> Could you please support custom providers for the /provider and /connect command and clarify how to fully specify custom providers, including authentication?

Expected behavior: an improved config could support a syntax like

"Authorization": "Bearer ${secret.fhgenie}"

If the cutom secret does not yet exist, opencode asks for it and saves it as a secret.

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "fhgenie": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "FhGenie",
      "options": {
        "baseURL": "https://fhgenie.foo.de/v1",
        "headers": {
          "Authorization": "Bearer ***"
        }
      },
      "models": {
        "Kimi-K2-Thinking": {
          "name": "Kimi-K2-Thinking"
        },      
      }
    }
  }
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionUsed for feature requests, proposals, ideas, etc. Open discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions