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.
1---2name: cost-openrouter3description: "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."4argument-hint: "key | generation <id> | credits"5allowed-tools: Bash6metadata:7 source: https://skillmd.com/skills/ruvnet/cost-openrouter8---910# Cost OpenRouter1112Network skill. **Ask the user before running it**, and run it only with their yes.1314```bash15node ${CLAUDE_PLUGIN_ROOT}/scripts/openrouter.mjs key --yes16node ${CLAUDE_PLUGIN_ROOT}/scripts/openrouter.mjs generation gen-abc123 --yes17node ${CLAUDE_PLUGIN_ROOT}/scripts/openrouter.mjs credits --yes18```1920## Rules2122- Without `--yes` the script prints the call it would make and sends nothing.23- 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.24- OpenRouter's `usage.cost` / `total_cost` is **authoritative**; do not recompute it from list prices.25- `credits` needs a management key (a normal key returns 403). A fresh generation can 404 briefly: retry.26- BYOK rows carry the 5% OpenRouter fee in `usage`, the provider's charge in `upstream_inference_cost`: show both, labelled.27- Fallback and `openrouter/auto` can change the billed model: report `model` and `provider_name` as returned.
Run npx get-skill add ruvnet/cost-openrouter in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Cost OpenRouter It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
ruvnet (@ruvnet) published this skill. Their other Agent Skills are listed on their SkillMD profile.