openrouter-debug-bundle

Featured

Create debug bundles for troubleshooting OpenRouter API issues. Use when diagnosing failures, unexpected responses, or latency problems. Triggers: 'openrouter debug', 'openrouter troubleshoot', 'debug openrouter request', 'openrouter issue'.

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# OpenRouter Debug Bundle ## Current State !`node --version 2>/dev/null || echo 'N/A'` !`python3 --version 2>/dev/null || echo 'N/A'` ## Overview When an OpenRouter request fails or returns unexpected results, you need a structured debug bundle: the exact request, response, headers, generation metadata, and environment info. The generation ID (`gen-*` prefix in `response.id`) is the key correlator -- it lets you look up exact cost, provider used, and latency via `GET /api/v1/generation?id=`. ## Quick Debug: curl ```bash # Send a request and capture full response with headers curl -v https://openrouter.ai/api/v1/chat/completions \ -H "Authorization: Bearer $OPENROUTER_API_KEY" \ -H "Content-Type: application/json" \ -H "HTTP-Referer: https://my-app.com" \ -H "X-Title: debug-test" \ -d '{ "model": "openai/gpt-4o-mini", "messages": [{"role": "user", "content": "Say hello"}], "max_tokens": 50 }' 2>&1 | tee /tmp/openrouter-debug.txt # Extract generation ID from response GEN_ID=$(jq -r '.id' /tmp/openrouter-debug.txt 2>/dev/null) echo "Generation ID: $GEN_ID" # Look up generation metadata (exact cost, provider, latency) curl -s "https://openrouter.ai/api/v1/generation?id=$GEN_ID" \ -H "Authorization: Bearer $OPENROUTER_API_KEY" | jq '.data | { model: .model, total_cost: .total_cost, tokens_prompt: .tokens_prompt, tokens_completion: .tokens_completion, generation_time: .generation_time, provider: .provider_name }' ``` ## Py...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category