What is New API?
If you are building AI applications today, managing multiple API keys and billing across different providers is a complete nightmare. Enter New API, the next-generation large language model (LLM) gateway and AI asset management system open-sourced by QuantumNous. Boasting an impressive 42k+ Stars on GitHub under the AGPL-3.0 license, it has rapidly become the go-to solution for developers worldwide.
New API aggregates mainstream models including OpenAI, Claude, Gemini, DeepSeek, Tongyi Qwen, Midjourney, and Suno. It provides a unified OpenAI-compatible interface, meaning you only need to change the base URL in your code to switch between any model seamlessly. Furthermore, it features built-in multi-channel grouping, weighted random distribution, and automatic failure retry. For teams, it offers complete user, token, and quota management, along with robust online recharge capabilities.
Why Self-Host a Unified LLM Gateway?
As an indie developer or startup founder, why should you self-host an LLM gateway instead of just using official SDKs directly?
First, centralized management. You can pool all your API keys into one dashboard. If one provider goes down or hits a rate limit, the gateway's weighted random distribution and automatic failure retry mechanisms will seamlessly route your traffic to another channel.
Second, cost control and quota management. You can allocate specific quotas to different team members, departments, or projects. This prevents runaway bills and allows you to track exactly who is consuming what. The built-in online recharge capability is especially useful for startup founders who want to set up an internal billing system for their AI tools.
Third, security and privacy. By routing all requests through your own server, you can implement custom logging, rate limiting, and content filtering without relying on third-party proxies.
Important Compliance Note: New API is designed for internal team management, personal use, and legitimate development. Do not use it for unauthorized API reselling, bypassing real-name authentication requirements, or any other违规 (non-compliant) activities.
Whether you are a DevOps engineer building internal tools or an AI hobbyist experimenting with multiple models, self-hosting New API gives you absolute control over your AI infrastructure.
Server Requirements & Config Guide
Before we dive into deployment, let's talk about the hardware. To run New API smoothly, you need a cloud server. For testing and personal use, a 2-core CPU and 2GB RAM (2C2G) setup is sufficient. For production environments with multiple users and heavier workloads, I highly recommend a 2C4G configuration.
Here is a quick comparison of server configurations and the latest September 2026 pricing hooks from major cloud providers:
| Provider | Configuration | Specs | Price (Sept 2026) | Best For |
|---|---|---|---|---|
| Alibaba Cloud | Lightweight | 2C2G, 40G ESSD, 200M peak | 38 RMB/year (~$5.30) | Testing, personal projects |
| Alibaba Cloud | ECS Economy e | 2C2G, 3M bandwidth | 99 RMB/year | Small production, stable use |
| Alibaba Cloud | ECS u1 | 2C4G, 5M bandwidth | 199 RMB/year | Production, team usage |
| Tencent Cloud | Lightweight | 2C2G, 4M bandwidth | 99 RMB/year | Small production, stable use |
| Tencent Cloud | CVM/Lightweight | 2C4G, 5M bandwidth | 188 RMB/year | Production, team usage |
Note on Alibaba Cloud Pricing: The 38 RMB/year (~$5.30/year) lightweight deal is a flash sale available daily at 10:00 and 15:00 (prices subject to official promotion pages). The 99 RMB/year ECS Economy e plan includes a locked renewal price until 2029 (prices subject to official promotion pages). The u1 2C4G 5M instance is priced at 199 RMB/year (prices subject to official promotion pages).
Note on Tencent Cloud Pricing: Their procurement season offers lightweight new user plans starting at 38 RMB/year, plus a "buy 1 year get 3 months free" deal with same-price renewals (prices subject to official promotion pages). The 2C2G 4M plan is 99 RMB/year and the 2C4G 5M plan is 188 RMB (prices subject to official promotion pages). This procurement event officially ends on October 12, 2026.
One-Click Deployment via Alibaba Cloud Compute Nest
If you want the fastest and most hassle-free deployment, I highly recommend using Alibaba Cloud Compute Nest. This is the primary path I suggest for most developers who want to get up and running in minutes.
- Log in to your Alibaba Cloud console and navigate to Compute Nest.
- In the search bar, type "New API".
- Select the official New API service card and click Deploy.
- Choose your server specifications (e.g., the 2C4G u1 instance for production) and your preferred region.
- Follow the on-screen instructions in Compute Nest to set up your admin password, network configurations, and resource limits.
The entire process takes just a few minutes. Compute Nest automatically handles the environment setup, Docker installation, and container orchestration behind the scenes. If you are unsure about specific network or security group settings, just follow the on-screen instructions in Compute Nest, as they provide a guided wizard tailored specifically for this application.
Docker Universal Deployment
If you prefer a cloud-agnostic approach or are using Tencent Cloud, the alternative path is manual Docker deployment. This is perfect if you already have experience with Linux and containerization.
First, provision your lightweight application server or ECS. Once your server is ready, SSH into it and install Docker. For Ubuntu/Debian, you can run:
curl -fsSL https://get.docker.com | sh
systemctl start docker
systemctl enable docker
Next, pull and run the New API container. Here is the basic command:
docker run -d --restart always \
--name new-api \
-p 3000:3000 \
-e TZ=Asia/Shanghai \
-v /home/ubuntu/data/new-api:/data \
justsong/new-api
This command maps port 3000, sets the timezone, and mounts a local volume for data persistence. After running this, you can access the New API dashboard via http://your-server-ip:3000. Remember to configure your cloud provider's firewall or security group to allow inbound traffic on port 3000. For production, I always recommend setting up an Nginx reverse proxy with Let's Encrypt to enable HTTPS.
Common Questions & Troubleshooting
Q: I forgot my initial admin password. How do I reset it?
A: If you deployed via Compute Nest, check the deployment outputs in the Compute Nest console. If you used Docker, you can set the initial root password using environment variables, or simply delete the /data volume to reinitialize (warning: this deletes all existing data).
Q: The container keeps restarting. What should I do?
A: Check the logs using docker logs new-api. It is usually caused by insufficient memory. If you are on a 2C2G instance, ensure no other heavy services are running. Upgrade to a 2C4G instance if the issue persists.
Q: How do I connect an external database instead of the built-in SQLite?
A: You can pass the SQL_DSN environment variable in your Docker run command to connect to a MySQL or PostgreSQL database. This is highly recommended for production environments to ensure data reliability and better performance under load.
Cost-Saving Tips
Deploying your own gateway doesn't have to be expensive. Here are a few strategies I use to keep costs low:
- Leverage New-User Discounts: Both Alibaba Cloud and Tencent Cloud offer massive discounts for new users. The 38 RMB/year (~$5.30) lightweight servers are perfect for testing New API without breaking the bank.
- Lock in Renewal Prices: If you plan to run this for a long time, opt for plans like the Alibaba Cloud ECS Economy e at 99 RMB/year, which locks the renewal price until 2029. This protects you from future price hikes.
- Right-Size Your Instance: Don't overprovision. Start with a 2C2G instance. If your daily API calls exceed a few thousand, then upgrade to 2C4G. New API is highly optimized and doesn't consume massive resources unless you have thousands of concurrent users.
- Utilize Free Tiers and Credits: Check your cloud provider's dashboard for free trial credits that can be applied to your first few months of deployment.
Official Deal Links
Ready to get started? Grab your cloud server today using the official promotion entry links below. Remember to act fast, as some of these procurement season deals expire soon!
Alibaba Cloud Official Promotion Page:
https://www.aliyun.com/minisite/goods?userCode=tzlh4rrj
Tencent Cloud Official Promotion Page:
https://cloud.tencent.com/act/cps/redirect?redirect=1003&cps_key=U4Wwh5F3y1uS8pJz
Please comply with model service provider terms and local laws and regulations.
Top comments (0)