Openrouter Debug Bundle
Overview
This skill provides a systematic approach to collecting diagnostic information when OpenRouter requests fail or return unexpected results.
Prerequisites
- OpenRouter integration with logging enabled
- Access to request/response logs
Instructions
- Capture the full request: Log the complete request including URL, headers (redact the API key), body, model ID, and timestamp
- Capture the full response: Log status code, response headers (especially
X-Request-ID, rate limit headers), response body, and response time - Check the generation ID: Extract the
idfield from the response (e.g.,gen-abc123) — this is needed when contacting OpenRouter support - Compare against a known-good request: Diff the failing request against a previously successful one to isolate what changed
- Bundle and report: Package the sanitized request, response, error message, and environment info (SDK version, Node/Python version) into a debug report
Output
- A structured debug bundle with request, response, and environment metadata
- Isolated diff showing what changed between working and failing requests
- Actionable next steps based on the error pattern
Error Handling
| Error | Cause | Fix |
|---|---|---|
| No request ID in response | Request failed before reaching OpenRouter | Check network connectivity; verify base URL is correct |
| Intermittent failures | Model provider instability | Log timestamps and correlate with OpenRouter status page; try a different provider |
| Response differs from docs | Model-specific behavior variation | Check the specific model's documentation; some models handle parameters differently |
See ${CLAUDE_SKILL_DIR}/references/errors.md for full error reference.
Examples
See ${CLAUDE_SKILL_DIR}/references/examples.md for runnable code samples.