Implement common SDK usage patterns for OpenRouter. Use when building reusable client libraries or wrappers. Trigger with phrases like 'openrouter sdk', 'openrouter client library', 'openrouter wrapper', 'openrouter patterns'.
From openrouter-packnpx claudepluginhub nickloveinvesting/nick-love-plugins --plugin openrouter-packThis skill is limited to using the following tools:
references/errors.mdreferences/examples.mdreferences/implementation.mdreferences/python-with-openai-sdk.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
This skill covers best practices for building OpenRouter client wrappers, including retry logic, error handling, response typing, and reusable patterns.
max_retries| Error | Cause | Fix |
|---|---|---|
| Type mismatch on response | Model returned unexpected format | Add runtime validation alongside static types; handle gracefully |
| Retry exhaustion | Max retries exceeded on persistent errors | Log the final error with full context; surface to caller with actionable message |
| Middleware error | Logging or metrics code threw an exception | Wrap middleware in try/catch so it never breaks the main request flow |
See ${CLAUDE_SKILL_DIR}/references/errors.md for full error reference.
See ${CLAUDE_SKILL_DIR}/references/examples.md for runnable code samples.