boos 7886a0ab8b
CI / Detect Docs Changes (push) Waiting to run
CI / Test Core (push) Waiting to run
CI / Build Web (push) Waiting to run
CI / Build Server (push) Waiting to run
CI / Build Desktop (push) Waiting to run
CI / Typecheck (push) Waiting to run
CI / Repo Drift Check (push) Waiting to run
CI / Schema Check (SQLite) (push) Waiting to run
CI / Schema Check (MySQL) (push) Waiting to run
CI / Schema Check (Postgres) (push) Waiting to run
CI / Build Docs (push) Blocked by required conditions
CI / Audit Production Dependencies (push) Waiting to run
CI / Publish Docker Image (amd64) (push) Waiting to run
CI / Publish Docker Image (arm64) (push) Waiting to run
CI / Publish Docker Image (armv7) (push) Waiting to run
CI / Publish Docker Manifest (push) Blocked by required conditions
CodeQL / Analyze (JavaScript/TypeScript) (javascript-typescript) (push) Waiting to run
feat: add SaaS multi-tenant user management
- Add organizations, organization_members, invitations, data_plans tables
- Add organizationService (CRUD, member management, plan limit check)
- Add invitationService (create, accept, cancel invitations)
- Add planService (plan limits, seed defaults)
- Add /api/organizations/* routes (org CRUD, members, invitations)
- Add /api/invitations/* routes (public invite lookup, accept)
- Seed default plans (free/pro/enterprise) on startup

Signed-off-by: Boos4721 <boos4721@icloud.com>
2026-05-15 21:25:53 +08:00
2026-04-06 15:19:18 +08:00

BoosAPI

AI Aggregation Gateway + Built-in ComfyUI — Unify scattered relay stations into one entry point

Aggregate your New API / One API / OneHub / DoneHub / Veloera / AnyRouter / Sub2API stations
into one API Key, one endpoint — with auto model discovery, smart routing, and cost optimization.
Built-in ComfyUI chat assistant — generate images/videos from natural language, ready out of the box.

Node.js TypeScript License

中文 | English


📖 Introduction

With the growing ecosystem of AI relay stations (New API / One API based), managing balances, models, and API keys across multiple stations is tedious and time-consuming.

BoosAPI acts as a meta-aggregation layer above these stations, unifying them under a single entry point — all downstream tools connect seamlessly without configuration changes.

Supported Upstreams

  • Panels: New API, One API, OneHub, DoneHub, Veloera, AnyRouter, Sub2API
  • Generic: OpenAI / Claude / Gemini compatible, cliproxyapi / CPA
  • Official: Aliyun, Zhipu, Doubao Coding Plan, DeepSeek, Moonshot, MiniMax, ModelScope
  • OAuth: Codex, Claude, Gemini CLI, Antigravity
Pain Point BoosAPI Solution
🔑 One key per station, messy configs Unified proxy entry + multi-key strategy
💸 Which station is cheapest? Smart routing by cost, balance, usage
🔄 Manual failover Auto failover with cooldown and retry
📊 Scattered balances Central dashboard with alerts
Daily check-ins Auto check-in with reward tracking
🤷 What models are available? Auto model discovery, zero config
🎨 ComfyUI workflows too complex? Chat assistant, describe in natural language

Features

🎨 Built-in ComfyUI Chat Assistant

  • Natural language to workflow: describe what you want, AI builds the ComfyUI pipeline
  • Multi-view generation: front/back/left/right directional image generation
  • Scene/video generation: text description directly generates video content
  • SSE real-time streaming: generation progress feedback
  • Sidebar "Chat Assistant" entry, same UI as the aggregation gateway
  • Auto-connects to ComfyUI API (:8188), zero configuration required

🌐 Unified Proxy Gateway

  • Compatible with OpenAI and Claude downstream formats
  • Responses / Chat Completions / Messages / Completions / Embeddings / Images / Models / Files
  • SSE streaming with automatic format conversion

🧠 Smart Routing Engine

  • Auto-discovers models from all upstream stations
  • Four-tier cost signals: measured → configured → catalog → fallback
  • Multi-channel weighted distribution (cost 40%, balance 30%, usage 30%)
  • Auto cooldown on failure (default 10 min), seamless channel switching

📡 Multi-Platform Management

Platform Adapter
New API new-api
One API one-api
OneHub onehub
DoneHub done-hub
Veloera veloera
AnyRouter anyrouter
Sub2API sub2api

👥 Account & Token Management

  • Multi-station, multi-account with health tracking (healthy / unhealthy / degraded / disabled)
  • Encrypted credential storage, auto-renewal, cascading disable

💰 Balance Management

  • Scheduled refresh (default hourly), income/expense trends
  • Fallback estimation when API is unavailable

🔔 Alerts & Notifications

Five channels: Webhook / Bark / ServerChan / Telegram Bot / SMTP

Scenarios: low balance, station failure, check-in failure, proxy errors, token expiry, daily digest


🚀 Quick Start

mkdir boosapi && cd boosapi

cat > docker-compose.yml << 'EOF'
services:
  boosapi:
    image: 1467078763/metapi:latest
    ports:
      - "4000:4000"
    volumes:
      - ./data:/app/data
    environment:
      AUTH_TOKEN: ${AUTH_TOKEN:?AUTH_TOKEN is required}
      PROXY_TOKEN: ${PROXY_TOKEN:?PROXY_TOKEN is required}
      CHECKIN_CRON: "0 8 * * *"
      BALANCE_REFRESH_CRON: "0 * * * *"
      PORT: ${PORT:-4000}
      DATA_DIR: /app/data
      TZ: ${TZ:-Asia/Shanghai}
    restart: unless-stopped
EOF

export AUTH_TOKEN=your-admin-token
export PROXY_TOKEN=your-proxy-sk-token
docker compose up -d

Open http://localhost:4000 and log in with AUTH_TOKEN.


🏗️ Tech Stack

Layer Tech
Backend Fastify
Frontend React 18 + Vite
Language TypeScript
Styling Tailwind CSS v4
Database SQLite / MySQL / PostgreSQL + Drizzle ORM
Visualization VChart
Container Docker + Docker Compose
Test Vitest

🛠️ Local Development

npm install
npm run db:migrate
npm run dev
npm run build        # Build web + server
npm test             # Run tests

📜 License

MIT

S
Description
Meta-layer management and unified proxy for AI API aggregation
Readme MIT 47 MiB
Languages
TypeScript 97.8%
CSS 1.5%
JavaScript 0.4%
Python 0.1%