Deploy VoAPI
Advanced AI API proxy and gateway for model access distribution.
voapi
Just deployed
Redis
Just deployed
/data
MySQL
Just deployed
/var/lib/mysql
Deploy and Host VoAPI on Railway
VoAPI is a high-performance AI model interface management and distribution system. Based on NewAPI, it offers an enhanced user interface, advanced rate limiting, custom payment channels, and comprehensive monitoring. It is designed for developers and teams to manage, distribute, and track usage of various AI models seamlessly.
About Hosting VoAPI
Hosting VoAPI on Railway involves deploying a resilient, multi-tier architecture consisting of the core VoAPI application container, a MySQL database for persistent records, and a Redis instance for caching and rate limiting. Railway streamlines this setup by allowing you to provision all three services within a single project environment.
Persistent data such as user accounts, API keys, channel configurations, and logs are securely stored within Railway's managed MySQL database, while Redis handles transient state like global rate limits, user daily quotas, and IP tracking. Railway automatically manages internal networking, allowing the VoAPI container to securely communicate with the databases without exposing them to the public internet. Furthermore, Railway provides instant, auto-renewing HTTPS through a generated public domain, making your AI API proxy endpoints instantly secure and ready for production use.
Common Use Cases
- Internal AI API Proxy and Management
- AI Model Access Distribution and Monetization
- Centralized usage tracking and rate-limiting for developer teams
Dependencies for VoAPI Hosting
- MySQL Database
- Redis Database
Deployment Dependencies
- Docker Image:
voapi/voapi:v1.2.0
Implementation Details
Docker
The deployment utilizes the pre-built public Docker image voapi/voapi:v1.2.0. No custom Dockerfile or build process is required.
Public Networking
| Proxy Type | Target Port |
|---|---|
| HTTP Proxy | 6800 |
Environment Variables
| Variable | Required | Description |
|---|---|---|
PORT | Yes | The port the application listens on (6800). |
SQL_DSN | Yes | Connection string for the MySQL database. |
REDIS_CONN_STRING | Yes | Connection string for the Redis database. |
SESSION_SECRET | Yes | A random, secure string for session encryption. |
TZ | No | Timezone for the application (e.g., Asia/Shanghai). |
Raw Editor format:
PORT=6800
SQL_DSN=${{MySQL.MYSQLUSER}}:${{MySQL.MYSQLPASSWORD}}@tcp(${{MySQL.MYSQLHOST}}:${{MySQL.MYSQLPORT}})/${{MySQL.MYSQLDATABASE}}
REDIS_CONN_STRING=${{Redis.REDIS_URL}}
SESSION_SECRET=YOUR_SECURE_RANDOM_STRING
TZ=Asia/Shanghai
Database Configurations
This application requires both MySQL and Redis.
- Add a MySQL database from the Railway Dashboard.
- Add a Redis database from the Railway Dashboard.
- Link the databases to the VoAPI service by utilizing Railway Reference Variables for
SQL_DSNandREDIS_CONN_STRINGas shown in the environment variables block.
Build & Start
VoAPI requires a config.yml file to be present in the root directory to properly route the database connections specified in the environment variables. Since this configuration is dynamically generated at runtime, apply the following Custom Start Command in your Railway Service Settings under Deploy:
sh -c 'printf "app:\n port: 6800\nmysql:\n dsn: ${SQL_DSN}\n log-dsn: ${SQL_DSN}\n log-body-dsn: ${SQL_DSN}\n log-sharding:\n enable: false\n mode: y\nredis:\n dsn: ${REDIS_CONN_STRING}\n pool-size: 0\n" > /config.yml && /voapi'
Note: If the container cannot find the executable, change && /voapi to && /one-api based on standard NewAPI fork behavior.
Persistent Storage
Persistent storage is entirely managed by the Railway MySQL and Redis services. The VoAPI application container itself operates statelessly and does not require a custom Railway Volume.
Accessing the Application
- Navigate to the VoAPI service in your Railway project.
- Go to Settings → Networking and click Generate Domain.
- Access the generated
up.railway.appURL in your browser. - Log in using the default administrator credentials (check upstream NewAPI documentation for default credentials, typically
root/123456). - Change the default password immediately upon your first login.
Why Deploy VoAPI on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying VoAPI on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
