OpenClaw API 龙虾一键配置生成工具 第三方中转站自定义模型API Key BaseUrl
OpenClaw(ClawdBot/MoltBot)一款强大的 AI Agent 工具, 通过自定义供应商配置,你可以轻松接入 LiteLLM、本地 OpenAI 兼容服务器(如 Ollama/vLLM)、第三方 API 服务
参考官方文档:https://docs.clawd.bot/gateway/configuration#models-custom-providers-+-base-urls
核心配置文件路径
在进行任何自定义操作前,请确保你已知晓配置文件的存放位置。所有的模型与代理设置均在以下 JSON 文件中完成:
以 F2API 接入 Gemini 3 Flash 为例,请确保将 apiKey 替换为你自己的真实 Key:
手工配置 ~/.openclaw/openclaw.json
{ "agents": { "defaults": { "model": { "primary": "custom-proxy/gemini-3-flash-preview" }, "models": { "custom-proxy/gemini-3-flash-preview": {} } } }, "models": { "mode": "merge", "providers": { "custom-proxy": { "baseUrl": "https://api.f2api.com/v1", "apiKey": "sk-your-f2api-key-here", "api": "openai-completions", "models": [ { "id": "gemini-3-flash-preview", "name": "gemini-3-flash-preview", "reasoning": false, "input": ["text"], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 128000, "maxTokens": 32000 } ] } } } }

浙公网安备 33010602011771号