OpenClaw小龙虾配置教程程

2026/04/21
技术手册

OpenClaw小龙虾配置教程

OpenClaw小龙虾配置教程

OpenClaw安装说明

1.1安装Node.js环境

所有工具都需要Node.js环境才能运行。

  1. 打开浏览器访问https://nodejs.org/

  2. 点击"LTS"版本进行下载

验证Node.js是否安装成功

node --version
npm --version

1.2安装OpenClaw

1.3配置方法

找到openclaw的安装目,找到对应的配置文件,直接将配置中的模型url和秘钥按照如下方式替换成自己的即可。

windows:C:\Users\Administrator.openclaw\openclaw.json

mac:~.openclaw\openclaw.json

Linux不规定,基本在:/home/你的用户名/.openclaw/openclaw.json

单独使用Codex的配置

{
    "agents": {
        "defaults": {
            "model": {
                "primary": "zcst/gpt-5.3-codex"
            },
            "models": {
                "zcst/gpt-5.3-codex": {
                    "alias": "codex"
                },
                "zcst/gpt-5.2": {
                    "alias": "5.2"
                },
                "zcst/gpt-5.3": {
                    "alias": "5.3"
                },
                "zcst/gpt-5.4": {
                    "alias": "5.4"
                }
            },
            "thinkingDefault": "xhigh"
        }
    },
    "models": {
        "mode": "replace",
        "providers": {
            "zcst": {
                "baseUrl": "https://token.scholarforce.ai",
                "api": "openai-responses",
                "auth": "api-key",
                "authHeader": true,
                "headers": {
                    "User-Agent": "Mozilla/5.0"
                },
                "apiKey": "你的key",
                "models": [
                    {
                        "id": "gpt-5.3-codex",
                        "name": "GPT-5.3-Codex",
                        "api": "openai-responses",
                        "reasoning": true,
                        "input": [
                            "text",
                            "image"
                        ],
                        "cost": {
                            "input": 0,
                            "output": 0,
                            "cacheRead": 0,
                            "cacheWrite": 0
                        }
                    },
                    {
                        "id": "gpt-5.2",
                        "name": "GPT-5.2",
                        "api": "openai-responses",
                        "reasoning": true,
                        "input": [
                            "text",
                            "image"
                        ],
                        "cost": {
                            "input": 0,
                            "output": 0,
                            "cacheRead": 0,
                            "cacheWrite": 0
                        }
                    },
                    {
                        "id": "gpt-5.3",
                        "name": "GPT-5.3",
                        "api": "openai-responses",
                        "reasoning": true,
                        "input": [
                            "text",
                            "image"
                        ],
                        "cost": {
                            "input": 0,
                            "output": 0,
                            "cacheRead": 0,
                            "cacheWrite": 0
                        }
                    },
                    {
                        "id": "gpt-5.4",
                        "name": "GPT-5.4",
                        "api": "openai-responses",
                        "reasoning": true,
                        "input": [
                            "text",
                            "image"
                        ],
                        "cost": {
                            "input": 0,
                            "output": 0,
                            "cacheRead": 0,
                            "cacheWrite": 0
                        }
                    }
                ]
            }
        }
    }
}

单独使用Claude的配置

{
    "agents": {
        "defaults": {
            "model": {
                "primary": "opus/claude-sonnet-4-6"
            },
            "models": {
                "opus/claude-opus-4-6": {
                    "alias": "opus"
                },
                "opus/claude-sonnet-4-6": {
                    "alias": "sonnet"
                }
            },
            "thinkingDefault": "high"
        }
    },
    "models": {
        "mode": "replace",
        "providers": {
            "opus": {
                "baseUrl": "https://token.scholarforce.ai",
                "api": "anthropic-messages",
                "auth": "api-key",
                "authHeader": true,
                "apiKey": "你的key",
                "models": [
                    {
                        "id": "claude-opus-4-6",
                        "name": "claude-opus-4-6",
                        "api": "anthropic-messages",
                        "input": [
                            "text",
                            "image"
                        ]
                    },
                    {
                        "id": "claude-sonnet-4-6",
                        "name": "claude-sonnet-4-6",
                        "api": "anthropic-messages",
                        "input": [
                            "text",
                            "image"
                        ]
                    }
                ]
            }
        }
    }
}

::: 可默认使用claude-sonnet-4-6模型,opus模型消耗token过快,负责任务时,可是给龙虾命令指定模型 :::

Codex和Claude配置使用

  {
    "agents": {
      "defaults": {
        "model": { "primary": "opus/claude-opus-4-6" },
        "models": {
          "opus/claude-opus-4-6": { "alias": "opus" },
          "zcst/gpt-5.3-codex": { "alias": "codex" }
        },
        "thinkingDefault": "high"
      }
    },
    "models": {
      "mode": "replace",
      "providers": {
        "zcst": {
          "baseUrl": "https://token.scholarforce.ai",
          "api": "openai-responses",
          "auth": "api-key",
          "authHeader": true,
          "headers": { "User-Agent": "macos-terminal-test" },
          "apiKey": "你的key",
          "models": [
            {
              "id": "gpt-5.3-codex",
              "name": "GPT-5.3-Codex",
              "api": "openai-responses",
              "reasoning": true,
              "input": ["text", "image"],
              "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
            }
          ]
        },
        "opus": {
          "baseUrl": "https://token.scholarforce.ai",
          "api": "anthropic-messages",
          "auth": "api-key",
          "authHeader": true,
          "apiKey": "你的key",
          "models": [
            {
            "id": "claude-opus-4-6",
            "name": "claude-opus-4-6",
            "api": "anthropic-messages",
            "input": ["text","image"]
            }
          ]
        }
      }
    }
  }

字段说明(可选):

  • input:模型支持的输入模态(text/image

  • cost:仅用于成本统计/显示,不影响请求

::: openclaw配置修改后,需要重启openclaw :::

1.4启动OpenClaw

#停止
openclaw gateway stop  
#开启
openclaw gateway start 
#重启
openclaw gateway restart 

说明(很重要):

  • 上面三个命令是服务模式(计划任务)。如果服务未安装,会提示_ScheduledTasknotinstalled_,或者一直提示_sendfailed:Error:gatewaynotconnected_

  • 要安装服务(管理员Powerjava):

openclaw gateway install
openclaw gateway start
  • 前台运行(不走服务)
openclaw gateway
# 或
openclaw gateway run
  • 启动后先检查是否真正可用:
openclaw status
  • 看到Gateway...reachable才算成功。

  • 然后开启新的窗口启动openclaw

1.5常见命令

查看状态

openclaw status

查看日志(跟随)

openclaw logs --follow

打开控制面板

openclaw dashboard --no-open

自动修复命令

openclaw doctor --fix

1.6小龙虾使用技巧

若您此前购买的Token套餐仍有大量余额,可直接配置至小龙虾平台。通过灵活指定模型,实现“大余额、精使用”,避免资源浪费。

场景推荐模型适用蟾宫
日常通用任务GPT-5.3文案撰写、日常问答、信息整理等高频常规操作,平衡响应速度与生成质量。
高难度复杂任务GPT-5.4深度逻辑推理、长文本分析、多步骤规划等对智能要求极高的场景。注意:该模型消耗较快,建议仅在关键任务中启用。
轻量级简单任务国产大模型基础对话、简单查询、格式转换等低门槛任务,大幅降低Token消耗成本。
专业代码编写代码生成、Debug调试、架构设计。Opus-4-6:适合处理复杂算法与全栈开发任务。 GPT-5.3-Code:适合常规脚本编写与快速原型开发,性价比更优。

1.7常见问题

权限不足

如果执行openclawgatewaystop/start提示权限不足:

  • 用管理员身份打开系统的命令行工具再执行

LLMrequesttimedout

这种情况一般是你开了梯子导致的关闭它,如果关了不行请检查你那边网络或者防火墙

400Instructionsarerequired

请检查你的配置是不是按教程的来的是Responses最新的格式,并且请确保你的openclaw有进行更新

其他教程

《Claude与Codex配置教程》

ScholarForce

ScholarForce

OpenClaw小龙虾配置教程程 | 知识库