# openrouter-analytics

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

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 300 installs · ★ 306
- 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/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/openrouter-analytics

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

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

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

### GitHub Copilot

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

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add OpenRouterTeam/skills --skill openrouter-analytics -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/SKILL.md

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

## Similar
- [skill-creator](https://affpapa.org/en/nevibecode/skills/skill-creator.md) — skill · 414180 installs
- [writing-for-agents](https://affpapa.org/en/nevibecode/skills/writing-for-agents.md) — skill · 466719 installs
- [media-use](https://affpapa.org/en/nevibecode/skills/media-use.md) — skill · 1100000 installs
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [subagent-driven-development](https://affpapa.org/en/nevibecode/skills/subagent-driven-development.md) — skill · 237746 installs
- [orchestration](https://affpapa.org/en/nevibecode/skills/orchestration.md) — skill · 349800 installs

From the same set: [openrouterteam/skills](https://affpapa.org/en/nevibecode/by/openrouterteam/skills.md) — 4 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
