---
title: "Deploy New API"
description: "OpenAI-compatible API gateway for multiple LLM providers"
category: "AI/ML"
url: https://railway.com/deploy/new-api
---

# Deploy New API

OpenAI-compatible API gateway for multiple LLM providers

**[Deploy New API on Railway](https://railway.com/template/new-api)**

- **Creator:** railbi
- **Category:** AI/ML
- **Total deploys:** 70

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### New API Frontend https://www.newapi.ai/assets/newapi.svg

- **Image:** calciumion/new-api:latest
- **Public domain:** Yes

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

## Documentation

# Deploy and Host New API on Railway

New API is an open-source AI gateway that fronts multiple model providers with one OpenAI-compatible API. It handles routing, tokens, quotas, and provider aggregation.

## About Hosting New API

This template runs `calciumion/new-api:latest` on port 8080, plus Postgres 18 and Redis 8.2.1 on Railway's private network. The app takes `SQL_DSN` from Postgres and `REDIS_CONN_STRING` from Redis. Postgres and Redis keep data on volumes. Timezone defaults to `Asia/Shanghai`.

## Common Use Cases

- One endpoint for multiple AI providers
- Team tokens, quotas, and model access
- A self-hosted API proxy or access layer

## Dependencies for New API Hosting

- `calciumion/new-api:latest`
- `ghcr.io/railwayapp-templates/postgres-ssl:18`
- `redis:8.2.1`
- Persistent volumes for Postgres and Redis

### Deployment Dependencies

- [New API GitHub repository](https://github.com/QuantumNous/new-api)
- [New API documentation](https://docs.newapi.ai/en/)
- [Railway volumes](https://docs.railway.com/volumes)

## 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.

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/new-api
