# openrouter-generations

Inspect OpenRouter requests by generation ID to review token costs, latency, fallback routing, and saved prompts.

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

## What it does

The skill pulls telemetry for any request via its `gen-` ID. Running `get-generation.ts` queries the OpenRouter API to return token counts, routing decisions, latency metrics, and finish reasons. Fallback attempts across providers appear directly in the output array.

To inspect input messages and model responses, run `get-generation-content.ts`. Keep in mind that requests processed under Zero Data Retention return empty text. If privacy retention was active during the call, stored prompts cannot be viewed.

Run `npm install` inside the scripts directory before the first run. Authentication requires an `OPENROUTER_API_KEY` environment variable or the `--api-key` flag. Missing credentials trigger a 401 error.

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

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

### GitHub Copilot

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

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

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

## When to use it
- diagnose failed model calls using generation identifiers
- audit actual token spend against upstream provider pricing
- inspect routing attempts and fallback response codes
- fetch stored prompts and completions from past API runs

## Example prompts
- Fetch metadata and latency for generation gen-1234567890 in json
- Show the stored prompt and model completion for gen-aBcDeFgHiJkLmNoPqRsT
- Check why gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG stopped and report token cost

## Similar
- [pp-openrouter](https://affpapa.org/en/nevibecode/skills/pp-openrouter.md) — skill · 322 installs
- [omni-models](https://affpapa.org/en/nevibecode/skills/omni-models.md) — skill · 1000 installs
- [openrouter](https://affpapa.org/en/nevibecode/skills/openrouter.md) — skill · 403 installs
- [nano-banana-pro-openrouter](https://affpapa.org/en/nevibecode/skills/nano-banana-pro-openrouter.md) — skill · 9910 installs
- [freeride](https://affpapa.org/en/nevibecode/skills/freeride.md) — skill · 781 installs
- [google-image-search](https://affpapa.org/en/nevibecode/skills/google-image-search.md) — skill · 643 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
