2026 Guide to the Leading AI API Gateways and How to Use Them
This article compares four popular open‑source AI API gateway projects—One API, New API, Sub2API, and LiteLLM—detailing their stars, licenses, tech stacks, core strengths, ideal scenarios, shortfalls, and provides step‑by‑step deployment and usage instructions with security and compliance tips.
Overview of 2026 AI API Gateways
Four open‑source LLM gateway projects are compared: One API, New API, Sub2API, LiteLLM.
One API
Project address: songquanpeng/one-api Stars: 35k+
License: MIT
Tech stack: Go
Core positioning: Classic lightweight LLM unified gateway
Best scenario: Personal use, small teams, stability and simplicity
Key advantages
Mature and stable: Started in 2023, validated in many production environments; low failure probability.
Strong Chinese ecosystem: Full Chinese documentation and earliest support for domestic models.
Lightweight deployment: Single binary or Docker one‑click, supports SQLite; can be up and running in about 5 minutes with low resource usage.
Complete basic features: Multi‑channel load balancing, token management, user grouping, quota control, redemption codes.
Permissive MIT license: Commercial use and downstream development virtually unrestricted.
Rich community and forks: Numerous derivative projects (one‑hub, done‑hub, etc.) provide many extension choices.
Main drawbacks: Classic simple UI; limited native support for Claude/Gemini formats; weak format conversion; lacks online payment and cache‑based billing.
Recommendation: Ideal for quickly setting up a functional gateway when large‑scale commercial billing is not required.
New API
Project address: QuantumNous/new-api Stars: 45k+
License: AGPLv3
Tech stack: Go
Core positioning: Feature‑enhanced version / commercial‑grade backend
Best scenario: External services, need for full billing and multi‑protocol conversion
Key advantages
Modern UI + multilingual: New interface, dark mode, supports Chinese, English, Japanese, French; better user experience than the original.
Advanced protocol conversion: OpenAI ↔ Claude messages, OpenAI → Gemini, Gemini → OpenAI; enables direct calls using official Claude/Gemini SDKs or reverse OpenAI‑style calls.
New API support: OpenAI Responses, Realtime, Rerank, Midjourney, Suno, etc.; supports real‑time voice, image, music, re‑ranking scenarios.
Complete billing system: Pay‑per‑request, pay‑per‑call, cache billing, online recharge via Stripe, EasyPay, etc.; ready for commercial operations.
Data compatibility: Direct migration from One API database; near‑zero migration pain.
Operations & monitoring: Data dashboard, weighted channel randomization, retry on failure, user‑level rate limiting; better for multi‑user/channel management.
Active development: High‑frequency releases continue through 2026; fast adoption of new models and protocols.
Main drawbacks: AGPLv3 license requires careful evaluation for closed‑source commercial products; richer feature set makes it heavier for pure personal use.
Recommendation: Choose New API when offering external paid services, needing native Claude/Gemini support, or requiring a robust management backend.
Sub2API
Project address: Wei-Shaw/sub2api Stars: 37k+
License: LGPL
Tech stack: Go + Vue
Core positioning: Subscription‑account‑to‑API conversion / car‑pool distribution
Best scenario: Users holding Claude, ChatGPT, Gemini, Grok, Antigravity subscription accounts
Key advantages
Subscription to API: Supports OAuth/subscription accounts for Claude Pro, ChatGPT Plus, Gemini, Grok, Antigravity, turning web subscriptions into standard API endpoints.
Smart scheduling + sticky sessions: Account pool polling, automatic throttling removal, session stickiness; long conversations or agent tasks retain context across account switches.
Car‑pool billing friendliness: Token‑level precise billing with built‑in payment (Alipay, WeChat, Stripe); clear cost sharing for shared subscriptions.
Fine‑grained concurrency & rate limiting: Dual‑layer limits at user and account level; protects upstream accounts from rate‑limit bans.
Unified multi‑account management: Central view of health, quota, and authorization; no need to log into each web portal.
Native tool compatibility: Works with Claude Code, Codex, Cursor, etc.; just change the base URL to use.
Main drawbacks: Relies on subscription accounts rather than official API keys; may conflict with upstream service terms; deployment requires PostgreSQL + Redis, making it slightly heavier.
Recommendation: The only mature open‑source choice when you have subscription accounts and want team sharing or lightweight external services.
LiteLLM
Project address: BerriAI/litellm Stars: 50k+
License: MIT
Tech stack: Python
Core positioning: International mainstream LLM gateway + SDK
Best scenario: Development teams using Python, needing deep integration with many vendors, or requiring strong enterprise governance
Key advantages
Broad vendor coverage: Official support for over 100 providers; the most complete international model ecosystem.
SDK + proxy dual mode: Can be imported as a library or deployed as a proxy; extremely flexible for developers.
Strong enterprise governance: Virtual keys, budget control, rate limiting, guardrails, observability; suitable for production and compliance requirements.
Routing & disaster recovery: Fallback, load balancing, cost/latency‑aware routing; performs well in high‑availability scenarios.
Permissive MIT license & active community: Global contributors ensure long‑term maintenance.
Python‑friendly ecosystem: Deep integration with LangChain, LlamaIndex, etc.; makes building agents or RAG applications smoother.
Main drawbacks: Documentation and domestic model support are weaker than One API; management UI less intuitive; configuration leans toward YAML/code, less friendly for non‑developers.
Recommendation: Best for Python‑centric teams that need extensive vendor integration and strong governance.
Quick decision matrix
Personal / small team, need simplicity: One API – fastest deployment, most docs, MIT license.
Want to charge externally, need polished UI and full billing: New API – most features, strongest payment & protocol conversion.
Holding Claude / ChatGPT subscription accounts: Sub2API – built for subscription‑to‑API and cost‑sharing.
Python team, many international vendors, enterprise governance: LiteLLM – broad coverage, flexible SDK, strong observability.
Upgrading from One API data: New API – compatible database, low migration cost.
Only need a lightweight reverse proxy: Use Nginx / Caddy + simple script.
Supplementary notes
License considerations: One API and LiteLLM are MIT (commercial use safe); New API is AGPLv3—closed‑source commercial products need extra evaluation.
Deployment advice: All projects support Docker; production should place Nginx/Caddy in front for HTTPS; prefer Hong Kong or overseas nodes for better latency.
Security reminder: Safeguard upstream keys / subscription credentials; enforce rate limiting and audit logs to avoid abuse and unexpected bills.
Compliance tip: When using subscription accounts for relay, verify compliance with upstream service terms.
How to use (example with Claude Code)
Step 1: Install Node.js (required, version 18+)
macOS (recommended):
Open terminal.
Run: brew install node Verify: node --version (output should be v18 or higher).
Step 2: Install Claude Code CLI
npm install -g @anthropic-ai/claude-codeStep 3: Configure API (critical)
Edit ~/.claude/settings.json (create if missing):
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-api-key",
"ANTHROPIC_BASE_URL": "https://code.ai80.vip"
}
}Replace your-api-key with the real key obtained from the Code80 platform.
Step 4: Start using
cd your-project
claudeThe first run will guide you through theme selection, security notice, terminal configuration, and trusting the working directory.
Other tools (quick switch on the site)
Similar step‑by‑step guides are available for Codex CLI, Gemini CLI, and Grok Build, all pointing the Base URL to https://code.ai80.vip.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Top Architecture Tech Stack
Sharing Java and Python tech insights, with occasional practical development tool tips.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
