OpenClaw · Skill

Openrouter Analytics

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

Coding Agents & IDEs
v1.0.0
VirusTotal: Suspicious

Install

Start with the primary install command. Alternate entrypoints are included below for ClawHub and OpenClaw CLI users.

Primary command

clawhub install plgonzalezrx8/openrouter-analytics

ClawHub installer

npx clawhub@latest install plgonzalezrx8/openrouter-analytics

OpenClaw CLI

openclaw skills install plgonzalezrx8/openrouter-analytics

Direct OpenClaw install

openclaw install plgonzalezrx8/openrouter-analytics

What this skill does

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

Why it matters

Combines account-level management reporting and per-request debug detail in one CLI tool, replacing manual API calls or navigating the OpenRouter dashboard.

Typical use cases

  • Reviewing daily OpenRouter spend over a custom date range
  • Identifying which API keys are consuming the most credits
  • Debugging a slow or failed request using its generation ID
  • Exporting monthly usage data to CSV for billing review
  • Checking remaining credits before hitting a spending limit

Source instructions

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:

cd ~/clawd/skills/openrouter-analytics

Management key operations (set OPENROUTER_MANAGEMENT_KEY):

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):

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

Related OpenClaw skills

Browse all →
Featured slot

Your product here

Reserve this slot to reach operators and coding-agent buyers.

Shown where builders are actively comparing tools and deployment options.

Advertise