OpenRouter Usage

v1.1.3

Fetch real-time OpenRouter usage totals and historical per-model spend. Use when the user asks for usage, spend, cost breakdown, or OpenRouter stats. Not for system health or non-LLM metrics.

1· 1.2k·3 current·3 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The skill claims to fetch OpenRouter usage and per-model spend and the included script calls only openrouter.ai endpoints (/auth/key, /credits, /activity). However, registry metadata lists no required environment variables or primary credential while SKILL.md and the script do require OPENROUTER_API_KEY (and optionally OPENROUTER_MGMT_KEY). This mismatch is a metadata inconsistency (not functional misbehavior).
Instruction Scope
Runtime instructions and the Python script are narrowly scoped: they load credentials from environment or a credentials.env file in the skill directory, call OpenRouter endpoints, aggregate and print results. The instructions do not request unrelated files, system state, or external endpoints beyond openrouter.ai.
Install Mechanism
No install spec (instruction-only + a small script). Nothing is downloaded or written by an installer; risk from installation is low. The script may read credentials.env in the skill directory if present.
Credentials
The only secrets requested are OPENROUTER_API_KEY (required) and OPENROUTER_MGMT_KEY (optional) which are proportional to the stated functionality. Note: the registry metadata did not declare these required env vars or primary credential, while SKILL.md and the script do — this inconsistency should be resolved. The skill suggests storing keys in a credentials.env file in the skill directory (convenient but less secure than environment variables).
Persistence & Privilege
The skill does not request persistent system privileges, does not set always:true, and does not modify other skills or system-wide configs. It only reads a credentials.env file in its own directory (if present).
Assessment
This skill appears to do what it says: it uses OPENROUTER_API_KEY (and optionally OPENROUTER_MGMT_KEY) to call only openrouter.ai endpoints and print usage and model breakdowns. Before installing: (1) confirm you trust the skill owner/source (homepage is absent and owner ID looks unfamiliar); (2) prefer providing keys via environment variables rather than creating a credentials.env file in a shared filesystem; (3) be aware the registry metadata does not list the required env vars or primary credential — ask the publisher to correct that mismatch; (4) you can review scripts/stats.py yourself (it's small and readable) or run it in an isolated environment if you want to limit risk.

Like a lobster shell, security has layers — review code before you run it.

latestvk97bkasxcajk2kzqd1r6ztegx1810kx2
1.2kdownloads
1stars
5versions
Updated 1mo ago
v1.1.3
MIT-0

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:

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.

Comments

Loading comments...