DEV Community

aitoken-hub
aitoken-hub

Posted on

Deploy New API Open-Source LLM Gateway on Cloud Servers: A Complete Guide

1. What is New API?

New API, developed by QuantumNous, is an open-source next-generation Large Language Model (LLM) gateway and AI asset management system. It has rapidly gained massive traction in the developer community, boasting over 42k stars on GitHub and is released under the AGPL-3.0 license.

At its core, New API aggregates mainstream models from top-tier providers like OpenAI, Claude, Gemini, DeepSeek, Tongyi Qwen, Midjourney, and Suno. It provides a unified, OpenAI-compatible interface, meaning you can switch between different AI models with a simple API key change without rewriting your application code. Furthermore, it comes packed with enterprise-grade features: built-in multi-channel grouping, weighted random distribution, automatic failure retry, and comprehensive user, token, and quota management with online recharge capabilities. It truly transforms how we interact with fragmented AI services.

2. Why Self-Host a Unified LLM Gateway?

As an indie developer, a startup founder, or a DevOps engineer, managing multiple API keys across different AI providers can quickly become a nightmare. Self-hosting New API solves this by acting as a centralized, intelligent proxy.

For developers, it drastically simplifies integration. You only need to code against one OpenAI-compatible endpoint. For teams and startups, it offers centralized billing and quota management. You can allocate specific quotas to different team members, departments, or client projects, preventing runaway costs and ensuring fair usage. From a DevOps perspective, having a unified gateway means you can implement centralized logging, monitoring, and rate limiting. You can track token usage across your entire organization, set up alerts for unusual spikes, and enforce strict rate limits to protect your backend budgets.

Additionally, the automatic retry and weighted distribution features ensure high availability. If one provider's API goes down, experiences high latency, or hits a rate limit, New API seamlessly routes the request to another healthy channel, ensuring your application remains responsive.

3. Server Requirements & Config Guide

To run New API smoothly, your cloud server needs adequate resources. For testing and light personal use, a 2 vCPU and 2GB RAM configuration is sufficient. However, for production environments with multiple users, concurrent requests, and heavy logging, I highly recommend a 2 vCPU and 4GB RAM setup to ensure stability.

Here is a quick comparison of recommended configurations:

Use Case vCPU RAM Storage Network Recommended For
Testing / Personal 2 2GB 40GB+ 200M Peak Indie devs, AI hobbyists
Production / Team 2 4GB 40GB+ 3M - 5M Startups, small dev teams

September 2026 Cloud Pricing Hooks

If you are looking to grab a deal, both major cloud providers have excellent promotions right now.

Alibaba Cloud:

  • Lightweight Application Server (2 vCPU, 2GB, 40G ESSD, 200M peak): $5.30/year (Flash sales daily at 10:00/15:00).
  • ECS Economy e (2 vCPU, 2GB, 3M bandwidth): $13.80/year (Renew at the same price locked until 2029).
  • ECS u1 (2 vCPU, 4GB, 5M bandwidth): $27.80/year. (All prices subject to official promotion pages)

Tencent Cloud:

  • Lightweight Application Server for new users: $5.30/year and up. Includes buy 1 year get 3 months and same-price renewal.
  • 2 vCPU, 2GB, 4M bandwidth: $13.80/year.
  • 2 vCPU, 4GB, 5M bandwidth: $26.20. (Note: The Tencent Cloud procurement season event ends on October 12, 2026. All prices subject to official promotion pages)

4. 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. It is the primary recommended path for deploying New API to the cloud in just a few minutes, requiring zero command-line knowledge.

First, you can grab a server from the official deal page here: https://www.aliyun.com/minisite/goods?userCode=tzlh4rrj

Once you have your account set up, navigate to the Alibaba Cloud Compute Nest console. Simply search for New API in the search bar. You will find the official deployment template. Click on it, and follow the on-screen instructions in Compute Nest. The system will automatically provision the server, configure the underlying environment, and deploy the New API container for you. It is incredibly straightforward. Just remember to save the initial admin credentials and endpoint URLs provided at the end of the deployment process.

5. Docker Universal Deployment

If you prefer more granular control over your infrastructure or are using a different cloud provider like Tencent Cloud, the alternative path is a universal Docker deployment. You can grab a Tencent Cloud server here: https://cloud.tencent.com/act/cps/redirect?redirect=1003&cps_key=U4Wwh5F3y1uS8pJz

First, SSH into your lightweight application server. You need to install the Docker environment. Depending on your OS (Ubuntu, CentOS, or Debian), you can use the official Docker installation scripts or your native package manager.

Once Docker is installed and running, you can deploy New API using the docker run command. You will need to pull the official New API image and run it. Make sure to map the necessary ports and configure the environment variables according to the official New API documentation. It is also highly recommended to use Docker Compose instead of a raw docker run command for production. This allows you to define your environment variables, port mappings, and volume configurations in a single YAML file, making your deployment reproducible and easy to manage.

While Compute Nest handles this automatically, the Docker route gives you the flexibility to customize your volume mounts for data persistence and network settings. Just ensure your server's security group or firewall allows inbound traffic on the port you expose for the web interface and the API endpoint.

6. Common Questions & Troubleshooting

Q: I deployed it, but I can't access the web interface.
A: This is almost always a firewall or security group issue. Ensure that the port you configured for New API is opened in your cloud provider's security group rules. Also, check if the Docker container is actually running by executing docker ps on your server.

Q: How do I ensure my data is not lost when updating?
A: If you used Docker, you must map a local directory to the container's data directory using the -v flag. This ensures your database and configuration files persist across container restarts or updates. If you used Compute Nest, follow the on-screen instructions in Compute Nest for the upgrade process, as it manages stateful data automatically.

Q: Can I use this for commercial API resale?
A: New API has built-in quota and user management, which is great for internal team allocation or authorized client access. However, please ensure your usage aligns with the terms of service of the underlying AI model providers.

7. Cost-Saving Tips

When setting up your infrastructure, optimizing costs is crucial for long-term sustainability. If you are just starting out or testing the waters, grab the $5.30/year lightweight server from either Alibaba or Tencent Cloud. It is more than enough to run a test instance of New API and experiment with the routing features.

For production, look at the annual plans with renewal locks. For instance, the Alibaba Cloud ECS e instance at $13.80/year guarantees the same renewal price until 2029, protecting you from future price hikes. Always check if you qualify for new user discounts, as these offer the steepest savings. Another great strategy is to separate your testing and production environments. Use the cheapest possible instance for development and testing, and only scale up to the 2 vCPU, 4GB RAM tier when you are ready to go live. This prevents you from paying for idle production resources during the development phase.

Also, consider your bandwidth needs; if your API traffic is mostly text-based, a 3M or 4M bandwidth plan is sufficient, saving you money compared to higher tiers.

8. Official Deal Links

To make your life easier, here are the direct links to the current promotions discussed in this guide. Bookmark them for your future infrastructure upgrades.

Alibaba Cloud September 2026 Promotions:
https://www.aliyun.com/minisite/goods?userCode=tzlh4rrj

Tencent Cloud Procurement Season (Ends Oct 12, 2026):
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)