OpenCode 配置模型 请在以下路径创建并打开配置文件 opencode.json: macOS / Linux: ~/.config/opencode/opencode.json Windows: C:Users您的用户名.configopencodeopencode.json 将以下配置写入文件,关键配置项: YOURAPIKEY为你服务组的API Key。 models的配置则为 来源于您当前实际可用的模型,以下示例配置以GLM5Pro为例。 plaintext { "$schema": " "provider": { "xirang": { "npm": "@aisdk/openaicompatible", "name": "xirang", "options": { "baseURL": " "apiKey": "YOURAPIKEY" }, "models": { "GLM5Pro": { "name": "GLM5Pro" }, "DeepSeekV3.2Pro": { "name": "DeepSeekV3.2Pro" } } } }, "model": "xirang/GLM5Pro", "smallmodel": "xirang/GLM5Pro" } 运行 opencode 启动 OpenCode 在命令行中输入以下命令: plaintext $ opencode 使用 /models 命令来选择模型,例如 GLM5。 plaintext /models