Railway

Deploy VoAPI

Advanced AI API proxy and gateway for model access distribution.

Deploy VoAPI

Just deployed

Just deployed

/data

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 TypeTarget Port
HTTP Proxy6800

Environment Variables

VariableRequiredDescription
PORTYesThe port the application listens on (6800).
SQL_DSNYesConnection string for the MySQL database.
REDIS_CONN_STRINGYesConnection string for the Redis database.
SESSION_SECRETYesA random, secure string for session encryption.
TZNoTimezone 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.

  1. Add a MySQL database from the Railway Dashboard.
  2. Add a Redis database from the Railway Dashboard.
  3. Link the databases to the VoAPI service by utilizing Railway Reference Variables for SQL_DSN and REDIS_CONN_STRING as 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

  1. Navigate to the VoAPI service in your Railway project.
  2. Go to Settings → Networking and click Generate Domain.
  3. Access the generated up.railway.app URL in your browser.
  4. Log in using the default administrator credentials (check upstream NewAPI documentation for default credentials, typically root / 123456).
  5. 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

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
113
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
1
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
56