openrouter-usage
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.
- License 许可
- Apache-2.0
- 最近更新
- 2026-05-17
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- openrouter-usage
- license
- Apache-2.0
- metadata
- { "author": "Arkology Studio", "version": "1.1" }
- description
- 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.
- allowed-tools
- Bash(python3:*) Bash(curl:*) Bash(jq:*) Read
- compatibility
- Requires internet access. Primary path uses python3. Optional fallback uses curl (+ jq if available).
- optional-env-vars
- [ "OPENROUTER_MGMT_KEY" ]
- required-env-vars
- [ "OPENROUTER_API_KEY" ]
- primary-credential
- OPENROUTER_API_KEY
- credential-description
- OpenRouter API key
02 资源文件 2
- 参考文档_meta.json286 B
- 脚本scripts/stats.py6.0 KB
03 SKILL.md 正文
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:
- Environment variables (recommended for security)
credentials.envfile 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
/activityonly 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.
04 同仓库更多 Skills
zvukogram
Text-to-Speech via Zvukogram API with SSML support. Use when you need to generate speech from text, create podcasts, voice notifications, or work with audio. Supports speed control, stress marks, English word transcription, and audio fragment merging.
zohomail
Zoho Mail API integration with managed OAuth. Send, receive, and manage emails, folders, and labels. Use this skill when users want to send emails, read messages, manage folders, or work with email labels in Zoho Mail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.
zoho-recruit
Zoho Recruit API integration with managed OAuth. Manage candidates, job openings, interviews, and recruitment workflows. Use this skill when users want to read, create, update, or search recruitment data like candidates, job openings, interviews, and applications in Zoho Recruit. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.
zoho-people
Zoho People API integration with managed OAuth. Manage employees, departments, designations, attendance, and leave. Use this skill when users want to read, create, update, or query HR data like employees, departments, designations, and forms in Zoho People. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.
zoho-mail
Zoho Mail API integration with managed OAuth. Send, receive, and manage emails, folders, and labels. Use this skill when users want to send emails, read messages, manage folders, or work with email labels in Zoho Mail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.
zoho-inventory
Zoho Inventory API integration with managed OAuth. Manage items, sales orders, invoices, purchase orders, bills, contacts, and shipments. Use this skill when users want to read, create, update, or delete inventory items, sales orders, invoices, purchase orders, bills, or other inventory records in Zoho Inventory. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.