Sub2API - An open-source AI API gateway platform that supports multi-account management
Sub2API is an open-source AI API gateway platform that supports unified access and management of subscriptions to mainstream AI services such as Claude, OpenAI, Gemini, and Antigravity. The platform provides features such as multi-account management, API Key distribution, token-level accurate billing, intelligent scheduling, and concurrency control.
Sub2API is an open source AI API transit gateway platform that supports unified access and management of subscriptions to mainstream AI services such as Claude, OpenAI, Gemini, and Antigravity. The platform provides functions such as multi-account management, API Key distribution, Token-level precise billing, intelligent scheduling and concurrency control, and realizes the “carpool sharing” model to efficiently allocate subscription costs. Users can access upstream AI services through the API Key generated by the platform, and native client tools can be used seamlessly. Sub2API uses Go + Vue technology stack, which is suitable for individual developers or teams to build private AI API distribution systems.
Main functions of Sub2API
- Multiple account management : Supports multiple authentication methods such as OAuth and API Key, and provides unified access to mainstream AI service accounts such as Claude, OpenAI, Gemini, and Antigravity.
- API Key Distribution : Generate and manage independent API Keys for downstream users, support custom prefixes, and achieve secure access control.
- Accurate billing : Provide token-level usage tracking and real-time cost calculation to ensure transparent and accurate cost allocation.
- Intelligent scheduling : Select the optimal account through intelligent algorithms, support sticky sessions, and ensure that the same conversation is always routed to the same upstream account.
- Concurrency control : Support setting concurrency limits by user and account to prevent overloading of a single user or account from affecting overall service stability.
- rate limit : The platform can flexibly configure the request frequency and Token consumption rate.
- Management background : Provides a fully functional Web management interface, supports real-time monitoring, data statistics, account management, and can be embedded in external systems such as payment.
Key information and usage requirements of Sub2API
- official domain name :
sub2api.organdpincc.ai(Other domain names are deployed by third parties) - technology stack :Go + Vue3 + PostgreSQL + Redis
- Open source agreement :MIT License
- Official hosting service :PinCC (no need to build it yourself, ready to use)
- operating system : Linux (amd64 or arm64)
- Go version :1.21+ (source code compilation)
- Node.js :18+ (front-end development)
- PostgreSQL :15+
- Redis :7+
Core advantages of Sub2API
- cost sharing : Support multiple people to share AI subscription accounts, achieve fair sharing of costs through token-level precise billing, and significantly reduce personal use costs.
- unified access : A single platform integrates mainstream AI services such as Claude, OpenAI, Gemini, Antigravity, etc., without the need to manage multiple official accounts separately.
- Natively compatible : Downstream users can directly use official clients and tools (such as Claude Code, Codex CLI) without modifying the code or learning new interfaces.
- Intelligent scheduling : Built-in load balancing and sticky session mechanism, automatically selects the optimal account and ensures conversation continuity, improving user experience and stability.
- Flexible deployment : Provides three deployment methods: one-click script installation, Docker Compose, and source code compilation to meet the needs of different technical levels and scenarios.
- Fine control : Supports multi-dimensional management and control such as concurrency limit, rate limit, usage monitoring, etc., effectively preventing account overload and triggering platform risk control.
How to use Sub2API
- Method 1 :Official hosting service PinCC (recommended for newbies) Visit registration : open
pincc.aiComplete the account registration on the official website. - Recharge amount : Select the package to recharge or pay as you go to get the usage quota.
- Generate key : Create an API Key in the console for client authentication.
- Configure using : Fill in the Base URL and API Key into the official client to start using it. Method 2 : Self-built deployment (recommended for technical users)
- **preparation stage Environmental preparation : Prepare a Linux server and install PostgreSQL 15+ and Redis 7+.
- Perform installation : Run the official one-click script to automatically complete program deployment and system service configuration.
- Initial configuration : Access the server port 8080 to complete the database connection and administrator account creation. configuration phase
- Add upstream** : Add AI service accounts such as Claude and OpenAI in the management background and complete authorization.
- Create user : Generate independent API Keys for downstream users and assign usage quotas or billing rules.
- Client access : Users configure the Base URL and API Key provided by the platform into the official client tool.
Sub2API project address
- Project official website :https://demo.sub2api.org/home
- GitHub repository :https://github.com/Wei-Shaw/sub2api
Comparison of similar competing products of Sub2API
| Contrast Dimensions | Sub2API | One API | New API | AI Gateway |
|---|---|---|---|---|
| Open source agreement | MIT License | MIT License | MIT License | Partial open source/commercial version |
| Deployment method | Script/Docker/Source Code | Docker/source code | Docker/binary | Docker/Cloud Service |
| Support model | Claude/OpenAI/Gemini | OpenAI/Claude/Wenxin/Tongyi, etc. | OpenAI/Claude/Gemini, etc. | OpenAI/Anthropic/self-built model |
| core positioning | Subscription Quota Distribution and Ride Sharing | Multi-model unified access and forwarding | Cost-effective API transfer | Enterprise-grade API management and security |
| Billing accuracy | Token-level accurate billing | Token level billing | Pay-per-view or Token billing | Token level billing |
| Account management | Multi-account intelligent scheduling + sticky session | Multi-channel load balancing | Multiple Key Polling | Enterprise-level account pool management |
| User system | Complete SaaS user system | Simple user management | Basic user management | Enterprise-level RBAC permissions |
| Features | Carpooling cost sharing, simple mode | Channel retry, priority control | Low-cost transit, high concurrency | Audit logs, security compliance |
Application scenarios of Sub2API
- AI subscription ride sharing : Multiple people share expensive subscription fees such as Claude Pro and OpenAI Plus, achieving fair cost sharing through Token-level precise billing, allowing individual developers to use top AI models at a lower cost.
- Unified management of team AI resources : Enterprises or teams centrally manage multiple AI service accounts, and uniformly generate and assign API Keys to members for use, avoiding security risks caused by directly sharing account passwords, while achieving refined permissions and usage control.
- Personal multiple account aggregation : Individual users can integrate AI accounts scattered on different platforms into a single portal, eliminating the need to frequently switch between multiple official clients, and uniformly call various services such as Claude, Gemini, and OpenAI within one interface.
- Secondary distribution of AI services : Technology enthusiasts or small service providers can build private API transfer stations to provide stable AI interface services for downstream users or customers, support customized billing strategies and quota management, and achieve lightweight SaaS operations.
- Development and test environment isolation : Provide independent AI interface access channels for development and testing environments, completely isolated from production environment accounts, preventing test traffic from triggering platform risk control or exhausting the quota of official accounts. ©