openrouter-generations — Claude Code skill: how to install
Inspect OpenRouter requests by generation ID to review token costs, latency, fallback routing, and saved prompts.
npx skills add OpenRouterTeam/skills --skill openrouter-generations -a claude-codeWhat openrouter-generations 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.
What it helps with
- 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 for the agent
- 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
How to install openrouter-generations
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-generations -a claude-code2Manually: put the files in place
~/.claude/skills/openrouter-generations/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/openrouter-generations/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-generations -a codex2Manually: put the files in place
.agents/skills/openrouter-generations/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-generations -a cursor2Manually: put the files in place
.cursor/skills/openrouter-generations/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install OpenRouterTeam/skills openrouter-generations2Manually: put the files in place
.github/skills/openrouter-generations/SKILL.md1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-generations -a gemini-cli2Platform CLI
gemini skills install https://github.com/OpenRouterTeam/skills --path skills/openrouter-generationsManually: put the files in place
.devin/skills/openrouter-generations/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-generations -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-generations
How to install openrouter-generations in Claude Code?
Run npx skills add OpenRouterTeam/skills --skill openrouter-generations -a claude-code in your terminal. Next, navigate to the scripts folder and run npm install.
What does openrouter-generations do?
It queries the OpenRouter API for execution metadata and saved texts tied to a generation ID. You get visibility into token usage, latency metrics, and provider fallbacks.
Why is the generation content response empty?
OpenRouter does not retain message content when Zero Data Retention is active. In that scenario, the content endpoint returns null for prompts and completions.