openrouter-usage

openrouter-usage is a skill for Claude Code, Codex from tdimino/claude-code-minoan. It costs 49 tokens per session (532 once invoked), scanned A, original, MIT.

A command-line tool that retrieves OpenRouter API spending, credits, and usage for the last 30 days. OpenRouter is a service that provides access to models from multiple AI providers through an API.

In plain words
What is it for?
Use it to review spending, identify which models or providers used credits, check a single date, or export usage as CSV or JSON.
Why use it?
It replaces manual checking of provider dashboards with reports that can be filtered by date, model, provider, or exported for accounting.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it to review spending, identify which models or providers used credits, check a single date, or export usage as CSV or JSON.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tdimino/claude-code-minoan/openrouter-usage
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tdimino/claude-code-minoan --skill openrouter-usage
Clone the repo
git clone --depth 1 https://github.com/tdimino/claude-code-minoan

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openrouter-usage

README.md
[![agentmods](https://agentmods.dev/badge/skills/tdimino/claude-code-minoan/openrouter-usage/github.svg)](https://agentmods.dev/skills/tdimino/claude-code-minoan/openrouter-usage)
Your own site
<a href="https://agentmods.dev/skills/tdimino/claude-code-minoan/openrouter-usage"><img src="https://agentmods.dev/badge/skills/tdimino/claude-code-minoan/openrouter-usage/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openrouter-usage

Your own site · 80×15
<a href="https://agentmods.dev/skills/tdimino/claude-code-minoan/openrouter-usage"><img src="https://agentmods.dev/badge/skills/tdimino/claude-code-minoan/openrouter-usage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 532 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 20
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.00532
Opus 5 $0.00024 $0.00266
Sonnet 5 $0.00010 $0.00106
Haiku 4.5 $0.00005 $0.00053

Measured 9d ago against content hash 132d86c44e10, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

openrouter-usage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/openrouter_usage.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/core-development/openrouter-usage/SKILL.md · 60 lines

What it actually says

OpenRouter Usage

Query OpenRouter API costs and generate usage reports via the command line.

When to Use

  • Checking OpenRouter spend over the last 30 days
  • Breaking down costs by model, provider, or date
  • Exporting usage data as CSV or JSON for accounting
  • Auditing which models and API keys consume the most credits

Prerequisites

  • OPENROUTER_API_KEY environment variable (or in a project .env file)
  • The key must be a Management key — create one at https://openrouter.ai/settings/management-keys
  • Regular provisioning keys return 401/403 on analytics endpoints

Usage

# Full 30-day summary with credits balance
python3 ~/.claude/skills/openrouter-usage/scripts/openrouter_usage.py

# Filter to a single date
python3 ~/.claude/skills/openrouter-usage/scripts/openrouter_usage.py --date 2026-02-01

# Export as CSV (for spreadsheets)
python3 ~/.claude/skills/openrouter-usage/scripts/openrouter_usage.py --csv

# Raw JSON output (for piping to jq)
python3 ~/.claude/skills/openrouter-usage/scripts/openrouter_usage.py --json

# Skip credits lookup (activity only)
python3 ~/.claude/skills/openrouter-usage/scripts/openrouter_usage.py --no-credits

Output

The default report includes:

  • Credits balance: total purchased, used, remaining
  • Spend by model: per-model cost with token counts (prompt, completion, reasoning)
  • Spend by provider: aggregated by provider (OpenAI, Anthropic, Google, etc.)
  • Spend by date: daily spend with visual bar chart

API Endpoints

Both endpoints are read-only GETs authenticated via Bearer token:

Endpoint Purpose
GET /api/v1/credits Total credits purchased and used
GET /api/v1/activity Last 30 days of usage grouped by model/endpoint/provider

The activity endpoint returns per-row: date, model, provider_name, usage, byok_usage_inference, requests, prompt_tokens, completion_tokens, reasoning_tokens.

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 60 lines · 49 tokens per session scan A 132d86c44e10

Subscribe to this mod's changes

openrouter-usage is a skill published in the GitHub repository tdimino/claude-code-minoan (41 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 532 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

etsy-pricing-strategy

Etsy pricing — cost calculation, competitor pricing, perceived value, shipping cost integration, sales and coupons.

nexscope-ai/eCommerce-Skills · 26 tokens

floe-guard

Know what every AI call really costs — floe-guard meters STT + TTS + LLM + telephony per call (Pipecat, LiveKit — Python & TypeScript), keeps a live ledger of real spend, and hard-stops the next turn before it crosses a USD ceiling. Free Coverage Score + 7-day history on connect. Use when an agent's spend must be seen…

Floe-Labs/floe-guard · 107 tokens

pm-brainstorm

A structured brainstorming session for exploring a specific product problem or opportunity and narrowing the results to ideas worth pursuing.

serejaris/personal-corp-os · 162 tokens

weekly-planning

A planning workflow that turns a completed weekly review and existing backlog into prioritized outcomes for one ISO calendar week.

serejaris/personal-corp-os · 49 tokens

gh-issues

Use when creating, searching, updating, or managing GitHub issues via CLI. Triggers: "issue", "create issue", "gh issue", "task tracking", "context", "handoff", "resume task", "session context", "save progress", "active tasks", "in-progress", "my tasks", "open issues". Covers: gh commands, bulk operations, JSON/jq…

serejaris/personal-corp-os · 104 tokens

tg-bot-ops

A guide for operating and troubleshooting Telegram bots and systems that connect Telegram to an AI agent. It covers how messages arrive, get processed, and produce replies.

serejaris/personal-corp-os · 146 tokens