Railway

Deploy New API | (Just Updated) LLM Gateway Nobody Else Can Claim

Multi-provider LLM gateway; admin seeded at boot, sessions survive redeploy

Deploy New API | (Just Updated) LLM Gateway Nobody Else Can Claim

Just deployed

/data

Just deployed

/var/lib/postgresql

/data

Deploy and Host New API on Railway

New API is an open-source LLM gateway: one OpenAI-compatible endpoint in front of many providers (OpenAI, Anthropic, Gemini, DeepSeek, Azure, and dozens more), with API-key management, per-key quotas, model routing, request logging and a full admin console. This template deploys it with the admin account already created and the session keys pinned, so nobody but you can claim the instance and nobody gets logged out by a redeploy.

About Hosting New API

This template runs New API v1.0.0-rc.25 as three services: the gateway itself on a persistent volume, PostgreSQL for accounts, keys, channels and logs, and Redis for caching and rate limiting. The admin account is seeded on the volume before the public port is ever served, and the credential is re-applied on every boot, so a redeploy doubles as a working password reset. SESSION_SECRET and CRYPTO_SECRET are generated once per deployment and published as template variables — upstream defaults both to a fresh UUID at each start, which silently invalidates every session and every stored encrypted value when the container restarts. The public service honours Railway's injected port and is healthchecked on /api/status.

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.

  • Nobody else can claim it — the setup route on a stock deploy is unauthenticated, so the first stranger to open the URL becomes root. Here the root account exists before the domain answers a single request.
  • Sessions survive a redeploy — session and crypto keys are fixed per deployment instead of regenerated at every boot.
  • Password reset by redeploy — the admin credential is re-applied each boot from the template variable, which is the only recovery path a fresh instance has.
  • Pinned and prebuilt — a fixed upstream version on an app that migrates its schema forward on boot, pulled as an image rather than rebuilt on your build minutes.

Common Use Cases

  • One key for every model — give your apps and agents a single OpenAI-compatible base URL and swap providers behind it without touching client code.
  • Team and customer key management — issue scoped keys with quotas and expiry, and read per-key usage and cost in the console.
  • Spend control and observability — route cheap traffic to cheap models, keep request logs, and cap what any one key can burn.

Dependencies for New API Hosting

  • PostgreSQL (included in this template) for accounts, channels, keys and logs.
  • Redis (included in this template) for caching and rate limiting.
  • A volume mounted at /data (included) for uploads and local state.

Deployment Dependencies

Implementation Details

Sign in at your deployment's URL as admin with the generated NEW_API_ADMIN_PASSWORD, add a provider channel, then issue a key and call it like OpenAI:

curl https:///v1/chat/completions \
  -H "Authorization: Bearer $NEW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Hello!"}]}'

To rotate the admin password, change NEW_API_ADMIN_PASSWORD and redeploy — the new value is applied to the existing root user on start. The password must be 8–20 characters; the service refuses to boot on an empty one.


Template Content

More templates in this category

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

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

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

codestorm
62