cost-openrouter
它能做什么
这项技能检查你的 OpenRouter 账户的支出、密钥额度,以及单个请求的账单。适合使用 OpenRouter、想查看自己被扣了多少费用的人。
适用场景
- ✓当你想知道 OpenRouter 今天、本周或本月向你收取了多少费用时。
- ✓当某个密钥可能接近其支出上限时。
- ✓当你想查看某个特定请求的计费金额时。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-openrouter/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 OpenRouter 密钥离额度上限还有多远?本月我花了多少钱?”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能使用你自己的密钥调用 OpenRouter,但只有在你同意之后才会调用。它显示 OpenRouter 返回的数据,并将其视为官方金额。它从不打印或保存密钥。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Cost OpenRouter
Network skill. Ask the user before running it, and run it only with their yes.
node ${CLAUDE_PLUGIN_ROOT}/scripts/openrouter.mjs key --yes
node ${CLAUDE_PLUGIN_ROOT}/scripts/openrouter.mjs generation gen-abc123 --yes
node ${CLAUDE_PLUGIN_ROOT}/scripts/openrouter.mjs credits --yes
Rules
- Without
--yesthe script prints the call it would make and sends nothing. - The key comes from
OPENROUTER_API_KEY(credits:OPENROUTER_MANAGEMENT_KEY). A key the user stored as the plugin optionopenrouterApiKeyarrives asOPENROUTER_API_KEYtoo: the plugin's SessionStart hook puts it there for this session's commands when the variable is not already set (ADR-506). Never ask the user to paste a key, never print, log or write one. - OpenRouter's
usage.cost/total_costis authoritative; do not recompute it from list prices. creditsneeds a management key (a normal key returns 403). A fresh generation can 404 briefly: retry.- BYOK rows carry the 5% OpenRouter fee in
usage, the provider's charge inupstream_inference_cost: show both, labelled. - Fallback and
openrouter/autocan change the billed model: reportmodelandprovider_nameas returned.
常见问题
它会在未经询问的情况下发起网络请求吗?
不会。没有同意参数时,它只显示将要进行的调用,不会发送任何内容。
密钥从哪里来?
来自你电脑上的环境变量。这项技能从不要求你把密钥粘贴到聊天中。
为什么额度检查会失败?
额度检查需要管理密钥。普通密钥在该检查中会被拒绝。
详情
作者的原始描述
OpenRouter real spend — key limit and usage today/week/month, one request's billed cost by generation id, account credits. Use when asked what OpenRouter charged or whether a key is near its limit. Network and API key: asks first.
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1605
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。