# openrouter-analytics-query

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 355 installs · ★ 327 repo stars
- Author: OpenRouterTeam
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/OpenRouterTeam/skills/tree/HEAD/skills/openrouter-analytics-query/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/openrouter-analytics-query

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/openrouter-analytics-query/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/openrouter-analytics-query/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/openrouter-analytics-query/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/openrouter-analytics-query/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install OpenRouterTeam/skills skills/openrouter-analytics-query
```

2. **Manually: put the files in place**
- File: `.github/skills/openrouter-analytics-query/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/OpenRouterTeam/skills --path skills/openrouter-analytics-query
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/openrouter-analytics-query/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add OpenRouterTeam/skills --skill openrouter-analytics-query -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/OpenRouterTeam/skills/tree/HEAD/skills/openrouter-analytics-query/SKILL.md

## When to use it
- 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
- 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

## Similar
- [openrouter-cost-controls](https://affpapa.org/en/nevibecode/skills/openrouter-cost-controls.md) — skill · 1 install
- [cargo-analytics](https://affpapa.org/en/nevibecode/skills/cargo-analytics.md) — skill · 11600 installs
- [analytics](https://affpapa.org/en/nevibecode/skills/apolloio-analytics.md) — skill · 636 installs
- [lean-analytics](https://affpapa.org/en/nevibecode/skills/lean-analytics.md) — skill · 3500 installs
- [analytics-and-reporting](https://affpapa.org/en/nevibecode/skills/analytics-and-reporting.md) — skill · 1500 installs
- [tiktok-shop-analytics](https://affpapa.org/en/nevibecode/skills/tiktok-shop-analytics.md) — skill · 1100 installs

From the same set: [openrouterteam/skills](https://affpapa.org/en/nevibecode/by/openrouterteam/skills.md) — 16 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
