← all repositories
Wei-Shaw/sub2api

Your AI Subscriptions, Now With a Cash Register

Sub2API pools AI subscriptions behind a metered gateway so teams or resellers can distribute API quotas without building their own billing stack.

sub2api
Velocity · 7d
+187
★ / day
Trend
cooling
star history

What it does

Sub2API is a self-hosted gateway that sits between users and upstream AI services like Claude, OpenAI, and Gemini. It pools multiple subscription accounts, distributes platform-generated API keys to end users, and handles authentication, load balancing, and token-level billing. Think of it as a turnstile and cash register for shared AI access.

The interesting bit

What sets it apart from a simple proxy is the built-in commerce layer: it includes native payment integration for Stripe, Alipay, WeChat Pay, and EasyPay, plus an admin dashboard for monitoring. The project’s own sponsor list reads like a directory of live commercial resellers already running on the code, which is perhaps the strongest proof of concept.

Key highlights

  • Token-level usage tracking and cost calculation for precise billing.
  • Smart scheduling with sticky sessions across multiple upstream accounts (OAuth and API Key).
  • Built-in payment system for user self-service top-up without a separate billing service.
  • Concurrency and rate-limiting controls per user and per upstream account.
  • Admin dashboard extensible via iframe to embed external tools like ticketing systems.

Caveats

  • The README is largely dominated by sponsor advertisements, and the truncated excerpt leaves unclear how deep the technical documentation goes.
  • The project warns that only sub2api.org and pincc.ai are official domains, suggesting a busy ecosystem of third-party deployments to navigate.
  • Demo credentials are hardcoded in the documentation (admin@sub2api.org / admin123), which is convenient but not a security model to emulate.

Verdict

Worth a look if you need to monetize or meter shared access to AI subscriptions. If you just want a personal API proxy, this is over-engineered and comes with a side of e-commerce.

Frequently asked

What is Wei-Shaw/sub2api?
Sub2API pools AI subscriptions behind a metered gateway so teams or resellers can distribute API quotas without building their own billing stack.
Is sub2api open source?
Yes — Wei-Shaw/sub2api is open source, released under the LGPL-3.0 license.
What language is sub2api written in?
Wei-Shaw/sub2api is primarily written in Go.
How popular is sub2api?
Wei-Shaw/sub2api has 33.7k stars on GitHub and is currently cooling off.
Where can I find sub2api?
Wei-Shaw/sub2api is on GitHub at https://github.com/Wei-Shaw/sub2api.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.