openrouter-sync:每天自动同步 OpenRouter 免费模型列表
openrouter-sync:每天自动同步 OpenRouter 免费模型列表
Never pay for a model that’s available for free.
背景
OpenRouter 是个很棒的聚合服务。它提供了统一的 API 来访问 Anthropic、OpenAI、Google 等众多厂商的模型。最重要的是,上面有大量免费可用的模型。
但问题是,免费模型列表变化频繁:
- 新模型不断加入
- 免费模型可能变为付费
- 速率限制经常调整
- 文档更新滞后于现实
手动跟踪这些变化很麻烦。这个 Skill 就是为了自动化这个麻烦事。
功能
openrouter-sync 每天早上6点自动执行:
- 从 OpenRouter API 获取最新模型列表
- 筛选出免费模型(prompt=0, completion=0)
- 与当前 OpenClaw 配置对比
- 如有变化则自动更新配置
- 记录所有操作以便审计
安装
# 从 GitHub 克隆
git clone https://github.com/gumi-ink/gumi-skills.git
cp -r gumi-skills/skills/openrouter-sync ~/.openclaw/workspace/skills/
# 设置 API Key
echo "sk-or-v1-xxxxxxxx" > ~/.openclaw/openrouter.key
chmod 600 ~/.openclaw/openrouter.key
# 设置定时任务
openclaw cron create \
--name openrouter-sync \
--cron "0 6 * * *" \
--description "Sync OpenRouter free models" \
--message "Run openrouter-sync" \
--agent main
当前免费模型(2026年3月)
| 模型 | 参数量 | 备注 |
|---|---|---|
| google/gemma-3-27b-it:free | 27B | 已实测可用 ✅ |
| meta-llama/llama-3.3-70b-instruct:free | 70B | 高性能 |
| nousresearch/hermes-3-llama-3.1-405b:free | 405B | 超大规模 |
| mistralai/mistral-small-3.1-24b-instruct:free | 24B | 轻量级 |
这些模型都可以免费使用,但要注意有速率限制。
技术细节
最初的实现使用 jq 的字符串比较,但安全审核中发现存在漏洞("0" vs 0 vs "0.0" 的问题)。最终改为使用 tonumber 进行数值比较。
即使是小 Skill,安全也不容忽视。
开源地址
📦 GitHub: https://github.com/gumi-ink/gumi-skills
仓库里还有其他 Skill,欢迎查看。
总结
如果你在用 OpenRouter,这个 Skill 能帮你最大化利用免费模型。新模型上线第一时间知道,避免继续使用已废弃的模型。
能免费用,就别花钱。
本文作者:谷米 🌾 | 前端开发工程师 | 专注可靠工具开发