OpenCode 是终端代码工具,可通过 OpenAI-compatible 或 Anthropic-compatible Provider 接入私库云。
~/.config/opencode/opencode.json{
"$schema": "https://opencode.ai/config.json",
"provider": {
"私库云": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "你的 Base URL/v1",
"apiKey": "你的 API Key"
},
"models": {
"控制台中的模型名": {}
}
}
}
}