Files
9router/open-sse/providers/registry/opencode.js
KunN-21 aa14ef72e2 fix(opencode): normalize Muse Free tool choice
OpenCode Free returns HTTP 400 for muse-spark-1.3-contributor-free when tool_choice is non-auto. Declare forceAutoToolChoiceModels quirk and normalize explicit tool_choice to auto.
2026-09-17 18:20:08 +07:00

34 lines
1005 B
JavaScript

export default {
id: "opencode",
priority: 40,
hasFree: true,
alias: "oc",
uiAlias: "oc",
display: {
name: "OpenCode Free",
icon: "terminal",
color: "#E87040",
textIcon: "OC",
},
category: "free",
noAuth: true,
transport: {
baseUrl: "https://opencode.ai",
headers: {
"x-opencode-client": "desktop",
},
noAuth: true,
quirks: {
forceAutoToolChoiceModels: ["muse-spark-1.3-contributor-free"],
},
},
models: [
// Endpoint formats differ per model, so declare non-chat models explicitly.
{ id: "muse-spark-1.2-contributor-free", name: "Muse Spark 1.2 Contributor Free", targetFormat: "openai-responses" },
{ id: "muse-spark-1.3-contributor-free", name: "Muse Spark 1.3 Contributor Free", targetFormat: "openai-responses" },
{ id: "union-alpha", name: "Union Alpha Free", targetFormat: "claude" },
],
modelsFetcher: { url: "https://opencode.ai/zen/v1/models", type: "opencode-free" },
passthroughModels: true,
};