3分钟OpenClaw接入Claude/Codex,有手就行龙虾教程

 

图片

哈喽大家好,我是阿星👋

今天给你一个「有手就行」的 OpenClaw 配置方法。

不用改文件、不用记命令,

直接把下面的代码发给 OpenClaw,它自己帮你配好。

图片

前提

OpenClaw 已经装好了有对应平台的 API Key

如果要选默认模型提前改:

改 "primary" 的值,比如:   - "hongmacc/claude-sonnet-4-6"   - "dashscope-coding/kimi-k2.5"   - "aigocode/claude-opus-4-6"

发给 OpenClaw:粘贴到聊天窗口,等它说「搞定」

填 Key:把你有 Key 的地方填上,没有的可以删掉或留空

  • 这个配置里包含以下模型:

    Claude 系列(Anthropic)

    • claude-sonnet-4-6(hongmacc)

    • claude-opus-4-6(AIGoCode)

    • claude-sonnet-4-6(AIGoCode)

    阿里云 DashScope 系列

    • dashscope: qwen3.5-plus(国内版)

    • dashscope-us: qwen3-max-2025-09-23(美区版)

    • dashscope-coding 包含:

    • qwen3-max-2026-01-23

    • qwen3-coder-next

    • qwen3-coder-plus

    • MiniMax-M2.5

    • glm-5

    • glm-4.7

    • kimi-k2.5

    • qwen3.5-plus

    GPT 系列(AIGoCode)

    • gpt-5.4

    • gpt-5.3-codex

    总共 15 个模型。

📋 配置模板

下面这是我自己的配置。

把下面这段完整复制, 把你有的 API Key 填进去 (没有的 provider 可以删掉,或者留着以后用),

然后把这篇文章特别是下面这段代码发给 OpenClaw:

请帮我把这段配置写入 ~/.openclaw/openclaw.json:{  "models": {    "providers": {      "hongmacc": {        "baseUrl": "https://hongmacc.com",        "apiKey": "sk-你的hongmaccKey",        "api": "anthropic-messages",        "headers": {          "User-Agent": "Mozilla/5.0"        },        "models": [          {            "id": "claude-sonnet-4-6",            "name": "Claude Sonnet 4.6 (hongmacc)",            "api": "openai-completions",            "reasoning": false,            "input": ["text", "image"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 200000,            "maxTokens": 64000          }        ]      },      "dashscope": {        "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",        "apiKey": "sk-你的阿里云Key",        "api": "openai-completions",        "models": [          {            "id": "qwen3.5-plus",            "name": "Qwen3.5-Plus",            "api": "openai-completions",            "reasoning": false,            "input": ["text", "image"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 1000000,            "maxTokens": 65536          }        ]      },      "dashscope-us": {        "baseUrl": "https://dashscope-us.aliyuncs.com/compatible-mode/v1",        "apiKey": "sk-你的阿里云USKey",        "api": "openai-completions",        "models": [          {            "id": "qwen3-max-2025-09-23",            "name": "qwen3-max-2025-09-23",            "api": "openai-completions",            "reasoning": false,            "input": ["text"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 32768,            "maxTokens": 8192          }        ]      },      "dashscope-coding": {        "baseUrl": "https://coding.dashscope.aliyuncs.com/v1",        "apiKey": "sk-你的阿里云CodingKey",        "api": "openai-completions",        "models": [          {            "id": "qwen3-max-2026-01-23",            "name": "qwen3-max-2026-01-23",            "api": "openai-completions",            "reasoning": false,            "input": ["text"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 262144,            "maxTokens": 65536          },          {            "id": "qwen3-coder-next",            "name": "qwen3-coder-next",            "api": "openai-completions",            "reasoning": false,            "input": ["text"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 262144,            "maxTokens": 65536          },          {            "id": "qwen3-coder-plus",            "name": "qwen3-coder-plus",            "api": "openai-completions",            "reasoning": false,            "input": ["text"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 1000000,            "maxTokens": 65536          },          {            "id": "MiniMax-M2.5",            "name": "MiniMax-M2.5",            "api": "openai-completions",            "reasoning": false,            "input": ["text"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 204800,            "maxTokens": 131072          },          {            "id": "glm-5",            "name": "glm-5",            "api": "openai-completions",            "reasoning": false,            "input": ["text"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 202752,            "maxTokens": 16384          },          {            "id": "glm-4.7",            "name": "glm-4.7",            "api": "openai-completions",            "reasoning": false,            "input": ["text"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 202752,            "maxTokens": 16384          },          {            "id": "kimi-k2.5",            "name": "Kimi K2.5",            "api": "openai-completions",            "reasoning": false,            "input": ["text", "image"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 262144,            "maxTokens": 32768          },          {            "id": "qwen3.5-plus",            "name": "Qwen3.5-Plus",            "api": "openai-completions",            "reasoning": false,            "input": ["text", "image"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 1000000,            "maxTokens": 65536          }        ]      },      "aigocode": {        "baseUrl": "https://api.aigocode.com",        "apiKey": "sk-你的AIGoCodeKey",        "api": "anthropic-messages",        "headers": {          "User-Agent": "Mozilla/5.0"        },        "models": [          {            "id": "claude-opus-4-6",            "name": "Claude Opus 4.6 (AiGoCode)",            "api": "anthropic-messages",            "reasoning": false,            "input": ["text", "image"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 200000,            "maxTokens": 64000          },          {            "id": "claude-sonnet-4-6",            "name": "Claude Sonnet 4.6 (AiGoCode)",            "api": "anthropic-messages",            "reasoning": false,            "input": ["text", "image"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 200000,            "maxTokens": 64000          }        ]      },      "aigocode-gpt": {        "baseUrl": "https://api.aigocode.com",        "apiKey": "sk-你的AIGoCodeGPTKey",        "api": "openai-responses",        "models": [          {            "id": "gpt-5.4",            "name": "GPT-5.4 (AiGoCode)",            "reasoning": false,            "input": ["text", "image"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 128000,            "maxTokens": 16384,            "api": "openai-responses"          },          {            "id": "gpt-5.3-codex",            "name": "GPT-5.3 Codex (AiGoCode)",            "reasoning": false,            "input": ["text", "image"],            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },            "contextWindow": 128000,            "maxTokens": 16384,            "api": "openai-responses"          }        ]      }    }  },  "agents": {    "defaults": {      "model": {        "primary": "aigocode/claude-opus-4-6"      }    }  }}

配置完后执行 openclaw gateway restart 重启服务。你好,你是谁?

图片

如果它醒来后特别晕,大概率是降智了或者站的原因。

别着急,直接去他们服务中心问问就行了。

我是阿星,

更多AI应用,我们下期再见!

图片