sub2api is a self-hosted gateway that turns Claude, OpenAI, Gemini and Grok subscriptions into shareable API keys with authentication, billing, load balancing and request forwarding. It is designed for distributing and managing API quotas from AI product subscriptions across multiple users with unified access.
Project overview
It addresses a concrete operational need—sharing subscription-based AI access among multiple users through one gateway with API key distribution, billing, and load balancing—making subscription quotas usable as managed API services.
Project type
Infrastructure
Deployment
Refer to project documentation
License
LGPL-3.0
Best for
Developers and operations teams who need to distribute and manage API quotas from AI product subscriptions across multiple users with unified access.
Key capabilities
Generate and manage API keys for users to access upstream AI services through the platform.
Bounds the lifetime and aggregate count of client-facing Responses WebSocket sessions via the gateway.openai_ws configuration.
Limitations and risks
Using this project may violate the terms of service of Anthropic and other upstream providers. Review your provider agreements before adoption.
The authors assume no liability for account bans, service interruptions, data loss or other damages; assess this risk before relying on the gateway for critical workloads.
Getting started
Setup difficulty is documented as easy, with an optional coding requirement. First success path: mkdir -p sub2api-deploy && cd sub2api-deploy; curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/docker-deploy.sh | bash; docker compose up -d. Admin configuration uses .env with ADMIN_EMAIL and ADMIN_PASSWORD.
Evidence and sources
README: Sub2API is an AI API gateway platform designed to distribute and manage API quotas from AI product subscriptions. Users can access upstream AI services through platform-generated…
README: Sub2API is an AI API gateway platform designed to distribute and manage API quotas from AI product subscriptions.
README: - **Multi-Account Management** - Support multiple upstream account types (OAuth, API Key) - **API Key Distribution** - Generate and manage API Keys for users - **Precise Billing**…
README: `gateway.openai_ws` bounds the lifetime and aggregate count of client-facing Responses WebSocket sessions.