OpenRouter Best Practices & Pitfalls
Identifies and fixes common OpenRouter integration mistakes to prevent runaway costs, routing errors, and security vulnerabilities.
The OpenRouter Known Pitfalls skill provides a curated knowledge base of real-world integration gotchas and their exact technical solutions. It helps developers avoid frequent errors such as missing provider prefixes, unmanaged model fallbacks, and unexpected cost overruns by providing actionable 'wrong vs. right' code patterns. This skill is essential for teams migrating from single-provider setups to multi-model architectures, ensuring robust error handling, secure API key management, and optimized performance through connection pooling and deterministic caching strategies.
Key Features
01Enforces max_tokens constraints to prevent runaway API costs
02Manages and audits unexpected provider fallback behaviors
03Optimizes request performance through client reuse and timeout configuration
04Validates model ID formatting including required provider prefixes
05Detects security risks like hardcoded API keys in source code
062,026 GitHub stars
Use Cases
01Performing a pre-production code review for new OpenRouter integrations
02Debugging unexpected 400 'model not found' or 429 rate-limit errors
03Migrating an existing OpenAI-specific codebase to the OpenRouter unified API