Skip to content

Repository files navigation

relay-panel

One control plane for many LLM API relay stations.

Provision, upgrade, and monitor any number of self-hosted sub2api / new-api instances — engines stay unmodified, everything is driven from a single panel.

License: MIT Node TypeScript Live demo

English · 简体中文Live demo →


relay-panel — fleet overview

Why

Running an API relay station on top of an open-source engine (sub2api / new-api) has a low barrier: get upstream channels, deploy the engine, set your markup, done. But running several of them — different brands, different audiences, different domains — turns into repetitive manual work: deploy, upgrade, configure, fail over, all multiplied by every instance and every engine release.

relay-panel collapses that into one control plane:

┌───────────────────── relay-panel (control plane) ─────────────────────┐
│  web admin (Vue SPA) · auth / RBAC / audit · job engine · alerts      │
│  site lifecycle · channel marketplace + ledger · billing · domains    │
├───────────────────────── engine adapter layer ────────────────────────┤
│         sub2api adapter          │          new-api adapter           │
├───────────────────── data plane (isolated per site) ──────────────────┤
│   site A: sub2api + PG   │   site B: new-api + DB   │       …         │
└───────────────────────────────────────────────────────────────────────┘

Features

  • Site lifecycle — one-click provision / pinned-version upgrade with auto-rollback / start / stop / destroy, driven by a job engine with per-step timelines.
  • Web admin backend — Vue 3 SPA: fleet overview, per-site drill-down (channels / users / usage / domains / audit), job timelines. Liquid-glass UI with light/dark themes and 10-language i18n (English / 中文 / 日本語 / 한국어 / Français / Deutsch / Español / Português / Italiano / Bahasa Indonesia).
  • Multi-engine, zero modification — sub2api and new-api behind one adapter interface; engines always run official releases.
  • Channel marketplace — upstream channel templates, one-click injection into any site (bring-your-own upstream, or managed keys issued by a metering gateway), with a usage/settlement ledger.
  • Alerting — site down / job failed / channel disabled / low balance, with webhook notifications.
  • Multi-tenant RBAC — root / operator / viewer roles, invite-based signup, session auth, full audit trail on every write.
  • Billing & quotas — plans and subscriptions gate how many sites an operator can run (manual provisioning built in; payment gateways are an extension point).
  • Domain automation — bind a domain in the panel, routes are pushed to Caddy's admin API, TLS is automatic.
  • Observability — Prometheus /metrics, health probes, structured audit log.
  • Backup / restore — one command dumps orchestrator state plus every site's database.
  • One-command deploydocker compose up -d from deploy/.

Screenshots

Try it live at demo.3api.pro — read-only demo, sample data, resets periodically.

Per-site drill-down with usage trends
Per-site drill-down — channels, users, usage trends, domains, audit
Channel marketplace
Channel marketplace — templates, grants, settlement
Settlement ledger
Settlement ledger — usage, upstream cost, margin
Alerting
Alerting — site down / job failed / channel disabled / low balance
Light theme
Light theme
Billing and quotas
Billing & quotas · plans and subscriptions

Hosted or self-hosted

Two ways to run relay-panel — same codebase, your choice of whose server runs it.

Hosted SaaS Self-hosted
Get started Sign up at panel.3api.pro — no server needed docker compose up -d from deploy/
Runs on Our infrastructure Yours
You manage Just your relay stations The orchestrator + your stations
Best for Ship fast, connect existing stations, pay as you grow Full control, air-gapped, or your own SaaS
  • Try before anythingdemo.3api.pro (read-only, sample data).
  • Hosted: create a new station or connect an existing sub2api / new-api in minutes, manage your whole fleet from one panel, and grow into the channel marketplace. Self-serve subscriptions; you never touch a server.
  • Self-hosted: one command brings up the full stack; the self-host guide covers reverse proxy, backups, and metering.

Core principles

  1. Engines are never modified. sub2api / new-api always run their official releases. All added value lives in the orchestration layer and is applied through each engine's own admin API. This keeps upgrades cheap and licensing clean (see docs/LICENSE-COMPLIANCE.md).
  2. One isolated instance per site. No shared multi-tenancy at the data layer — clean isolation, independent upgrades, and any site can be exported as a stock engine instance at any time.
  3. Hosted and self-hosted share one codebase. The only difference is whose server runs the orchestrator.

Quick start

git clone https://github.com/3api-pro/relay-panel.git
cd relay-panel/deploy
cp .env.example .env   # set RP_SECRET_KEY, RP_ADMIN_EMAIL, RP_ADMIN_PASSWORD
docker compose up -d

Then open http://<server>:7100 and log in. Full guide (env reference, reverse proxy, upgrades, backups, migration from the old Basic-Auth setup): docs/SELF-HOST.md.

For development:

npm install
npm run typecheck
npm test

Documentation

Doc Contents
docs/SELF-HOST.md Deploy, configure, upgrade, back up
docs/API.md Full HTTP API reference
docs/ADAPTERS.md Adapter interfaces + how to add a new engine
docs/OPERATIONS.md Monitoring, alerting, backup/restore, troubleshooting
docs/SECURITY.md Threat model, credential encryption, RBAC, disclosure
docs/METERING-GATEWAY.md HTTP contract for the managed-marketplace metering gateway
docs/CADDY.md Domain automation with Caddy
docs/ARCHITECTURE.md Design and rationale

Architecture

  • packages/adapter-core — engine-agnostic domain types + the EngineAdapter / EngineLifecycle interfaces.
  • packages/adapter-sub2api / packages/adapter-newapi — engine implementations (admin auth, channels/groups/users/settings/usage).
  • packages/orchestrator — Fastify + Drizzle control plane: sites, jobs, auth/RBAC, marketplace + ledger, alerts, billing, domains, metrics, CLI.
  • packages/web — Vue 3 + Vite + Tailwind admin SPA.

Status & roadmap

This is a v2 rewrite; it is not compatible with the original relay-panel (a self-built relay engine), which is preserved on the legacy branch.

  • P1 — Fleet manager: orchestrator + sub2api adapter + site lifecycle + read-only unified dashboard
  • P2 — More engines + channel marketplace: new-api adapter; channel templates, grants, metering/settlement ledger
  • P3 — Admin backend: operator accounts + RBAC, full write UI, alerting, one-command Docker deployment
  • P4 — Hosted SaaS: multi-tenant RBAC, invite signup, quota/billing core, and domain automation are done; payment integration and hosted operations are extension points in progress

Full milestone plan through v1.0: ROADMAP.md.

Sponsors

relay-panel's development is backed by these LLM API relay platforms — production users of the engines this project orchestrates:

llmapi.pro — Unified multi-model LLM API · Claude · GPT · Gemini and more
tieapi.com — High-availability API gateway for teams and developers
vipapi.ai — Premium LLM API access with flexible plans

Interested in sponsoring? Open an issue.

Contributing

See CONTRIBUTING.md. The engine adapter layer (packages/adapter-*) is the recommended entry point for outside contributors — it contains no billing, upstream-routing, or credential logic, is self-contained and independently testable, and breaking it cannot touch production billing or tenant isolation. Want to bring a new engine? Follow docs/ADAPTERS.md.

License

MIT for the orchestrator itself (see LICENSE). Orchestrated engines keep their own licenses — new-api (AGPL-3.0), sub2api (LGPL-3.0); relay-panel invokes them only through their public admin APIs and never bundles or modifies them.

About

多站中转站编排框架 · 一套面板管理任意多个 sub2api / new-api 实例,引擎零修改,开站/升级/批量渠道/看板/计费一键化。托管 panel.3api.pro · 在线 Demo demo.3api.pro

Topics

Resources

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages