Sub2API icon

Sub2API

Sub2API is an open-source AI API gateway that unifies multiple AI subscriptions behind a single endpoint and platform-issued API keys. It is aimed at operators who need quota distribution, usage controls, and admin management for upstream AI services.

Sub2API

Overview

Sub2API is an open-source AI API gateway platform for distributing and managing quota from AI product subscriptions. It presents a single endpoint and platform-generated API keys so users can access upstream AI services while the platform handles authentication, billing, load balancing, and request forwarding.

The repository positions the project for subscription quota distribution across providers such as Claude, OpenAI, Gemini, and Antigravity. It is intended for teams or operators who want to centralize access to multiple upstream accounts, manage usage, and expose that access through an admin dashboard.

Features

Multi-account management

Works with multiple upstream account types, including OAuth and API key-based sources, so one installation can manage different subscription formats.

API key distribution

Creates and manages API keys for users, letting client applications connect through a platform-issued key rather than directly against each upstream account.

Precise billing

Tracks token usage and calculates cost at the token level, which supports more precise quota and billing management.

Smart scheduling

Selects upstream accounts intelligently and supports sticky sessions, helping keep request routing consistent where needed.

Concurrency and rate limiting

Adds per-user and per-account concurrency limits, plus configurable request and token rate limits, to control load and usage patterns.

Built-in payments

Includes a built-in payment system with EasyPay, Alipay, WeChat Pay, and Stripe for self-service top-ups.

Use cases

  • Unified access gateway

    Centralize access to several AI subscriptions behind one API surface so downstream clients can use a consistent endpoint and key format.

  • Quota and cost management

    Track token usage and calculate costs at a finer granularity for teams that need to allocate or recover spend across users or accounts.

  • Controlled multi-user usage

    Apply per-user and per-account limits when many clients or internal tools share the same upstream capacity.

  • Operational administration

    Use the admin dashboard to monitor activity, manage keys, and handle operational tasks from a web interface.

  • Subscription recharge flow

    Accept self-service top-ups through the built-in payment options when running a subscription quota platform.

Pros and Cons

Pros

  • Combines multiple upstream account types behind one gateway, which simplifies access management.
  • Supports token-level billing, concurrency limits, and rate limiting for tighter usage control.
  • Includes a built-in payment system for self-service top-ups without requiring a separate payment service.
  • Provides an admin dashboard for monitoring and management.

Cons

  • The README warns that using the project may violate upstream providers' terms of service, so compliance risk is part of the product’s operating context.
  • The project is described as a technical learning and research tool, not as a managed service with guaranteed support or liability coverage.

FAQ

What does Sub2API do?

Sub2API is an AI API gateway that distributes and manages quota from AI product subscriptions through platform-generated API keys. The source describes support for multiple upstream account types and request forwarding through a single endpoint.

What core capabilities does it include?

The README says it supports multiple upstream account types, including OAuth and API key-based accounts, along with API key distribution, billing, scheduling, concurrency control, and rate limiting.

Does it include payment handling?

Yes. The source describes built-in payment support for EasyPay, Alipay, WeChat Pay, and Stripe so users can top up without a separate payment service.

Is it self-hosted or cloud-hosted?

The project is open source on GitHub. The repository page also shows Docker-related files and deployment assets, but the provided source does not establish a single official hosting model or managed cloud service.

Are there usage risks or limitations?

The README warns that use may violate upstream providers' terms of service and says the project is for technical learning and research purposes only. Users are responsible for compliance and any resulting risks.

Quick Facts

Category
Developer Tool
Product type
Open-source AI API gateway
Primary users
Operators managing AI subscription quota and API access
Source domain
github.com
Pricing model
Not specified in the repository sources