mrkeyoor.com_
Fri 18 Sept 22:20 UTC
AI Toolsevaluationupdated 27 Aug 2026

sub2api review

Sub2API is a Go-based gateway that turns AI product subscriptions and API accounts into centrally managed API keys for users. Its default README is in English, with Chinese and Japanese translations, and it covers billing, routing, account pools, quotas, and an admin dashboard.

+577stars / 7d
Verdict

Our run passed all 48 Go tests, but Sub2API's own README warns that relaying subscription access may breach upstream terms, so technical readiness does not settle whether you should deploy it. It is a serious option for an authorized internal gateway that needs account pools, billing, and user keys. Do not build a business on consumer subscriptions unless each provider has approved that use in writing.

We ran it

Lab card: what happened when we ran sub2apiScreenshot of sub2api (github.com/Wei-Shaw/sub2api)
Install✓ · 96s405 packages
Build✓ · 142s
Tests✓ · 196s48 passed · 0 failed of 48 (go test)
Repo3631 files~1,246,556 lines of source · 49.1 MB · 4 CI workflows · Dockerfile

Answers from our run

Does sub2api build from source?

Dependencies installed in 96 seconds (405 packages), and the build succeeded in 142 seconds. We cloned commit d45135d into a clean Debian container with 3 CPUs and no project-specific setup.

Do sub2api's tests pass?

Yes: 48 of 48 passed when we ran the project's own test command (go test). Some failures need services or credentials a bare container does not have.

Who should not use sub2api?

Anyone planning to resell consumer subscription capacity without provider approval: the README says this use may violate upstream terms and says the developers have not authorized commercial operation.

What are the alternatives to sub2api?

LiteLLM, Portkey AI Gateway, One API. Our run passed all 48 Go tests, but Sub2API's own README warns that relaying subscription access may breach upstream terms, so technical readiness does not settle whether you should deploy it.

Setup3/5Build passed; real use still needs Postgres, Redis, and secrets
Docs4/5Detailed deployment, security, routing, and provider guidance
Community4/5August 27 push with a very large review queue
Maturity3/5Broad operator surface, offset by policy and security exposure

Who it’s for

Operators who need one gateway for several legitimate OpenAI, Anthropic, Gemini, or xAI accounts.
Internal platform teams that need per-user keys, usage records, rate limits, and account scheduling.
Experienced self-hosters prepared to run PostgreSQL, Redis, TLS, backups, and provider-specific authentication.

Who it’s NOT for

Anyone planning to resell consumer subscription capacity without provider approval: the README says this use may violate upstream terms and says the developers have not authorized commercial operation.
Teams that cannot protect upstream OAuth tokens, API keys, user balances, and payment credentials in one high-value service.
Small applications that only need one official provider API: PostgreSQL, Redis, an admin plane, billing logic, and account scheduling add work that a direct SDK avoids.
Operators expecting safe internet exposure from the default Compose settings: the README says HTTP URLs are allowed when the URL allowlist is disabled and tells production users to tighten it.
Developers who want a quiet, stable surface: 2,872 open issues and PRs plus an August 27, 2026 push indicate heavy activity and a large review queue.

Setup reality

Our sandbox install succeeded in 96 seconds with 405 packages, the build finished in 142 seconds, and all 48 Go tests passed in 196 seconds. We ran commit d45135d inside an unprivileged Go 1.24 Debian container with 3 CPUs and 8 GB of RAM.

A usable deployment also needs PostgreSQL 15 or newer, Redis 7 or newer, secure passwords, an admin account, and upstream provider credentials. Docker Compose bundles the data services, while the script install expects root and working host services.

The README documents two traps worth handling before exposure: Nginx must accept the _ character in header names for Codex sticky sessions, and production operators should restrict HTTP URLs. Backups, TLS, payment configuration, OAuth token storage, and provider terms remain the operator's job.

The gateway handles accounts, users, and money

Sub2API sits between AI clients and upstream providers. An administrator adds OAuth or API-key accounts, then issues separate keys to users. The gateway records token use, calculates charges, applies rate and concurrency limits, and chooses an upstream account. It speaks familiar OpenAI, Anthropic, Gemini, and xAI shapes, which lets coding clients point at a new base URL instead of learning a private protocol.

This is more than a reverse proxy. The dashboard manages users, balances, account pools, model groups, payments, and usage. Sticky sessions can keep a conversation on one upstream account, while composite groups map a requested model to several possible providers. That scope explains the operational weight: our checkout contained 3,631 files and about 1,246,556 lines of source, with the Go project under backend/.

The default README is English and links full Chinese and Japanese versions. It is unusually candid about the legal boundary. Using subscription accounts this way may violate Anthropic or another provider's terms, and the maintainers say they have not authorized commercial operation based on the project. Those warnings belong in the deployment decision, not in a footer nobody reads.

What happened when we ran it

Our install at commit d45135d completed in 96 seconds and pulled 405 packages. The build then succeeded in 142 seconds. Running the Go tests took 196 seconds, with 48 passing and none failing, inside an unprivileged Debian container limited to 3 CPUs and 8 GB of RAM.

That is a clean engineering result. Four CI workflow files and a Dockerfile support the impression that the repository is worked on as deployable software. There is no dedicated tests directory, but the Go test command found and passed 48 tests. We did not test live upstream accounts, billing providers, OAuth refresh, or traffic under load because the sandbox had no secrets.

The clean run should be read narrowly. It shows that the measured commit installed, compiled, and passed its available Go suite in our environment. It does not show that a provider permits subscription relay, that balances reconcile under failures, or that an internet-facing deployment is secure. Those require contract review and application-specific testing.

Docker Compose still leaves production decisions to you

The shortest full-stack path uses Docker Compose with PostgreSQL and Redis containers. A script installer is also available for Linux servers, but it needs root privileges plus PostgreSQL 15 or newer and Redis 7 or newer already running. Source builds add Go, Node, pnpm, migrations, frontend assets, and a configuration file.

Credential work starts after the containers boot. You need secure database and admin passwords, provider API keys or OAuth accounts, and possibly Stripe, Alipay, WeChat Pay, or EasyPay settings. The setup wizard creates the first administrator. The README warns that copying a template configuration too early skips that wizard and can leave an empty users table, producing an invalid-login loop.

Reverse proxies have a less obvious requirement. Codex sticky sessions use a header containing the _ character, and Nginx drops those headers by default. The documented fix enables them in the Nginx http block. If an operator misses that line, ordinary requests can still work while session routing fails, which makes the mistake harder to spot.

Default URL handling needs tightening before exposure

The Compose setup permits HTTP URLs when the URL allowlist is disabled. The README calls this developer-friendly and gives production settings for HTTPS-only behavior, blocked private networks, and an explicit allowlist. That is important because a gateway which fetches operator-supplied or provider URLs can become an attractive route toward internal services.

Sub2API also concentrates secrets and financial state. Upstream tokens, local API keys, balances, payment callbacks, request logs, and Redis coordination all sit within one trust boundary. A competent operator should isolate the service, terminate TLS, restrict admin access, rotate credentials, back up PostgreSQL, and test restoration. None of those chores disappear because docker compose up succeeds.

Simple mode removes user management and billing for a personal deployment. Even there, production startup requires an explicit confirmation setting. That is a sensible guard because removing the dashboard workflow does not remove upstream-account risk or the need to protect the gateway key.

The provider warning decides the use case

Sub2API is technically shaped for shared access, but permission comes from each upstream provider. An official API account used within its contract is a different proposition from pooling consumer subscriptions and selling access. The repository's warning explicitly mentions account bans, interruptions, and data loss. An operator cannot transfer those risks back to the maintainers.

The sponsor section makes this tension more visible. Many listed services advertise discounted relay access, account products, or proxy infrastructure, while the project says commercial operation is unauthorized. That does not prove any sponsor violates a rule. It does mean buyers should ignore marketing adjacency and read the exact terms for every account placed behind the gateway.

A huge active queue calls for pinned upgrades

GitHub reported 2,872 open issues and PRs on August 27, 2026. The repository was pushed that day, while release v0.1.183 was published on August 25, so the project is plainly active. The count is not a defect total because GitHub combines issues and pull requests, but it is too large to treat as a tidy support queue.

Recent activity covers Codex Responses compatibility, usage aggregation, account import, and provider-specific behavior. This is the normal churn of a gateway tracking several upstream protocols, yet it creates upgrade risk. Pin a release, read changes between versions, back up state, and test the clients and providers you use before replacing a running instance.

Choose Sub2API when you have authorization, need its user and billing plane, and can operate a sensitive stateful service. For one application calling one provider, an official SDK is easier to reason about. For multi-provider applications using standard API credentials, a narrower gateway avoids the subscription-policy question entirely.

Alternatives

ProjectWhat it isPick it when
LiteLLM gh↗A multi-provider proxy focused on normal API credentials, routing, budgets, and observability.pick this instead when official provider APIs are the source of truth and subscription sharing is unnecessary.
Portkey AI GatewayAn open AI gateway for routing, fallbacks, guardrails, and provider integrations.pick this instead when application reliability and policy controls matter more than user billing and subscription pools.
One APIA Chinese-led gateway that presents many model providers through a unified API and token system.pick this instead when you want a smaller established gateway shape and its provider set matches your deployment.

What people are saying

  1. [github-trending] Wei-Shaw/sub2api

Sources

  1. Sub2API README
  2. Sub2API releases
  3. Sub2API issues and pull requests

More ai tools reviews

router · PaddleOCR · GLiNER2 · bazi-skill · transformers.js · OpenBitFun · the whole board →