Install
openclaw skills install @suidge/openrouter-free-helper监控 OpenRouter 免费模型的到期通知和新模型发现,自动每日检查并推送飞书通知
openclaw skills install @suidge/openrouter-free-helper监控 OpenRouter 免费模型的两类关键信息:
1. 安装 bb-browser(可选,用于增强发现链路)
# 使用 Homebrew 安装
brew install bb-browser
# 或使用 npm 全局安装
npm install -g bb-browser
2. 配置 Chrome 调试模式
bb-browser 需要 Chrome 在调试模式下运行(端口 9222):
# 手动启动 Chrome 调试模式
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--no-first-run \
--no-default-browser-check
或者:脚本会自动检测并启动 Chrome 调试模式(首次启动可能需要 10-15 秒)
3. Python 依赖
pip3 install requests beautifulsoup4
# 使用 ClawHub 安装
clawhub install openrouter-free-helper
编辑配置文件 ~/.openclaw/workspace/skills/openrouter-free-helper/config/config.json:
{
"check_time": "08:00",
"notify_channel": "feishu",
"notify_target": "user:ou_xxxxxxxxxxxxxxxxxxxxx",
"status_file": "~/.openclaw/workspace/skills/openrouter-free-helper/data/status.json",
"openclaw_config": "~/.openclaw/openclaw.json"
}
参数说明:
notify_target: 飞书用户 ID(格式:user:ou_xxx)check_time: 每日检查时间(24 小时制)status_file: 状态文件路径(自动创建)⚠️ Cron 场景必须使用
--no-notify,禁止脚本自行发送通知,统一交给 cron delivery 输出一次最终结果。
技能安装后不会自动创建 Cron 任务。如需每日自动检查,请手动添加一条 Cron,并让它读取固定任务说明文件。
示例:每日 08:00 执行
openclaw cron add --job '{
"id": "openrouter-monitor-001",
"name": "OpenRouter Free Model Monitor",
"schedule": {"kind": "cron", "expr": "0 8 * * *", "tz": "Asia/Shanghai"},
"sessionTarget": "isolated",
"wakeMode": "now",
"payload": {
"kind": "agentTurn",
"message": "Read /Users/neoshi/.openclaw/workspace/skills/openrouter-free-helper/references/cron-task.md and follow it exactly. Keep the run self-contained in an isolated session rooted at /Users/neoshi/.openclaw/workspace. Return only a brief plain-text summary suitable for Feishu delivery.",
"timeoutSeconds": 300
},
"delivery": {
"mode": "announce",
"channel": "feishu",
"to": "user:ou_xxxxxxxxxxxxxxxxxxxxx"
}
}'
检查 Cron 状态:
openclaw cron list
openclaw cron runs --jobId openrouter-monitor-001
# 基础检查(静默模式,仅在变化时通知)
python3 ~/.openclaw/workspace/skills/openrouter-free-helper/scripts/check-models.py
# 详细输出(查看执行过程)
python3 ~/.openclaw/workspace/skills/openrouter-free-helper/scripts/check-models.py --verbose
# 模拟运行(不发送通知)
python3 ~/.openclaw/workspace/skills/openrouter-free-helper/scripts/check-models.py --verbose --dry-run
# Cron / agent-run 场景:禁止脚本自行发通知,交给上层 delivery
python3 ~/.openclaw/workspace/skills/openrouter-free-helper/scripts/check-models.py --no-notify
⚠️ Cron 场景必须使用
--no-notify,否则脚本内通知与 cron delivery 可能重复发送。
# 获取所有免费模型列表
bb-browser site openrouter/free-models --json --openclaw
# 查询特定模型的到期信息
bb-browser site openrouter/model-expiry google/gemma-4-26b-a4b-it:free --json --openclaw
cat ~/.openclaw/workspace/skills/openrouter-free-helper/data/status.json
状态文件结构:
{
"last_check": "2026-04-10T21:59:06.858640",
"known_models": ["openrouter/google/gemma-4-26b-a4b-it:free", ...],
"expiring_soon": [
{
"model": "arcee-ai/trinity-large-preview",
"going_away_date": "2026-04-22",
"days_left": 11,
"url": "https://openrouter.ai/arcee-ai/trinity-large-preview"
}
]
}
| 级别 | 条件 | 行为 |
|---|---|---|
| 🚨 紧急 | ≤1 天到期 | 立即推送 |
| ⚠️ 警告 | ≤3 天到期 | 推送提醒 |
| 📅 预告 | >3 天到期 | 仅首次发现时推送 |
去重机制:
以下情况不发送通知:
症状:bb-browser 报错 "Chrome not connected"
解决:
# 1. 检查 Chrome 是否运行
ps aux | grep "remote-debugging-port=9222"
# 2. 手动启动 Chrome 调试模式
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222
# 3. 验证端口是否可访问
curl http://127.0.0.1:9222/json/version
症状:bb-browser site openrouter/free-models 返回空列表
检查:
# 查看适配器是否存在
ls -la ~/.bb-browser/sites/openrouter/
# 测试适配器
bb-browser site openrouter/free-models --json --openclaw
修复:重新安装技能或手动创建适配器(见 references/openrouter-structure.md)
症状:ModuleNotFoundError: No module named 'requests'
解决:
pip3 install requests beautifulsoup4
~/.openclaw/workspace/skills/openrouter-free-helper/
├── SKILL.md # 技能文档
├── config/
│ └── config.json # 配置文件
├── data/
│ └── status.json # 状态文件(自动生成)
├── scripts/
│ ├── check-models.py # 主检查脚本
│ └── fetch_page.py # 网页抓取模块
├── references/
│ ├── cron-task.md # Cron 任务说明
│ └── openrouter-structure.md # OpenRouter 结构分析
└── adapters/
└── openrouter/ # bb-browser 适配器(在 ~/.bb-browser/sites/)
编辑 Cron 配置:
openclaw cron edit
将 0 8 * * * 改为其他时间(如每小时检查:0 * * * *)
编辑 ~/.openclaw/openclaw.json,在 agents.defaults.models 或 agents[].model 中添加 :free 后缀的模型 ID:
{
"agents": {
"defaults": {
"models": {
"openrouter/google/gemma-4-26b-a4b-it:free": {},
"openrouter/google/gemma-4-31b-it:free": {}
}
}
}
}
脚本会自动识别并监控这些模型的到期状态。
requests(优先,稳定且快速)urllib(标准库兜底)说明:本地 Python 脚本不再伪装调用 OpenClaw 工具。工具型抓取属于 agent 运行期能力,不应在脚本里用 subprocess 硬模拟。
bb-browser site openrouter/free-models --json --openclawhttps://openrouter.ai/api/frontend/modelshttp://127.0.0.1:9222/json/version)/tmp/openclaw-chrome-debugendpoint.model_variant_slug 替代顶层 slug,确保返回带 :free 后缀的完整端点 ID--verbose 让模型能看到详细信息并整合到最终摘要:free 后缀的 openrouter/* 模型增加轻量页面探测,补抓“实际免费但未显式标 free”的模型--no-notify 并避免 async exec completion 后重复转述--no-notify 模式,供 cron 场景避免脚本内直接发通知问题反馈或功能建议,欢迎通过 GitHub Issues 提交。
最后更新: 2026-04-10
维护者: Silvermoon