openrouter-analytics-query — Claude Code skill
openrouter-analytics-query — a skill for building and running queries against the OpenRouter analytics API. Use it to pull metrics on model usage, group results by dimensions, and filter by time, model, or other parameters.
no license 355 installs ★ 327 updated 2026-10-24
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a claude-codeWhat openrouter-analytics-query does
This skill supplies a complete reference for constructing requests to the POST /api/v1/analytics/query endpoint. It covers metrics (request count, token usage), dimensions (model, API key, country, finish reason), time ranges with granularity options (minute through month), filtering, and ordering. Results can be grouped by up to two dimensions at once, with support for group_limit to cap rows per group.
You need the OPENROUTER_API_KEY environment variable set to a management key—regular API keys won't work. Management keys are separate credentials issued in the Management Keys section on openrouter.ai. The skill documents query parameters including classifier-based filters and dimensions that use IDs instead of display names (for example, api_key_id stores a numeric ID or SHA-256 hash, not the key name).
Reach for this when debugging an analytics query, checking request shape and response structure, or figuring out how to construct filters and dimension groups.
What it helps with
- construct an OpenRouter analytics query with filters and dimension grouping
- select the right metrics and ordering for a usage report
- understand filter syntax and datetime requirements for time ranges
- apply dynamic classifier dimensions to query results
- diagnose and fix a 400 error from the
/api/v1/analytics/queryendpoint
Example prompts for the agent
- Show me how to build a query for request count grouped by model over the past week
- Help me set up a filter for requests using
anthropic/claude-sonnet-4with responses from the US only - Explain why my query is rejected with a time-range error and how to fix it
How to install openrouter-analytics-query
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a claude-code2Manually: put the files in place
~/.claude/skills/openrouter-analytics-query/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/openrouter-analytics-query/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a codex2Manually: put the files in place
.agents/skills/openrouter-analytics-query/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a cursor2Manually: put the files in place
.cursor/skills/openrouter-analytics-query/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install OpenRouterTeam/skills skills/openrouter-analytics-query2Manually: put the files in place
.github/skills/openrouter-analytics-query/SKILL.md1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a gemini-cli2Platform CLI
gemini skills install https://github.com/OpenRouterTeam/skills --path skills/openrouter-analytics-queryManually: put the files in place
.devin/skills/openrouter-analytics-query/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -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-query
How do I install openrouter-analytics-query in Claude Code?
Run npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a claude-code, then open the skill docs at ~/.claude/skills/openrouter-analytics-query/SKILL.md.
What does openrouter-analytics-query do?
It provides a complete reference for the OpenRouter analytics API: request parameters, filter formats, available dimensions and metrics, sorting rules, and pagination. Helps you construct correct requests to /api/v1/analytics/query and troubleshoot request errors.
What kind of API key does this skill require?
You need a management key, not a regular API key. Management keys are issued separately in the Management Keys section at openrouter.ai and must be set in the OPENROUTER_API_KEY environment variable.