Deploy otari
OpenAI-compatible LLM gateway with Postgres-backed budgets and usage.
Just deployed
/var/lib/postgresql/data
otari
Just deployed
otari-files
Bucket
Just deployed
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 |
Template Content
PGDATA
PGPORT
POSTGRES_DB
POSTGRES_USER
SSL_CERT_DAYS
RAILWAY_DEPLOYMENT_DRAINING_SECONDS
otari
mzdotai/otari:0.27.0PORT
OTARI_FILES_BACKEND
OTARI_DEFAULT_PRICING
OTARI_REQUIRE_PRICING
OTARI_FORWARDED_ALLOW_IPS
otari-files
Bucket
