openrouter-usage

Browser & Automation
v1.1.3
Benign

Fetch real-time OpenRouter usage totals and historical per-model spend.

782 downloads782 installsby @rosseyre

Setup & Installation

Install command

clawhub install rosseyre/openrouter-usage

If the CLI is not installed:

Install command

npx clawhub@latest install rosseyre/openrouter-usage

Or install with OpenClaw CLI:

Install command

openclaw skills install rosseyre/openrouter-usage

or paste the repo link into your assistant's chat

Install command

https://github.com/openclaw/skills/tree/main/skills/rosseyre/openrouter-usage

What This Skill Does

Fetches real-time and historical cost data from the OpenRouter API. Shows today, week, and month spend totals alongside a per-model breakdown of recent activity.

Gives CLI-accessible spend breakdowns without logging into the OpenRouter web dashboard.

When to Use It

  • Checking how much you've spent on AI models today
  • Reviewing which models consumed the most budget last week
  • Monitoring monthly spend against your OpenRouter balance
  • Auditing per-model costs before a billing cycle closes
  • Comparing model spend across a recent project
View original SKILL.md file
# OpenRouter Usage Monitor

## What this skill does
Retrieves OpenRouter usage and cost data via:
- **Live totals (Today / Week / Month)** from `/auth/key`
- **Historical per-model breakdown** from `/activity` (completed UTC days only)

---
## How to run (recommended)
Set environment variables (recommended) or create a `credentials.env` file:

```bash
export OPENROUTER_API_KEY=your_key_here
export OPENROUTER_MGMT_KEY=your_mgmt_key_here  # optional, enables model breakdown
```

Then execute: `python3 scripts/stats.py`

Alternatively, create `credentials.env` in the skill directory:
```
OPENROUTER_API_KEY=your_key_here
OPENROUTER_MGMT_KEY=your_mgmt_key_here
```

---
## Fallback method (no Python)
If Python is unavailable, query endpoints directly:

**Live totals**
curl -sS -H "Authorization: Bearer $OPENROUTER_API_KEY"
https://openrouter.ai/api/v1/auth/key

**Per-model activity (7d)**
curl -sS -H "Authorization: Bearer $OPENROUTER_MGMT_KEY"
https://openrouter.ai/api/v1/activity
---
## Configuration
**Required:**
- `OPENROUTER_API_KEY` - Required for real-time usage totals and balance

**Optional:**
- `OPENROUTER_MGMT_KEY` - Enables per-model spend breakdown from activity endpoint

Credentials can be provided via:
1. Environment variables (recommended for security)
2. `credentials.env` file in skill directory (fallback)

---
## Output format
💰 OpenRouter Usage
Today: $X.XX* | Week: $X.XX | Month: $X.XX
Balance: $X.XX / $X.XX

Recent Models (7d):
• model-name: $X.XX (N)
...
`*` indicates live totals that may not yet appear in model breakdowns.
---

## Edge cases
- `/activity` only returns completed UTC days.
- Today’s spend may appear in totals but not per-model data until next UTC rollover.
- Invalid keys → 401/403.
- Rate limiting → 429.
- Network failures should be retried or surfaced.

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Checking how much you've spent on AI models today

AGENT
  1. 1Checking how much you've spent on AI models today
  2. 2Reviewing which models consumed the most budget last week
  3. 3Monitoring monthly spend against your OpenRouter balance
  4. 4Auditing per-model costs before a billing cycle closes
  5. 5Comparing model spend across a recent project
OUTPUT
Fetch real-time OpenRouter usage totals and historical per-model spend.

Share this skill

Security Audits

VirusTotalBenign
OpenClawBenign
View full report

These signals reflect official OpenClaw status values. A Suspicious status means the skill should be used with extra caution.

Details

LanguageMarkdown
Last updatedFeb 25, 2026