如何为 ClawdBot (MoltBot) 配置自定义模型与 API Key BaseUrl

ClawdBotMoltBot)一款强大的 AI Agent 工具, 通过自定义供应商配置,你可以轻松接入 LiteLLM、本地 OpenAI 兼容服务器(如 Ollama/vLLM)、第三方 API 服务

参考官方文档:https://docs.clawd.bot/gateway/configuration#models-custom-providers-+-base-urls

1. 核心配置文件路径

在进行任何自定义操作前,请确保你已知晓配置文件的存放位置。所有的模型与代理设置均在以下 JSON 文件中完成:

  • 路径: ~/.clawdbot/clawdbot.json

 

F2API 接入 Gemini 3 Flash 为例,请确保将 apiKey 替换为你自己的真实 Key:

{
  "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
          }
        ]
      }
    }
  }
}

 

posted @ 2026-01-29 10:03  xdea  阅读(241)  评论(0)    收藏  举报