跳到正文
Skillpedia
其他81k · #1605

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-openrouter/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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 --yes the 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 option openrouterApiKey arrives as OPENROUTER_API_KEY too: 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_cost is authoritative; do not recompute it from list prices.
  • credits needs 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 in upstream_inference_cost: show both, labelled.
  • Fallback and openrouter/auto can change the billed model: report model and provider_name as 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能