Lumoswitch 文档
Agent 接入

OpenClaw Agent 接入

OpenClaw 是运行在本机 Gateway 上的通用 Agent,适合长期运行自动化、工具、频道和跨设备会话。CLI、Control UI 与 macOS 伴侣应用连接的是同一个 Gateway,因此模型提供方属于 Gateway 的持久状态。

开始前,请安装 OpenClaw,并在 Lumoswitch 中创建使用 OpenAI-compatible 输出的配置 API。

方式总览

方式是否支持原因
仅本次启动不支持OpenClaw 必须先把提供方、模型和凭证写入 Gateway 状态;官方没有完整的单次 Base URL / 模型覆盖参数
永久使用支持通过官方 onboarding 保存自定义提供方,供 Gateway 持续使用
清除接入支持使用官方 config unsetmodels auth logout 精确移除 Lumoswitch 项

不要用删除 ~/.openclaw 的方式清除接入;该目录还包含频道、会话、工作区与其他提供方凭证。

准备连接信息

占位符应填写的内容
{{api_base_url}}配置 API 的下游地址,包含 /v1
{{access_key}}当前配置使用的 Lumoswitch Access Key
{{model}}配置 API 显示的下游模型名称
{{openclaw_models_json}}按有效推理能力生成的模型与 compat 能力 JSON
{{openclaw_agent_models_json}}可供 Agent 选择的 Lumoswitch 模型映射 JSON

永久使用

首次设置或地址、Access Key、模型变化时运行:

OpenClaw onboarding 会把 Access Key 写入当前 Agent 的本机凭证存储。请只在个人可信设备上使用。

set -e
openclaw onboard --non-interactive --accept-risk --mode local \
  --skip-health \
  --auth-choice custom-api-key \
  --custom-base-url "{{api_base_url}}" \
  --custom-model-id "{{model}}" \
  --custom-api-key "{{access_key}}" \
  --custom-provider-id "lumoswitch" \
  --custom-compatibility openai \
  --secret-input-mode plaintext
LUMOSWITCH_OPENCLAW_MODELS='{{openclaw_models_json}}'
LUMOSWITCH_OPENCLAW_AGENT_MODELS='{{openclaw_agent_models_json}}'
openclaw config set models.providers.lumoswitch.models "$LUMOSWITCH_OPENCLAW_MODELS" --strict-json --replace
openclaw config set agents.defaults.models "$LUMOSWITCH_OPENCLAW_AGENT_MODELS" --strict-json --merge
openclaw models set "lumoswitch/{{model}}"
openclaw

以后直接运行:

openclaw

这里没有临时接入命令。生成的模型目录会设置 reasoning,并只在渠道确实能传输可调档位时写入 supportsReasoningEffortsupportedReasoningEffortsreasoningEffortMap;每模型 params.thinking 同步为安全默认档位,否则显式为 off,避免全局默认值向不兼容端点注入参数。

Windows PowerShell 原生导入

以下命令在 Windows PowerShell 中原生运行,不需要 WSL。它们与本页的 macOS/Linux 模板使用同一组连接值。

永久使用(Windows)

该命令会备份已有的 Lumoswitch 专用文件,并为配置和启动器收紧当前用户的访问权限。

& {
  $ErrorActionPreference = 'Stop'
  $lumoswitchExecutable = Get-Command 'openclaw.cmd' -CommandType Application -ErrorAction SilentlyContinue
  if ($null -eq $lumoswitchExecutable) { $lumoswitchExecutable = Get-Command 'openclaw' -CommandType Application -ErrorAction Stop }
  $lumoswitchOpenClaw = $lumoswitchExecutable.Path

  & $lumoswitchOpenClaw 'onboard' '--non-interactive' '--accept-risk' '--mode' 'local' '--skip-health' '--auth-choice' 'custom-api-key' '--custom-base-url' '{{api_base_url}}' '--custom-model-id' '{{model}}' '--custom-api-key' '{{access_key}}' '--custom-provider-id' 'lumoswitch' '--custom-compatibility' 'openai' '--secret-input-mode' 'plaintext'
  if ($LASTEXITCODE -ne 0) { throw 'OpenClaw onboarding failed.' }
  $lumoswitchModels = @'
{{openclaw_models_json}}
'@
  & $lumoswitchOpenClaw 'config' 'set' 'models.providers.lumoswitch.models' $lumoswitchModels '--strict-json' '--replace'
  if ($LASTEXITCODE -ne 0) { throw 'OpenClaw model configuration failed.' }
  $lumoswitchAgentModels = @'
{{openclaw_agent_models_json}}
'@
  & $lumoswitchOpenClaw 'config' 'set' 'agents.defaults.models' $lumoswitchAgentModels '--strict-json' '--merge'
  if ($LASTEXITCODE -ne 0) { throw 'OpenClaw Agent configuration failed.' }
  & $lumoswitchOpenClaw 'models' 'set' 'lumoswitch/{{model}}'
  if ($LASTEXITCODE -ne 0) { throw 'OpenClaw default-model selection failed.' }
  & $lumoswitchOpenClaw
}

清除 Lumoswitch 接入

以下命令在 Windows PowerShell 与 macOS/Linux 终端中完全相同。该原生配置由 OpenClaw 自己管理,因此没有 Lumoswitch 启动器文件需要删除。

先检查当前默认模型:

openclaw config get agents.defaults.model --json

如果输出仍指向 lumoswitch/{{model}},先切换到一个已经配置好的其他模型:

openclaw models set "other-provider/model"

然后精确移除 Lumoswitch 提供方,并列出可能仍存在的凭证资料:

openclaw config unset models.providers.lumoswitch
openclaw models auth list --provider lumoswitch

如果第二条命令列出了 Profile ID,再按它显示的真实 ID 运行:

openclaw models auth logout "replace-with-profile-id" --yes

这些都是 OpenClaw 官方的字段级命令,不会删除其他提供方、频道、Gateway、会话或工作区。Profile ID 由 OpenClaw 实际存储决定,因此不能在文档中安全写死。清除后运行 openclaw config validate 检查剩余配置。

macOS 伴侣应用与其他界面

OpenClaw 官方 macOS 应用是菜单栏伴侣,不是独立推理客户端:它会连接本机或远程 Gateway,并复用该 Gateway 的默认模型和凭证。完成上面的 onboarding 后不需要在应用中再次保存 Lumoswitch Key;清除 Gateway 中的 Lumoswitch 提供方也会让伴侣应用停止使用它。

Control UI 同样操作 Gateway 配置,可在 Settings → Model Providers 中查看来源、测试连接或移除配置中保存的 API Key。OpenClaw 没有需要另配一份 Lumoswitch 凭证的官方 IDE 扩展;编辑器或远程客户端接入的仍是现有 Gateway。

验证与排查

  • 本页模板面向 OpenAI-compatible Chat Completions。
  • 使用 openclaw models status --json 检查提供方、凭证与运行时状态。
  • 使用 openclaw config validate 检查字段级清除后是否仍有无效引用。
  • 模型必须真实支持 OpenClaw 所需的工具调用;协议兼容不能补齐缺失能力。

参考:自定义提供方配置非交互式 onboardingConfig CLIModels CLImacOS 伴侣应用

维护者发布字段
  • 平台 ID:openclaw
  • 展示名称:OpenClaw CLI
  • 下游协议:openai-compatible
  • 临时模式:关闭;commandTemplate 不适用
  • 永久策略:native
  • persistentCommandTemplate:复制「永久使用」代码框的完整内容
  • futureCommandopenclaw
  • 展示顺序:80
  • 最近核验:2026-08-27

On this page