# Self-host a LiteLLM AI gateway on Railway: one API for 100+ LLMs, with budgets and virtual keys

> Source: <https://dev.to/talha_ramzan_3878156fea8c/self-host-a-litellm-ai-gateway-on-railway-one-api-for-100-llms-with-budgets-and-virtual-keys-4jd3>
> Published: 2026-11-27 19:32:30+00:00

**Key takeaway:** Self-hosting LiteLLM behind one OpenAI-compatible endpoint lets you issue per-app virtual keys with budgets and spend tracking instead of copying provider keys into every app, and the template pins stable image tags and requires backing up LITELLM_SALT_KEY to keep stored provider keys decryptable.

If your apps call OpenAI, Anthropic, OpenRouter and Gemini, you end up with provider keys copied everywhere and no idea who spent what. LiteLLM fixes that: one OpenAI-compatible endpoint, virtual keys per app or team, budgets and spend tracking.

I made a one-click Railway template for it.

`latest`, `main-stable`) for a few hours. This template never uses floating tags.` admin` with `UI_PASSWORD` from the LiteLLM service variables
Back up `LITELLM_SALT_KEY`, since it encrypts the stored provider keys.

Links: template [https://railway.com/deploy/litellm-ai-gateway-1](https://railway.com/deploy/litellm-ai-gateway-1) · repo [https://github.com/TalhaRamzan/railway-litellm-gateway](https://github.com/TalhaRamzan/railway-litellm-gateway) · LiteLLM [https://github.com/BerriAI/litellm](https://github.com/BerriAI/litellm)

*Disclosure: I built this template. Unofficial, not affiliated with BerriAI.*
