# decolua/9router

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/decolua-9router).**

17,690 stars · 2,738 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/decolua/9router
- Homepage: https://9router.com
- awesome-repositories: https://awesome-repositories.com/repository/decolua-9router.md

## Topics

`ai-agents` `ai-gateway` `anthropic` `chatgpt` `claude` `claude-code` `cline` `codex` `copilot` `cursor` `deepseek` `free-ai` `gemini` `gemini-cli` `llm` `llm-gateway` `openai` `openai-proxy` `qwen` `token-saver`

## Description

9router is an AI model gateway designed to route requests from AI coding tools to multiple model providers through a single unified API. It provides administration for self-hosted AI proxy deployments, allowing users to manage API keys and model access on local servers or edge networks.

The system differentiates itself through multi-provider API normalization, which translates incompatible request and response formats to ensure compatibility across different AI models. It features AI provider failover management to automatically switch between providers or accounts when quotas are exhausted or errors occur, and implements multi-account rotation to bypass individual provider limits.

The gateway covers a broad set of capabilities including token optimization via payload compression, spending analysis and quota tracking, and encrypted configuration synchronization across devices. Traffic management is handled through capability-based routing and outbound proxy support, while security is maintained via API access keys and automated token refreshment.

The application supports containerized deployment and can be hosted on local machines, virtual servers, or global edge networks.

## Tags

### Artificial Intelligence & ML

- [AI Gateways](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-gateways.md) — Acts as a unified AI gateway that routes requests from coding tools to multiple model providers via a single API.
- [Model Proxy Gateways](https://awesome-repositories.com/f/artificial-intelligence-ml/model-proxy-gateways.md) — Acts as a unified interface gateway that proxies requests from coding tools to multiple LLM providers. ([source](https://github.com/decolua/9router#readme))
- [Failover Strategies](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/request-routing-gateways/failover-strategies.md) — Distributes requests across model pools using fallback, round-robin, or capacity-based selection strategies. ([source](https://github.com/decolua/9router/blob/master/CHANGELOG.md))
- [Model Format Translators](https://awesome-repositories.com/f/artificial-intelligence-ml/model-format-translators.md) — Translates request and response schemas between different LLM provider APIs to ensure cross-tool compatibility. ([source](https://github.com/decolua/9router/blob/master/i18n/README.zh-CN.md))
- [Fallback Configurations](https://awesome-repositories.com/f/artificial-intelligence-ml/model-gateways/fallback-configurations.md) — Provides ordered backup model lists to ensure continuity when a primary model fails or hits its quota. ([source](https://github.com/decolua/9router/blob/master/i18n/README.ja-JP.md))
- [Model Provider Management](https://awesome-repositories.com/f/artificial-intelligence-ml/model-provider-management.md) — Centralizes the management of multiple AI model provider API keys and regional clusters. ([source](https://github.com/decolua/9router/blob/master/CHANGELOG.md))
- [Failover Mechanisms](https://awesome-repositories.com/f/artificial-intelligence-ml/model-provider-management/failover-mechanisms.md) — Automatically switches between AI model providers or accounts when quotas are exhausted or errors occur.
- [Provider Compatibility](https://awesome-repositories.com/f/artificial-intelligence-ml/provider-compatibility.md) — Normalizes incompatible request and response formats between different AI providers to ensure tool compatibility.
- [Capability-Based Routing](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/integration-deployment/agent-frameworks/configuration-and-specifications/agent-persona-definitions/persona-assignments/capability-based-routing.md) — Directs requests to specific model providers based on the required task, such as image generation or web searching.
- [AI Agent Skills](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-agent-skills.md) — Provides a mechanism for defining and sharing reusable skill sets that AI agents can fetch to perform complex tasks. ([source](https://github.com/decolua/9router/tree/master/skills))
- [Model Request Routing](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-model-clients/model-request-routing.md) — Directs embedding requests to specific AI backends by managing request bodies and header configurations. ([source](https://github.com/decolua/9router/tree/master/tests))
- [Gateway Management](https://awesome-repositories.com/f/artificial-intelligence-ml/gateway-management.md) — Provides a web-based administrative interface for configuring proxy settings, quotas, and provider connections. ([source](https://github.com/decolua/9router/blob/master/package.json))
- [Response Synthesis Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/computer-vision-segmentation-models/object-detection-models/multi-stage-inference-pipelines/response-synthesis-pipelines.md) — Sends prompts to multiple models in parallel and utilizes a judge model to synthesize a final coherent response. ([source](https://github.com/decolua/9router/blob/master/CHANGELOG.md))
- [Capability-Based Routing](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-evaluation-and-validation/model-capability-assessment/model-capability-queries/capability-based-routing.md) — Ensures specialized inputs are sent to the most capable providers by reordering target models per request. ([source](https://github.com/decolua/9router/blob/master/CHANGELOG.md))
- [Model Response Synthesis](https://awesome-repositories.com/f/artificial-intelligence-ml/model-response-synthesis.md) — Sends a single prompt to multiple AI models simultaneously and uses a judge model to merge the results.
- [Provider Account Rotation](https://awesome-repositories.com/f/artificial-intelligence-ml/provider-account-rotation.md) — Distributes outgoing API calls across a pool of multiple accounts to bypass individual provider quota restrictions.
- [Sampling Provider Fallbacks](https://awesome-repositories.com/f/artificial-intelligence-ml/sampling-strategies/sampling-provider-fallbacks.md) — Automatically reroutes traffic to secondary model providers when primary services hit rate limits or return errors.
- [Token Optimizers](https://awesome-repositories.com/f/artificial-intelligence-ml/text-tokenization-utilities/token-optimizers.md) — Optimizes token usage by tracking limits and automatically switching to more cost-effective AI models. ([source](https://github.com/decolua/9router/tree/master/cli))
- [Token Optimization Utilities](https://awesome-repositories.com/f/artificial-intelligence-ml/token-optimization-utilities.md) — Reduces LLM token consumption and operational costs through payload compression and usage tracking.
- [Tool Output Compression](https://awesome-repositories.com/f/artificial-intelligence-ml/tool-calling-integration-frameworks/tool-output-processors/tool-output-compression.md) — Compresses verbose tool outputs like logs and diffs to minimize token consumption in AI requests. ([source](https://github.com/decolua/9router/blob/master/README.zh-CN.md))

### DevOps & Infrastructure

- [Self-Hosted AI Infrastructure](https://awesome-repositories.com/f/devops-infrastructure/self-hosted-ai-infrastructure.md) — Enables deployment of a private AI proxy gateway on local servers or edge networks for managing API keys.

### Security & Cryptography

- [API Access Security](https://awesome-repositories.com/f/security-cryptography/api-access-security.md) — Secures the gateway by validating incoming requests using API keys or secrets. ([source](https://github.com/decolua/9router/blob/master/.env.example))

### Web Development

- [Endpoint Translation Maps](https://awesome-repositories.com/f/web-development/api-management-tools/api-development-management/web-apis/administrative-api-endpoints/endpoint-discovery/endpoint-translation-maps.md) — Implements logic to translate external API endpoint formats into standardized internal routing paths for provider compatibility. ([source](https://github.com/decolua/9router/blob/master/next.config.mjs))

### Business & Productivity Software

- [AI Usage Analytics](https://awesome-repositories.com/f/business-productivity-software/spend-tracking-tools/ai-usage-analytics.md) — Tracks token usage and analyzes spending trends across different models to generate expenditure reports. ([source](https://github.com/decolua/9router/blob/master/i18n/README.zh-CN.md))

### Development Tools & Productivity

- [Token-Aware Log Compression](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/workflow-productivity-enhancers/developer-productivity-utilities/developer-utilities/file-resource-management/file-compression-utilities/token-aware-log-compression.md) — Compresses verbose tool outputs and logs to reduce token consumption before sending requests to models.

### Networking & Communication

- [Account Rotation Strategies](https://awesome-repositories.com/f/networking-communication/account-rotation-strategies.md) — Bypasses individual provider quota limits by rotating requests across a pool of multiple accounts. ([source](https://github.com/decolua/9router#readme))
- [Traffic Routing Proxies](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-infrastructure-configuration/network-infrastructure/traffic-routing-proxies.md) — Forwards outbound traffic through HTTP or SOCKS proxies to bypass network restrictions. ([source](https://github.com/decolua/9router/blob/master/.env.example))
- [Edge Proxies](https://awesome-repositories.com/f/networking-communication/request-proxies/edge-proxies.md) — Implements edge-based proxying to manage traffic distribution and bypass network restrictions. ([source](https://github.com/decolua/9router/blob/master/CHANGELOG.md))

### System Administration & Monitoring

- [Token Consumption Trackers](https://awesome-repositories.com/f/system-administration-monitoring/usage-monitoring/token-usage-analytics/token-consumption-trackers.md) — Monitors real-time token consumption and provides reset countdowns and cost estimates for service tiers. ([source](https://github.com/decolua/9router/blob/master/i18n/README.ja-JP.md))
