mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
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:
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user