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.
npx skills add OpenRouterTeam/skills --skill openrouter-analytics -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/openrouter-analytics/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/openrouter-analytics/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics -a codex2Manually: put the files in place
.agents/skills/openrouter-analytics/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics -a cursor2Manually: put the files in place
.cursor/skills/openrouter-analytics/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install OpenRouterTeam/skills openrouter-analytics2Manually: put the files in place
.github/skills/openrouter-analytics/SKILL.md1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics -a gemini-cli2Platform CLI
gemini skills install https://github.com/OpenRouterTeam/skills --path skills/openrouter-analyticsManually: put the files in place
.devin/skills/openrouter-analytics/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.