About this project

Sub2API is an open-source API gateway platform designed for distributing AI subscription quotas. It aggregates subscription quotas from upstream AI services such as Claude, OpenAI, Gemini, and Grok, then exposes them through API keys generated by the platform, allowing native tools to use them seamlessly. Core capabilities include: - Multi-account management: Supports multiple upstream account types including OAuth and API Key. - API key distribution: Generates and manages independent API keys for users. - Precise billing: Tracks usage and calculates costs at the token level. - Smart routing: Automatically selects accounts and supports sticky sessions. - Concurrency control: Supports concurrency limits per user and per account. - Rate limiting: Configurable request and token rate limits. - Built-in payment system: Supports EasyPay, Alipay, WeChat Pay, and Stripe, allowing users to recharge self-service without additional payment services. - Admin dashboard: Provides a web interface for monitoring and management. - Composite grouping: The admin routing layer can resolve request models to specific providers, suitable for multi-provider grouping scenarios. The project is built with Go, Vue 3, PostgreSQL 15+, and Redis 7+, and provides Docker deployment. The README explicitly notes that using this project may violate the terms of service of upstream providers such as Anthropic, and users assume all risks. The project is intended solely for technical learning and research; the author is not responsible for account bans, service interruptions, data loss, or other consequences, and does not authorize any commercial operation. From a user value perspective, it suits developers or small teams that need to centrally manage multiple AI subscription quotas, distribute usage on demand, and control costs. It belongs to the AI gateway tool category.