Openrouter usage

From tdimino/claude-code-minoan · View interactive version

Openrouter usage is an AI agent skill from the GitHub repository tdimino/claude-code-minoan. Query OpenRouter API costs, credits, and usage breakdown by model, provider, and date for the last 30 days. Triggers on API spending, check costs, openrouter usage, how much have I spent.

How to use this skill

Skill file

OpenRouter Usage

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

When to Use

Prerequisites

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:

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.