Install and configure mirage-proxy as a transparent PII/secrets filter for OpenClaw LLM API calls. Handles binary installation, provider config, auto-restart, and multi-model routing through the proxy.
OpenClaw与LLM提供商之间的透明机密/PII过滤器。用合理的假数据替换敏感信息——LLM永远不会知道。
GitHub: https://github.com/chandika/mirage-proxy
运行捆绑的设置脚本:
bash
bash ~/.openclaw/workspace/skills/mirage-proxy/setup.sh
这将下载二进制文件,创建自动重启包装器,启动代理,并验证其运行状态。
卸载:bash ~/.openclaw/workspace/skills/mirage-proxy/setup.sh --uninstall
setup.sh成功运行后,修改OpenClaw配置。保留原始提供商并添加mirage版本以实现即时回退:
json5
{
models: {
mode: merge,
providers: {
mirage-anthropic: {
baseUrl: http://127.0.0.1:8686/anthropic,
api: anthropic-messages,
apiKey: ${ANTHROPICAPIKEY},
models: [
{ id: claude-opus-4-6, name: Claude Opus 4.6 (mirage), api: anthropic-messages, reasoning: true, input: [text, image], cost: {input:0,output:0,cacheRead:0,cacheWrite:0}, contextWindow: 200000, maxTokens: 32000 },
{ id: claude-sonnet-4-6, name: Claude Sonnet 4.6 (mirage), api: anthropic-messages, reasoning: true, input: [text, image], cost: {input:0,output:0,cacheRead:0,cacheWrite:0}, contextWindow: 200000, maxTokens: 16000 },
{ id: claude-haiku-3-6, name: Claude Haiku 3.6 (mirage), api: anthropic-messages, reasoning: false, input: [text, image], cost: {input:0,output:0,cacheRead:0,cacheWrite:0}, contextWindow: 200000, maxTokens: 8192 }
]
}
}
},
agents: {
defaults: {
models: {
anthropic/claude-opus-4-6: { alias: anthropic-opus },
anthropic/claude-sonnet-4-6: { alias: anthropic-sonnet },
anthropic/claude-haiku-3-6: { alias: anthropic-haiku },
mirage-anthropic/claude-opus-4-6: { alias: mirage-opus },
mirage-anthropic/claude-sonnet-4-6: { alias: mirage-sonnet },
mirage-anthropic/claude-haiku-3-6: { alias: mirage-haiku }
}
}
}
}
对于基于OAuth的提供商(无API密钥环境变量),覆盖内置提供商的baseUrl,而不是创建自定义提供商:
json5
{
models: {
mode: merge,
providers: {
openai-codex: {
baseUrl: http://127.0.0.1:8686
}
}
}
}
⚠️ 除非容器中存在环境变量,否则不要向自定义提供商添加apiKey: ${OPENAIAPIKEY}——这会导致OpenClaw启动时崩溃。
配置后,使用/model切换:
| 别名 | 路由 |
|---|---|
| anthropic-opus | 直接连接Anthropic |
| mirage-opus |
mirage-proxy在OpenClaw重启后会停止运行。两种解决方案:
Docker入口点(推荐):
yaml
心跳检查(回退方案):
添加到HEARTBEAT.md:
curl -s -o /dev/null -w %{http_code} http://127.0.0.1:8686/
如果返回000或连接被拒绝 → 通过start-mirage.sh重启。
bash
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 mirage-proxy-1776420084 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 mirage-proxy-1776420084 技能
skillhub install mirage-proxy-1776420084
文件大小: 4.37 KB | 发布时间: 2026-4-17 20:13