[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92584":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},92584,"AMRouter","ahwanulm\u002FAMRouter","ahwanulm","Self-hosted AI gateway — one endpoint, many providers, auto-fallback. OpenAI-compatible REST API with Cloudflare Workers AI automation.","",null,"JavaScript",121,57,1,5,0,31,48.39,"MIT License",false,"master",[23,24,25,26,27,28,29,30,31,32,33,34],"ai","automation","claude","cloudflare-workers","gemini","kiro","llm","proxy","qoder","skills","token-saver","worker-ai","2026-07-22 04:02:06","# 9Router v2\n\n> A self-hosted AI gateway — one endpoint, many providers, auto-fallback.\n\n9Router v2 is a decoupled rewrite of [9Router](https:\u002F\u002Fgithub.com\u002Fdecolua\u002F9router) with a clean separation between a dedicated **Express backend** and a **Vite + React frontend**. It exposes an OpenAI-compatible REST API that proxies requests across dozens of AI providers with automatic load balancing, fallback, and key rotation.\n\n---\n\n## Screenshots\n\n| Login Page | Quota Tracker |\n|:---:|:---:|\n| ![Login Page](docs\u002Fscrenshoot\u002Flogin-page.png) | ![Quota Tracker](docs\u002Fscrenshoot\u002Fquota-tracker.png) |\n\n---\n\n## Features\n\n- **OpenAI-compatible API** — works with any client that supports `\u002Fv1\u002Fchat\u002Fcompletions`, `\u002Fv1\u002Fimages\u002Fgenerations`, `\u002Fv1\u002Faudio\u002Fspeech`, `\u002Fv1\u002Fembeddings`, etc.\n- **Multi-provider routing** — Cloudflare Workers AI, OpenAI, Anthropic, Gemini, Groq, and many more\n- **Cloudflare Workers AI Automation** — automates account registration and API key extraction with Playwright + 2Captcha + Ammail temp mail\n- **Dashboard UI** — manage providers, connections, proxy pools, CLI tools, and automation from a modern dark-mode interface\n- **OIDC \u002F Password authentication** — single sign-on or local credentials\n- **Agent Skills** — ready-to-use SKILL.md files for Claude, Gemini, Codex, and other AI coding agents\n- **SQLite backend** — zero-dependency local database, no external services required\n\n---\n\n## Architecture\n\n```\nAMRouter\u002F\n├── backend\u002F          # Express server (port 3001)\n│   └── src\u002F\n│       ├── routes\u002F   # Auto-routed endpoints (\u002Fv1, \u002Fapi, \u002Fauth, ...)\n│       ├── db\u002F       # SQLite via better-sqlite3\n│       └── automation\u002F # Playwright automation scripts\n├── frontend\u002F         # Vite + React SPA (port 5177)\n│   └── src\u002F\n│       ├── pages\u002F    # Dashboard pages\n│       └── shared\u002F   # Components, hooks, constants\n└── skills\u002F           # Agent SKILL.md files\n```\n\n---\n\n## Quick Start\n\n### Requirements\n\n- Node.js 20+\n- Python 3.10+ (for automation features)\n- Chromium (for Playwright automation)\n\n### Install\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fahwanulm\u002FAMRouter.git\ncd AMRouter\nnpm install\n```\n\n### Development\n\n```bash\nnpm run dev          # Start both backend + frontend concurrently\nnpm run backend      # Backend only (port 3001)\nnpm run frontend     # Frontend only (port 5177)\n```\n\n### Environment Variables\n\nCopy and configure the backend environment:\n\n```bash\ncp backend\u002F.env.template backend\u002F.env\n```\n\nKey variables:\n\n| Variable | Description |\n|---|---|\n| `PORT` | Backend server port (default: `3001`) |\n| `REQUIRE_LOGIN` | Enable authentication (`true`\u002F`false`) |\n| `JWT_SECRET` | Secret for JWT signing |\n| `ADMIN_PASSWORD` | Dashboard admin password |\n\n---\n\n## Production Deployment\n\n### 1. Build Frontend\n\n```bash\ncd frontend && npm run build\n```\n\n### 2. Start Backend\n\n```bash\ncd backend && npm start\n```\n\n### 3. Nginx Reverse Proxy\n\nUse the included `nginx.conf` to proxy `\u002Fapi` and `\u002Fv1` to the backend while serving the built frontend statically. See `docs\u002Fdeployment-linux.md` for a full Linux deployment guide.\n\n---\n\n## Cloudflare Workers AI Automation\n\nThe automation module automatically registers Cloudflare Workers AI accounts:\n\n1. Configure **Ammail** temp mail credentials in Dashboard → Automation → Settings\n2. Add a **2Captcha** API key for Turnstile solving\n3. Add email accounts in the Automation tab and click **Run**\n4. API keys are extracted and added to 9Router automatically\n\n---\n\n## Agent Skills\n\nSkills are SKILL.md files for AI coding agents. Paste the entry skill URL into your AI:\n\n```\nRead this skill and use it:\nhttps:\u002F\u002Fraw.githubusercontent.com\u002Fahwanulm\u002FAMRouter\u002Frefs\u002Fheads\u002Fmaster\u002Fskills\u002F9router\u002FSKILL.md\n```\n\nBrowse all skills in the Dashboard → Skills page or in the [`skills\u002F`](.\u002Fskills\u002F) directory.\n\n---\n\n## API Reference\n\n| Endpoint | Description |\n|---|---|\n| `GET \u002Fapi\u002Fhealth` | Health check |\n| `GET \u002Fv1\u002Fmodels` | List available chat\u002FLLM models |\n| `POST \u002Fv1\u002Fchat\u002Fcompletions` | Chat completions (streaming supported) |\n| `POST \u002Fv1\u002Fimages\u002Fgenerations` | Image generation |\n| `POST \u002Fv1\u002Faudio\u002Fspeech` | Text-to-speech |\n| `POST \u002Fv1\u002Faudio\u002Ftranscriptions` | Speech-to-text |\n| `POST \u002Fv1\u002Fembeddings` | Text embeddings |\n| `GET \u002Fv1\u002Fsearch` | Web search |\n\n---\n\n## License\n\nMIT — see [LICENSE](.\u002FLICENSE)\n\n---\n\n## Acknowledgements\n\n> 🙏 **Thanks to [9Router](https:\u002F\u002Fgithub.com\u002Fdecolua\u002F9router)** — this project is a fork and architectural rewrite of the original 9Router monolith. The core routing logic, provider integrations, and many features were inspired by and built upon the excellent work of the 9Router project.\n","AMRouter 是一个自托管的 AI 请求网关，提供统一 OpenAI 兼容 REST 接口，自动路由请求至多个大模型服务商并支持故障自动降级。核心功能包括多供应商代理（OpenAI、Anthropic、Gemini、Cloudflare Workers AI 等）、基于 Playwright 的自动化账号注册与密钥提取、内置 SQLite 的轻量后端、OIDC\u002F密码认证及可视化管理面板。适用于需整合多家 LLM 服务、规避单点依赖、控制流量分发与配额管理的中小团队或开发者私有部署场景。",2,"2026-07-09 02:30:25","CREATED_QUERY"]