@fudrouter/fsrouter

中文文档
0.6.283发布于 2026/07/28近 30 天下载 2027

9Router v2 — Monorepo (frontend + backend)

原始使用文档
文档目录17 节
  1. Screenshots
  2. Features
  3. Architecture
  4. Quick Start
  5. Requirements
  6. Install
  7. Development
  8. Environment Variables
  9. Production Deployment
  10. 1. Build Frontend
  11. 2. Start Backend
  12. 3. Nginx Reverse Proxy
  13. Cloudflare Workers AI Automation
  14. Agent Skills
  15. API Reference
  16. License
  17. Acknowledgements

FSRouter

A self-hosted AI gateway — one endpoint, many providers, auto-fallback.

FSRouter is a decoupled rewrite of 9Router 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.


Screenshots

Login PageQuota Tracker
Login PageQuota Tracker

Features

  • OpenAI-compatible API — works with any client that supports /v1/chat/completions, /v1/images/generations, /v1/audio/speech, /v1/embeddings, etc.
  • Multi-provider routing — Cloudflare Workers AI, OpenAI, Anthropic, Gemini, Groq, and many more
  • Cloudflare Workers AI Automation — automates account registration and API key extraction with Playwright + 2Captcha + FSMail temp mail
  • Dashboard UI — manage providers, connections, proxy pools, CLI tools, and automation from a modern dark-mode interface
  • OIDC / Password authentication — single sign-on or local credentials
  • Agent Skills — ready-to-use SKILL.md files for Claude, Gemini, Codex, and other AI coding agents
  • SQLite backend — zero-dependency local database, no external services required

Architecture

FSRouter/
├── backend/          # Express server (port 3001)
│   └── src/
│       ├── routes/   # Auto-routed endpoints (/v1, /api, /auth, ...)
│       ├── db/       # SQLite via better-sqlite3
│       └── automation/ # Playwright automation scripts
├── frontend/         # Vite + React SPA (port 5177)
│   └── src/
│       ├── pages/    # Dashboard pages
│       └── shared/   # Components, hooks, constants
└── skills/           # Agent SKILL.md files

Quick Start

Requirements

  • Node.js 20+
  • Python 3.10+ (for automation features)
  • Chromium (for Playwright automation)

Install

git clone https://github.com/nexusrouters/fsrouter.git
cd FSRouter
npm install

Development

npm run dev          # Start both backend + frontend concurrently
npm run backend      # Backend only (port 3001)
npm run frontend     # Frontend only (port 5177)

Environment Variables

Copy and configure the backend environment:

cp backend/.env.template backend/.env

Key variables:

VariableDescription
PORTBackend server port (default: 3001)
REQUIRE_LOGINEnable authentication (true/false)
JWT_SECRETSecret for JWT signing
ADMIN_PASSWORDDashboard admin password

Production Deployment

1. Build Frontend

cd frontend && npm run build

2. Start Backend

cd backend && npm start

3. Nginx Reverse Proxy

Use the included nginx.conf to proxy /api and /v1 to the backend while serving the built frontend statically. See docs/deployment-linux.md for a full Linux deployment guide.


Cloudflare Workers AI Automation

The automation module automatically registers Cloudflare Workers AI accounts:

  1. Configure FSMail temp mail credentials in Dashboard → Automation → Settings
  2. Add a 2Captcha API key for Turnstile solving
  3. Add email accounts in the Automation tab and click Run
  4. API keys are extracted and added to FSRouter automatically

Agent Skills

Skills are SKILL.md files for AI coding agents. Paste the entry skill URL into your AI:

Read this skill and use it:
https://raw.githubusercontent.com/nexusrouters/fsrouter/refs/heads/main/skills/fsrouter/SKILL.md

Browse all skills in the Dashboard → Skills page or in the skills/ directory.


API Reference

EndpointDescription
GET /api/healthHealth check
GET /v1/modelsList available chat/LLM models
POST /v1/chat/completionsChat completions (streaming supported)
POST /v1/images/generationsImage generation
POST /v1/audio/speechText-to-speech
POST /v1/audio/transcriptionsSpeech-to-text
POST /v1/embeddingsText embeddings
GET /v1/searchWeb search

License

MIT — see LICENSE


Acknowledgements

🙏 Thanks to FSRouter — this project is a fork and architectural rewrite of the original FSRouter monolith. The core routing logic, provider integrations, and many features were inspired by and built upon the excellent work of the FSRouter project.

版本与发布记录

@fudrouter/fsrouter 共发布 272 个版本,首次发布于 2026/07/14;过去 12 个月发布了 272 个版本。

版本发布日期距今
0.6.283latest2026/07/283 个月前
0.6.2822026/07/283 个月前
0.6.2812026/07/283 个月前
0.6.2802026/07/283 个月前
0.6.2792026/07/283 个月前
0.6.2782026/07/283 个月前

关于 @fudrouter/fsrouter 的常见问题

@fudrouter/fsrouter 是什么?

9Router v2 — Monorepo (frontend + backend)

如何安装 @fudrouter/fsrouter?

在项目目录运行 npm install @fudrouter/fsrouter,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 amrouter、fsrouter,可以用 npx amrouter 直接运行。

@fudrouter/fsrouter 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fudrouter__fsrouter 是否存在。

@fudrouter/fsrouter 可以商用吗?

@fudrouter/fsrouter 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@fudrouter/fsrouter 的下载量有多少?

根据 npm 官方下载统计,@fudrouter/fsrouter 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,027 次,日均约 68 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fudrouter/fsrouter 还在维护吗?

最新版本 0.6.283 发布于 2026/07/28(3 个月前);至今共发布 272 个版本,其中过去 12 个月发布了 272 个;首次发布于 2026/07/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。