An AI API gateway/proxy built with Go (Gin + GORM). Aggregates 40+ upstream AI providers (OpenAI, Claude, Gemini, Azure, AWS Bedrock, etc.) behind a unified API with user management, billing, rate limiting, and an admin dashboard.
Backend: Go 1.22+, Gin, GORM v2
Frontend: React 18 + Vite + Semi Design
DB: SQLite / MySQL / PostgreSQL
Cache: Redis + in-memory
Auth: JWT + sessions + WebAuthn + OAuth
Layered: Router -> Controller -> Service -> Model
All API responses follow:
{"success": true/false, "message": "", "data": <payload>}Paginated responses use:
{"page": 1, "page_size": 20, "total": 100, "items": [...]}| CLI Command Group | API Route Group | Auth Level |
|---|---|---|
auth |
/api/user/login, /api/user/self |
Public / User |
user |
/api/user/ |
Admin |
channel |
/api/channel/ |
Admin |
token |
/api/token/ |
User |
model |
/api/models/, /api/pricing |
Admin / Public |
log |
/api/log/ |
Admin / User |
redemption |
/api/redemption/ |
Admin |
option |
/api/option/ |
Root |
group |
/api/group/ |
Admin |
performance |
/api/performance/ |
Root |
subscription |
/api/subscription/ |
User / Admin |
deployment |
/api/deployments/ |
Admin |
vendor |
/api/vendors/ |
Admin |
data |
/api/data/ |
Admin / User |
system |
/api/status, /api/notice |
Public |
Sessions stored in ~/.cli-anything/new-api/session.json (chmod 600).
Contains: base_url, access_token, username, user_id, role.
auth login— POST /api/user/login with username/password- If 2FA required, prompt for code → POST /api/user/login/2fa
- Save access token, fetch /api/user/self for role info
- All subsequent requests use Bearer token auth
See constant/channel_type.go — 37+ provider types including:
OpenAI(1), Claude(14), Gemini(24), Azure(3), AWS(33), etc.