OpenCode(1) 本文为您介绍编码套餐接入OpenCode的详细步骤。 配置 Coding Plan 请在以下路径创建并打开配置文件 opencode.json: macOS / Linux: ~/.config/opencode/opencode.json Windows: C:Users您的用户名.configopencodeopencode.json 将以下配置写入文件,关键配置项: YOURAPIKEY为你购买的编程套餐专属的API Key。 models的配置则为 来源于您当前购买实际套餐的可用模型,以下示例配置以GLM MAX(旗舰版)为例,不同编码套餐支持调用的模型不一样。 plaintext { "$schema": " "provider": { "xirang": { "npm": "@aisdk/openaicompatible", "name": "xirang", "options": { "baseURL": " "apiKey": "YOURAPIKEY" }, "models": { "GLM4.7": { "name": "GLM4.7" }, "GLM5": { "name": "GLM5" }, "GLM5Turbo": { "name": "GLM5Turbo" }, "GLM5.1": { "name": "GLM5.1" }, "GLM4.5": { "name": "GLM4.5" }, "GLM4.5Air": { "name": "GLM4.5Air" }, "GLM4.6": { "name": "GLM4.6" } } } }, "model": "xirang/GLM4.7", "smallmodel": "xirang/GLM4.7" }
来自: