Install
openclaw skills install openrouter-usageFetch 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.
openclaw skills install openrouter-usageRetrieves OpenRouter usage and cost data via:
/auth/key/activity (completed UTC days only)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
If Python is unavailable, query endpoints directly:
Live totals curl -sS -H "Authorization: Bearer $OPENROUTER_API_KEY" https://openrouter.ai/api/v1/auth/key
Required:
OPENROUTER_API_KEY - Required for real-time usage totals and balanceOptional:
OPENROUTER_MGMT_KEY - Enables per-model spend breakdown from activity endpointCredentials can be provided via:
credentials.env file in skill directory (fallback)💰 OpenRouter Usage Today: $X.XX* | Week: $X.XX | Month: $X.XX Balance: $X.XX / $X.XX
* indicates live totals that may not yet appear in model breakdowns./activity only returns completed UTC days.