Skip to main content
skill CX Codex

openrouter-analytics — Claude Code skill: setup and features

Inspects OpenRouter costs, token counts, and latency through natural-language prompts. Useful when auditing API bills or finding expensive models.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add OpenRouterTeam/skills --skill openrouter-analytics -a claude-code
Open on GitHub

What openrouter-analytics does

This skill connects your coding assistant to OpenRouter's Analytics API using bundled TypeScript scripts. It includes discover-schema.ts to inspect available metrics, query-analytics.ts to execute custom filters, and suggest-queries.ts for prepared optimization templates. The agent converts conversational questions into dimensions and metrics, retrieving time-bucketed figures for models, workspaces, or individual API keys.

Standard OpenRouter API keys will fail immediately with an HTTP 403 error. You must supply a dedicated management key from your account settings, provided via the --api-key parameter or the OPENROUTER_API_KEY environment variable. Before running queries, execute npm install inside the skill's script folder.

The tool reports expenditure figures in USD, token volume, cache hit percentages, and provider latency statistics. When querying large timeframes, it checks the truncation flag to ensure rankings and summaries reflect complete data rows rather than capped limits.

What it helps with

  • audit OpenRouter monthly spending through chat
  • identify top LLM models by total token usage
  • track provider response latency and cache hit rates
  • inspect API cost breakdowns across separate keys

Example prompts for the agent

  • Show my OpenRouter spend for the past week grouped by day
  • Which ten models generated the highest costs this month?
  • Compare provider latency and cache hit percentages across my requests

How to install openrouter-analytics

1Skills CLI (Vercel)

npx skills add OpenRouterTeam/skills --skill openrouter-analytics -a claude-code

2Manually: put the files in place

~/.claude/skills/openrouter-analytics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/openrouter-analytics/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about openrouter-analytics

How do I install openrouter-analytics in Claude Code?

Run npx skills add OpenRouterTeam/skills --skill openrouter-analytics -a claude-code. After adding the skill, navigate to its scripts folder and run npm install.

What does openrouter-analytics do?

It queries OpenRouter usage metrics directly from your development agent. You can inspect dollar spending, token volumes, provider latency, and filter data by model or API key.

Why does the skill fail with an HTTP 403 error?

The Analytics API requires an OpenRouter provisioning management key rather than a regular inference key. You can generate one in your OpenRouter management key settings and export it as OPENROUTER_API_KEY.

Similar skills

Everything for AI and ML →

From the same set4

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor