feat: add OpenCode provider support (#387)

Adds OpenCode (https://github.com/opencode-ai/opencode) as a supported
provider. OpenCode is an open-source terminal AI coding assistant with
an OpenAI-compatible API running locally.

Changes:
- open-sse/config/providers.js: add opencode baseUrl (localhost:4096)
  with openai format (fully compatible, no custom headers needed)
- open-sse/services/model.js: add 'oc' alias → opencode
- src/shared/constants/providers.js: add opencode to subscription
  providers with alias 'oc', icon 'terminal', color #E87040

Usage after setup: use model prefix 'oc/<model>' to route through
a running OpenCode instance (e.g. oc/claude-sonnet-4-5).

Closes #378
This commit is contained in:
Anurag Saxena 2026-03-27 00:17:23 -04:00 committed by GitHub
parent 3f47038933
commit fcc8320753
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View file

@ -208,6 +208,11 @@ export const PROVIDERS = {
format: "openai",
headers: {}
},
opencode: {
baseUrl: "http://localhost:4096/v1/chat/completions",
format: "openai",
headers: {}
},
cline: {
baseUrl: "https://api.cline.bot/api/v1/chat/completions",
format: "openai",

View file

@ -12,6 +12,7 @@ const ALIAS_TO_PROVIDER_ID = {
kc: "kilocode",
kmc: "kimi-coding",
cl: "cline",
oc: "opencode",
// API Key providers
openai: "openai",
anthropic: "anthropic",

View file

@ -18,6 +18,7 @@ export const OAUTH_PROVIDERS = {
// "kimi-coding": { id: "kimi-coding", alias: "kmc", name: "Kimi Coding", icon: "psychology", color: "#1E40AF", textIcon: "KC" },
kilocode: { id: "kilocode", alias: "kc", name: "Kilo Code", icon: "code", color: "#FF6B35", textIcon: "KC" },
cline: { id: "cline", alias: "cl", name: "Cline", icon: "smart_toy", color: "#5B9BD5", textIcon: "CL" },
opencode: { id: "opencode", alias: "oc", name: "OpenCode", icon: "terminal", color: "#E87040", textIcon: "OC" },
};
export const APIKEY_PROVIDERS = {