feat(claude): route OpenCode Go preset directly to /messages

/v1/messages only accepts x-api-key: switch env from ANTHROPIC_AUTH_TOKEN to ANTHROPIC_API_KEY and add top-level apiKeyField.
Drop apiFormat so Claude Code connects directly (providerNeedsRouting no longer triggers) instead of through the proxy.
Desktop keeps mode: proxy (it cannot rename models itself) but switches to anthropic passthrough.
This commit is contained in:
Jason
2026-08-10 22:56:51 +08:00
parent 390102a23b
commit 16cc0d7fea
2 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -831,7 +831,9 @@ export const claudeDesktopProviderPresets: ClaudeDesktopProviderPreset[] = [
category: "third_party",
baseUrl: "https://opencode.ai/zen/go",
mode: "proxy",
apiFormat: "openai_chat",
// Go 网关 /messages 收除 grok-4.5 外全部模型(Chat 组靠服务端转换),
// anthropic 透传即可;上游只认 x-api-key,apiKey 直填默认即该头。
apiFormat: "anthropic",
modelRoutes: brandedRoutes(
"deepseek-v4-flash",
"deepseek-v4-flash",
+6 -2
View File
@@ -832,10 +832,15 @@ export const providerPresets: ProviderPreset[] = [
websiteUrl: "https://opencode.ai/go",
apiKeyUrl: "https://opencode.ai/go?ref=2YTRG2NGTX",
partnerPromotionKey: "opencode_go",
// Go 网关 /v1/messages 只认 x-api-keyBearer 被静默忽略),
// 必须用 ANTHROPIC_API_KEY,不能换回 ANTHROPIC_AUTH_TOKEN。
// 直连 Anthropic 端点可用除 grok-4.5 外的全部 Go 模型;
// Chat 组模型(DeepSeek/GLM/Kimi 等)依赖网关服务端格式转换(未见文档承诺)。
apiKeyField: "ANTHROPIC_API_KEY",
settingsConfig: {
env: {
ANTHROPIC_BASE_URL: "https://opencode.ai/zen/go",
ANTHROPIC_AUTH_TOKEN: "",
ANTHROPIC_API_KEY: "",
ANTHROPIC_MODEL: "deepseek-v4-flash",
ANTHROPIC_DEFAULT_HAIKU_MODEL: "deepseek-v4-flash",
ANTHROPIC_DEFAULT_SONNET_MODEL: "deepseek-v4-flash",
@@ -843,7 +848,6 @@ export const providerPresets: ProviderPreset[] = [
},
},
category: "third_party",
apiFormat: "openai_chat",
endpointCandidates: ["https://opencode.ai/zen/go"],
icon: "opencode",
iconColor: "#211E1E",