客户端配置
OpenCode
在 OpenCode 配置自定义 provider。
OpenCode provider
在 opencode.json 中声明兼容 provider。不要把完整 Key 提交到仓库。
json
{
"$schema": "https://opencode.ai/config.json",
"model": "custom/<MODEL>",
"provider": {
"custom": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://suoxie.codes/v1",
"apiKey": "<API_KEY>"
},
"models": { "<MODEL>": {} }
}
}
}