Deploy New API
LLM gateway: one OpenAI-compatible API and keys for many AI providers
Just deployed
/data
Redis
Just deployed
/data
Just deployed
/var/lib/postgresql/data
Deploy and Host New API on Railway
New API is an open-source LLM gateway and key manager. It puts OpenAI, Claude, Gemini, DeepSeek, Azure and dozens of other providers behind one OpenAI-compatible endpoint. You issue your own API keys with quotas, route requests across channels, and track usage and cost per key, user and model in a web dashboard.
About Hosting New API
New API is a single Go service with a web dashboard. It stores users, keys, channels and logs in a SQL database, and uses Redis for caching and rate limits. This template runs the official calciumion/new-api image pinned by digest, with Railway Postgres and Redis on the private network and a volume for the app's data and logs. On first start it creates your admin account from template variables before the public port opens, so nobody can claim the setup page, and it turns off public sign-up. You add provider keys as channels in the dashboard after deploying.
Common Use Cases
- Give a team or app one OpenAI-compatible endpoint for many model providers
- Hand out API keys with quotas, model limits and expiry, and track spend per key
- Fail over or load-balance between several provider keys and channels
Dependencies for New API Hosting
- PostgreSQL (Railway Postgres) for users, keys, channels and logs
- Redis (Railway Redis) for caching and rate limiting
Deployment Dependencies
- New API source and docs: https://github.com/QuantumNous/new-api
- Release used by this template (v1.0.0-rc.49): https://github.com/QuantumNous/new-api/releases/tag/v1.0.0-rc.49
- Docker image: https://hub.docker.com/r/calciumion/new-api
- Start script used by this template: https://github.com/aalfath/new-api-railway-template
Implementation Details
Sign in: open the service's public URL and log in as admin (or the ADMIN_USERNAME you set). The password is the ADMIN_PASSWORD variable on the new-api service. You can change it later in your account settings. The variable is only read on the first start.
Add a provider: open the Channels page in the admin console, add a channel and paste your own provider key. New channels are picked up for routing within about 60 seconds. Then create a key under API Keys and call the gateway like OpenAI:
curl https://YOUR-DOMAIN.up.railway.app/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR-NEW-API-KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'
Defaults set by the template: self-use mode is on, so models without a configured price still work. To start with it off instead, set NEW_API_SELF_USE_MODE=false before the first deploy. Public sign-up is off, and you can turn it back on in the admin system settings. SESSION_SECRET and CRYPTO_SECRET are generated. Keep them unchanged: they sign sessions and internal data, so changing them later signs everyone out.
Version: upstream has published only v1.0.0 release candidates since v0.13.2 (April 2026), and its latest image points to them. This template pins v1.0.0-rc.49 by digest. To upgrade, change the image tag on the new-api service.
Why Deploy New API 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 New API 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

