OpenClaw快速添加并使用息壤模型 方式二:通过终端修改配置文件(适用于Windows 、mac 系统、Linux系统) 1. 在终端执行以下命令打开配置文件 Mac系统和Linux系统执行以下命令: plaintext nano ~/.openclaw/openclaw.json Windows系统执行以下命令(Windows系统推荐优先使用方式一): plaintext notepad %USERPROFILE%.openclawopenclaw.json 2. 复制以下内容到配置文件。将YOURAPIKEY替换为在服务接入页面所获取到的App Key。 plaintext { "models": { "mode": "merge", "providers": { "xirang": { "baseUrl": " "apiKey": "YOURAPIKEY", "api": "openaicompletions", "models": [ { "id": "GLM5", "name": "GLM5", "reasoning": true, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 204800, "maxTokens": 131072 }, { "id": "Qwen3.5397BA17B", "name": "Qwen3.5397BA17B", "reasoning": true, "input": [ "text", "image" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 65536, "maxTokens": 16384 }, { "id": "Qwen3Max", "name": "Qwen3Max", "reasoning": true, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 258048, "maxTokens": 65536 }, { "id": "DoubaoSeed2.0pro", "name": "DoubaoSeed2.0pro", "reasoning": true, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072, "maxTokens": 65536 }, { "id": "DeepSeekV3.2Standard", "name": "DeepSeekV3.2Standard", "reasoning": true, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072, "maxTokens": 16384 }, { "id": "DeepSeekV30324", "name": "DeepSeekV30324", "reasoning": true, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072, "maxTokens": 16384 }, { "id": "KimiK2Thinking", "name": "KimiK2Thinking", "reasoning": true, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 32768, "maxTokens": 16384 }, { "id": "DeepSeekR10528", "name": "DeepSeekR10528", "reasoning": true, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 98304, "maxTokens": 16384 } ] } } }, "agents": { "defaults": { "model": { "primary": "xirang/GLM5" }, "models": { "xirang/GLM5": {}, "xirang/Qwen3.5397BA17B": {}, "xirang/Qwen3Max": {}, "xirang/DoubaoSeed2.0pro": {}, "xirang/DeepSeekV3.2Standard": {}, "xirang/DeepSeekV30324": {}, "xirang/KimiK2Thinking": {}, "xirang/DeepSeekR10528": {} } } }, "gateway": { "mode": "local" } } 3. 保存文件并退出,运行以下命令来使配置生效。 plaintext openclaw gateway restart