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 11:17:23 +07:00
committed by GitHub
parent 3f47038933
commit fcc8320753
3 changed files with 7 additions and 0 deletions
+5
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",
+1
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",