Skip to main content
skill CX Codex

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

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

What 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/query endpoint

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-4 with 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-code

2Manually: put the files in place

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

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

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.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set16

The whole set →
openrouter-generations openrouter-generations is a Claude Code skill for inspecting OpenRouter requests by generation ID. It shows token costs, latency, provider routing, and saved prompts. CX Codex +1 383installs openrouter-agent-migration openrouter-agent-migration walks you through switching agent imports from @openrouter/sdk to the @openrouter/agent package. CX Codex +1 383installs openrouter-oauth openrouter-oauth adds Sign In with OpenRouter to browser apps via OAuth PKCE without a backend, SDK, or client credentials. CX Codex +1 362installs create-agent-tui create-agent-tui is a Claude Code skill that generates a TypeScript agent with terminal UI, tools, and sessions for building an agent from scratch or adding a terminal interface. CX Codex +1 358installs openrouter-analytics-schema Fetches live OpenRouter analytics schema details, including metrics, dimensions, and filter rules. Useful when constructing usage or cost queries. CX Codex +1 355installs openrouter-tts openrouter-tts synthesizes speech audio from text using OpenRouter's speech API. Generates voiceovers, audiobook snippets, and audio files right from your prompt. CX Codex +1 327installs create-headless-agent create-headless-agent scaffolds headless TypeScript agents using Bun and @openrouter/agent. Builds CLI utilities, API servers, queue workers, and data pipelines without a terminal UI. CX Codex +1 320installs openrouter-stt openrouter-stt converts audio recordings into text using OpenRouter's speech-to-text API across models like Whisper and Chirp. CX Codex +1 319installs

Project sponsors

Companies that keep this analytics open