openrouter-load-balancing
Distribute OpenRouter requests for high availability. Use when building scalable systems that need load distribution. Trigger with phrases like 'openrouter load balance', 'distribute requests', 'openrouter scaling', 'high availability'.
- License 许可
- MIT
- 最近更新
- 2026-05-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- openrouter-load-balancing
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- Distribute OpenRouter requests for high availability. Use when building scalable systems that need load distribution. Trigger with phrases like 'openrouter load balance', 'distribute requests', 'openrouter scaling', 'high availability'.
- allowed-tools
- Read, Write, Edit, Grep
- compatible-with
- claude-code, codex, openclaw
02 资源文件 8
- 参考文档references/concurrent-request-distribution.md2.5 KB
- 参考文档references/credit-aware-load-balancing.md2.8 KB
- 参考文档references/errors.md323 B
- 参考文档references/examples.md3.8 KB
- 参考文档references/health-based-routing.md1.7 KB
- 参考文档references/model-based-load-balancing.md1.3 KB
- 参考文档references/monitoring-load-distribution.md1.1 KB
- 参考文档references/multi-key-load-balancing.md1.7 KB
03 SKILL.md 正文
Openrouter Load Balancing
Overview
This skill covers strategies for distributing API requests across multiple keys, models, or instances for improved throughput and reliability.
Prerequisites
- OpenRouter integration
- Multiple API keys or model options (for distribution)
Instructions
- Use multiple API keys: Create separate API keys for different services or teams; distribute requests across keys to multiply your rate limits
- Implement round-robin distribution: Cycle through API keys or equivalent models on each request to spread load evenly
- Add health-based routing: Track error rates and latency per key/model; route traffic away from unhealthy endpoints automatically
- Monitor per-key usage: Track request counts and costs per API key to ensure balanced utilization and catch anomalies
- Implement circuit breakers: When a key or model exceeds error thresholds, temporarily remove it from the pool and re-check after a cooldown period
Output
- Load balancer distributing requests across multiple API keys or models
- Health dashboard showing per-key error rates and latency
- Automatic failover when individual keys or models become unhealthy
Error Handling
| Error | Cause | Fix |
|---|---|---|
| Uneven load distribution | Round-robin not accounting for request duration | Use weighted distribution based on current in-flight requests |
| All keys rate-limited | Traffic spike exceeded aggregate limits | Add more keys or implement request queuing with backpressure |
| Health check false positive | Transient errors marking a key as unhealthy | Use sliding window error rates (e.g., 5 errors in 60s) instead of single-error triggers |
See ${CLAUDE_SKILL_DIR}/references/errors.md for full error reference.
Examples
See ${CLAUDE_SKILL_DIR}/references/examples.md for runnable code samples.
Resources
04 同仓库更多 Skills
zustand-store-ts
Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.
zustand-store-creator
Zustand Store Creator - Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category.
zero-trust-config-helper
Zero Trust Config Helper - Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category.
zapier-integration-helper
Zapier Integration Helper - Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category.
zai-cli
Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP. Use when user needs image/video analysis, OCR, UI-to-code conversion, error diagnosis, real-time web search, web page to markdown extraction, or GitHub code exploration. Trigger with phrases like "analyze this image", "search the web for", "read this page", "explore this repo", or "use zai". Requires Z_AI_API_KEY.
yt-research
Research competitor YouTube channels, niches, and trending topics for your content strategy. Use this skill whenever the user says "research channels", "analyze competitors", "find trending topics", "niche analysis", "competitive research", "what are other creators doing", "scrape YouTube channels", or wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.