---
title: "Deploy otari"
description: "OpenAI-compatible LLM gateway with Postgres-backed budgets and usage."
category: "AI/ML"
url: https://railway.com/deploy/otari-1
---

# Deploy otari

OpenAI-compatible LLM gateway with Postgres-backed budgets and usage.

**[Deploy otari on Railway](https://railway.com/template/otari-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/otari-1/manifest.json

- **Creator:** kmaki's Projects
- **Category:** AI/ML

## Template content

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

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

### otari

- **Image:** mzdotai/otari:0.27.0
- **Health check:** /api/v1/health/readiness
- **Public domain:** Yes

## Buckets

- **otari-files**

## Documentation

# Deploy and Host Otari on Railway

Otari is an open-source, OpenAI-compatible LLM gateway for teams that need one secure endpoint across OpenAI, Anthropic, Mistral, Gemini, and other providers. It issues virtual API keys, applies budgets, records usage and cost, and serves a browser dashboard. Railway supplies managed Postgres and durable object storage for a ready-to-use deployment.

## About Hosting Otari on Railway

This template runs the pinned Otari Docker image with a managed PostgreSQL service and an S3-compatible Railway bucket. The gateway listens on port 8000, runs database migrations on startup, and exposes a public HTTPS domain. Postgres stores keys, users, budgets, and usage; the bucket persists uploaded file bytes across redeploys and replicas.

## Tech Stack

- Otari 0.27.0 Docker image (`mzdotai/otari:0.27.0`)
- Python 3.14 and Uvicorn
- OpenAI-compatible Chat Completions, Responses, and Anthropic Messages APIs
- React browser dashboard served by Otari
- PostgreSQL 18 with a Railway-managed volume
- Railway S3-compatible object storage for uploaded files

## Why Deploy Otari on Railway

Railway provisions the gateway, database, public networking, persistent database storage, and object storage in one deployable template. Secrets are generated automatically, the image is pinned to a release, and the readiness check confirms database connectivity before the service is considered healthy. Scale the gateway independently while keeping state in managed dependencies.

## Common Use Cases

- Give a team one OpenAI-compatible endpoint in front of several providers.
- Issue and revoke virtual API keys without sharing provider credentials.
- Enforce per-key or per-user budgets and track token usage and cost.
- Provide a browser dashboard for provider, model, pricing, and key management.
- Persist files used by the Files API without relying on container-local disk.

## Deployment Notes

The gateway is an HTTP service on port 8000 with readiness healthcheck `/api/v1/health/readiness`; its public domain targets that port and `PORT=8000` is set for Railway health probing. No start command override is needed because the image's `otari serve` entrypoint is used. `OTARI_DATABASE_URL` references Postgres, while the S3 variables reference the `otari-files` bucket. `OTARI_MASTER_KEY`, `OTARI_SECRET_KEY`, and `OTARI_PROVIDER_ACCOUNT_PEPPER` are generated secrets. There is no built-in username/password login: use the generated master key from the Otari service Variables tab, then add a provider in the dashboard. The first-use API key is printed once in first-start logs; save it immediately.

## Dependencies for Otari on Railway

The Otari gateway depends on the managed Postgres service for durable application state and the `otari-files` Railway bucket for uploaded bytes. Add at least one provider API key after deployment through the dashboard or `OTARI_CONFIG_YAML`; provider credentials are not included in the template.

### Deployment Dependencies

| Service | Image | Port | Volume |
|---------|-------|------|--------|
| otari | mzdotai/otari:0.27.0 | 8000 | - |
| Postgres | ghcr.io/railwayapp-templates/postgres-ssl:18 | 5432 | /var/lib/postgresql/data |
| otari-files | Railway S3-compatible bucket | - | durable object storage |


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.

Open this page in a browser: https://railway.com/deploy/otari-1
