Skip to content
Back to skills

Openrouter Analytics

ASecurity

Review OpenRouter usage, analytics, and troubleshooting data via API. Use when the user asks for spend/usage monitoring, activity trends, per-key management reporting, or deep investigation of specific request IDs (latency, provider fallback, finish reason, token/cost breakdown).

  • 21 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 7, 2026
businesspythonbashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill openrouter-analytics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openrouter Analytics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openrouter Analytics
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-openrouter-analytics/badge)](https://www.skillsdirectory.com/skills/modbender-openrouter-analytics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: openrouter-analytics
description: Review OpenRouter usage, analytics, and troubleshooting data via API. Use when the user asks for spend/usage monitoring, activity trends, per-key management reporting, or deep investigation of specific request IDs (latency, provider fallback, finish reason, token/cost breakdown).
---

# OpenRouter Analytics

Use this skill to pull **management-level usage data** and **request-level troubleshooting details** from OpenRouter.

## Quick Start

Run from this skill folder:

```bash
cd ~/clawd/skills/openrouter-analytics
```

Management key operations (set `OPENROUTER_MANAGEMENT_KEY`):

```bash
python3 scripts/openrouter_analytics.py activity --limit 20
python3 scripts/openrouter_analytics.py activity --date 2026-02-18
python3 scripts/openrouter_analytics.py activity --from 2026-02-01 --to 2026-02-18 --summary --csv /tmp/activity.csv
python3 scripts/openrouter_analytics.py credits
python3 scripts/openrouter_analytics.py keys --limit 50 --summary
python3 scripts/openrouter_analytics.py report --from 2026-02-01 --to 2026-02-18 --format markdown
```

Request-level troubleshooting (set `OPENROUTER_API_KEY`):

```bash
python3 scripts/openrouter_analytics.py generation --id <generation_id>
```

Use `--raw` on any command to print full JSON.

## Workflow

1. **Check macro activity**
   - Run `activity` for daily spend/traffic patterns.
2. **Check account-level usage**
   - Run `credits` to review consumed vs remaining credits.
3. **Find key-level consumers**
   - Run `keys` to identify which keys are driving usage.
4. **Investigate incidents**
   - Run `generation --id ...` for detailed logs on one request (latency, fallback providers, finish reason, token and cost details).

## Notes

- `activity`, `credits`, `keys`, and `report` require a **Management API key**.
- `generation` uses a standard **OpenRouter API key** and requires the request `id`.
- The script auto-loads `~/.openclaw/.env` and current-directory `.env` before execution.
- Use `--retries` and `--timeout` to tune robustness under transient API/network issues.
- Keep generation IDs in your application logs to support reliable post-incident analysis.

## Resources

- Endpoint reference and field guide: `references/endpoints.md`
- CLI helper script: `scripts/openrouter_analytics.py`

Files in this skill

  • SKILL.md2.3 KB
  • references/endpoints.md1.4 KB
  • scripts/openrouter_analytics.py19 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.