Skip to content
Back to skills

Cost Openrouter

ASecurity

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.

  • 82,861 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 9, 2026
ai-agentsbashnodeapi

Works with

  • api

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add ruvnet/ruflo --skill cost-openrouter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cost Openrouter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cost Openrouter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ruvnet-cost-openrouter-ruflo/badge)](https://www.skillsdirectory.com/skills/ruvnet-cost-openrouter-ruflo)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cost-openrouter
description: 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.
argument-hint: "key | generation <id> | credits"
allowed-tools: Bash
---

# Cost OpenRouter

Network skill. **Ask the user before running it**, and run it only with their yes.

```bash
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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.