amrouter
БесплатноЗапускает вложенные скриптыНе проверенSelf-hosted AI gateway with one OpenAI-compatible endpoint for multi-provider LLM, embedding, image, and audio routing, automatic fallback, load balancing…
от akillness★ 63 звезды на GitHubОб этом скилле
AMRouter Skill for AI Agents
Self-hosted AI gateway: one endpoint, many providers, auto-fallback.
AMRouter is an OpenAI-compatible API gateway that routes requests across dozens of LLM, embedding, image, and audio providers with automatic load balancing, fallback, and cost optimization—designed for agents to access multi-provider AI infrastructure without provider lock-in.
Quick Links
- Official Site: https://github.com/ahwanulm/AMRouter
- Documentation: https://github.com/ahwanulm/AMRouter/tree/main/docs
- Features: Multi-provider routing, auto-fallback, Cloudflare Workers AI, OpenAI-compatible REST API
What is AMRouter?
AMRouter v2 is a rewrite of 9Router with clean separation:
- Express backend — Routes requests to 50+ LLM, embedding, image, audio, and utility providers
- Vite + React frontend — Dashboard to manage providers, connections, proxy pools, CLI tools, automation
- OpenAI-compatible API — Works with any client that supports
/v1/chat/completions,/v1/embeddings,/v1/images/generations,/v1/audio/speech, etc.
Key Features
✅ Multi-provider routing — Cloudflare Workers AI, OpenAI, Anthropic Claude, Google Gemini, Groq, Mistral, Cohere, Voyage, GitHub, and 40+ more
✅ Auto-fallback combos — Define provider chains (e.g., vip, budget, openai-only); routes fail over automatically
✅ Cost optimization — Track quota per provider, use token counters for cost estimation
✅ Cloudflare Workers AI Automation — Auto-register accounts, extract keys via Playwright + 2Captcha + temp mail
✅ Dashboard UI — Manage providers, connections, automation, view logs and metrics
✅ Agent Skills — Pre-built SKILL.md files for Claude, Gemini, and other AI coding agents
✅ OpenAI SDK compatible — Works with OpenAI npm client, Python client, or any REST client
When to Use
✅ Use AMRouter if you:
- Want to consolidate multi-provider access into one API endpoint
- Need automatic fallback when a provider fails or runs out of quota
- Want cost tracking across providers (quota limits, token counting)
- Operate multiple LLM models and need a unified interface
- Are building agent infrastructure and want easy provider swapping
- Want Cloudflare Workers AI automation (auto-registration, key extraction)
- Need a self-hosted solution (not vendor-managed unblockers)
❌ Don't use AMRouter if you:
- Only need one provider (just use their SDK directly)
- Can't run a Node.js backend
- Don't need fallback or multi-provider orchestration
- Want to use a managed service like Anthropic's API directly
Installation & Setup
Step 1: Requirements
- Node.js 20+
- Python 3.10+ (for automation features)
- Chromium (for Playwright automation; optional)
Step 2: Install
git clone https://github.com/ahwanulm/AMRouter.git
cd AMRouter
npm install
Step 3: Configure Environment
cp backend/config.env.template backend/config.env
chmod 600 backend/config.env
Key environment variables:
| Variable | Description | Example |
|---|---|---|
PORT |
Backend server port | 3001 |
REQUIRE_LOGIN |
Enable authentication | true |
JWT_SECRET |
Secret for JWT signing | (generate a random string) |
ADMIN_PASSWORD |
Dashboard admin password | (set securely) |
OPENAI_API_KEY |
OpenAI provider key | (optional) |
ANTHROPIC_API_KEY |
Anthropic provider key | (optional) |
GOOGLE_API_KEY |
Google Gemini key | (optional) |
Step 4: Development
npm run dev # Start backend + frontend concurrently
npm run backend # Backend only (port 3001)
npm run frontend # Frontend only (port 5177)
Step 5: Production
cd frontend && npm run build
cd ..
NODE_ENV=production npm start
Server runs on port 3001 (configurable). Frontend is built into backend/public/.
Core Concepts
1. Providers
A provider is an LLM, embedding, image, or audio service (OpenAI, Anthropic, Gemini, etc.).
Each provider has:
- Key/API credentials — managed via dashboard
- Models — specific model IDs (e.g.,
openai/gpt-4o,anthropic/claude-3-opus) - Quota — optional limits on tokens or requests
- Priority — used in fallback chains
2. Combos (Fallback Chains)
A combo is a named chain of providers. When you call /v1/chat/completions with combo name vip, it tries:
- Provider A
- If A fails or quota exceeded → Provider B
- If B fails → Provider C
- Etc.
Example combo config:
{
"name": "vip",
"providers": ["openai", "anthropic", "gemini"],
"strategy": "round-robin"
}
3. OpenAI-Compatible API
AMRouter exposes the same endpoints as OpenAI:
| Endpoint | Models | Example |
|---|---|---|
POST /v1/chat/completions |
Chat models | openai/gpt-4o, anthropic/claude-3-opus |
POST /v1/embeddings |
Embedding models | openai/text-embedding-3-small, `gemini/text-embeddi |
Установить amrouter в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteEditGlobGrepWebFetchEnvВложенные файлы
FAQ
Что делает скилл amrouter?
Self-hosted AI gateway with one OpenAI-compatible endpoint for multi-provider LLM, embedding, image, and audio routing, automatic fallback, load balancing, and cost optimization.
Как установить скилл amrouter?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл amrouter запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic