openrouter-generations

Retrieve metadata and stored content for OpenRouter API generation requests.

209|33|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/OpenRouterTeam/skills --skill openrouter-generations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openrouter-generations
Source: https://github.com/OpenRouterTeam/skills/tree/main/skills/openrouter-generations
Command: npx skills add https://github.com/OpenRouterTeam/skills --skill openrouter-generations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tsx, and includes scripts (resource) components.

What problem does it solve?

This Skill removes the need to manually sift through OpenRouter API logs to find details about individual generation requests, such as cost, latency, token usage, provider routing, and stored prompt/completion content, which is critical for debugging issues, tracking API spend, and auditing request behavior.

Core Features & Use Cases

  • Generation Metadata Retrieval: Pull full request metadata including token counts (prompt, completion, cached, reasoning), cost breakdowns (total cost, upstream provider cost, cache discounts), latency metrics, model and provider details, and full provider fallback chains.
  • Stored Content Access: Retrieve the original prompt and model completion text for any generation (when Zero Data Retention is not enabled) to verify input/output accuracy and debug unexpected results.
  • Debugging Support: Identify root causes of failed or unexpected generations by checking finish reasons, cancellation status, and per-provider response data from fallback attempts.
  • Use Case Example: If a model returned an irrelevant response, use this skill to pull the exact prompt sent, the completion received, and any fallback provider attempts to diagnose the root cause.

Quick Start

Use the openrouter-generations skill to retrieve the metadata and stored content for the OpenRouter generation with ID gen-1234567890.

Frequently Asked Questions about openrouter-generations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug failed OpenRouter API generation requests?

Debug failed OpenRouter API generation requests by retrieving detailed metadata for the specific generation ID. Inspect finish reasons, cancellation status, and per-provider response data from fallback attempts to identify the root cause of unexpected model outputs.

Can I retrieve stored prompt and completion text for an OpenRouter generation?

Yes, retrieve stored prompt and completion text for OpenRouter generations when Zero Data Retention is not enabled. Accessing the original input and model output allows you to verify input/output accuracy and diagnose unexpected results.

How do I track OpenRouter API costs and token usage per request?

Track OpenRouter API costs and token usage by pulling full request metadata for individual generations. Retrieve cost breakdowns including total cost, upstream provider cost, cache discounts, and token counts for prompt, completion, cached, and reasoning tokens.

What is the best way to audit OpenRouter provider routing and fallback chains?

Audit OpenRouter provider routing by retrieving generation metadata that includes full provider fallback chains. Verify which upstream providers handled the request, check latency metrics, and review per-provider response data to understand routing behavior.

Does retrieving OpenRouter generation metadata work if Zero Data Retention is enabled?

Retrieving OpenRouter generation metadata works with Zero Data Retention enabled, but stored prompt and completion text cannot be accessed. Token counts, costs, latency metrics, and provider routing details remain available for debugging and auditing.

Why did my OpenRouter model return an irrelevant response to my prompt?

Diagnose an irrelevant OpenRouter model response by retrieving the exact prompt sent, the completion received, and any fallback provider attempts. Inspecting this stored content and metadata helps identify whether the issue stems from input parsing or provider routing.