---
title: "Deploy OmniRoute Auto Model"
description: "Virtual auto model that builds a routing combo for you"
category: "AI/ML"
url: https://railway.com/deploy/deploy-omniroute-auto-model-router
---

# Deploy OmniRoute Auto Model

Virtual auto model that builds a routing combo for you

**[Deploy OmniRoute Auto Model on Railway](https://railway.com/template/deploy-omniroute-auto-model-router)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-omniroute-auto-model-router/manifest.json

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### omniroute

- **Image:** diegosouzapw/omniroute:3.8.51@sha256:8bd462c9f60d8eda79329cfbb6ea7ea723505fe7721beb944f3d43835409e218
- **Start command:** `/bin/sh -c "mkdir -p /app/data && chown -R 1000:1000 /app/data && cd /app && if command -v setpriv >/dev/null 2>&1; then exec setpriv --reuid=1000 --regid=1000 --init-groups env HOME=/home/node /app/check-permissions.sh node dev/run-standalone.mjs; else exec /app/check-permissions.sh node dev/run-standalone.mjs; fi"`
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted OmniRoute Auto Model (Open-Source AI Gateway) on Railway

OmniRoute's `auto` model builds a combo across connected providers. Clients like Claude Code, Cursor, or Cline request `auto`, and the gateway picks per request using routing strategies and quota-aware fallback. Traffic moves when a key hits quota or a provider fails.

## About Hosting OmniRoute Auto Model open-source software on Railway (self hosted OmniRoute template)

OmniRoute runs as one container serving dashboard (`/dashboard`), API (`/v1`), and health (`/healthz`) on port 20128. State is SQLite (WAL) in `/app/data`; keys are AES-256-GCM encrypted. No Postgres or Redis.

`auto` builds a combo from all eligible connected providers, excluding `tos:avoid` by default. Quota errors trigger the four-tier fallback chain. OmniRoute has 19 strategies, but `auto` uses quota-aware fallback. Circuit breakers and key cooldowns protect your budget.

## Why Deploy OmniRoute Auto Model, the OpenRouter alternative on Railway (Railway Free Trial)

OpenRouter marks up and hides upstreams. OmniRoute is MIT, self hosted, and you pay providers directly. `auto` gives similar convenience: connect 372-provider catalog with 150+ free tiers, point tools at one model name. Dashboard logs show each upstream; built-in MCP and A2A extend beyond chat.

Railway's free trial covers light use (1-2 GB). Raise memory to 8192 MB for Responses workloads (~10 GB container). Still cheaper than managed markups.

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 OmniRoute Auto Model 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.

### Railway vs Other Hosting Providers and VPS for OmniRoute Auto Model self hosting

| Provider | Fit | Notes |
|---|---|---|
| DigitalOcean | Works, but manage TLS/volume | $6 droplet for light use; scale up for memory |
| AWS | Works, but IAM/VPC overhead | Good with credits; overkill for one container |
| Hetzner | Cheap, no managed TLS | Best cost/GB; you handle updates |

## Common Use Cases for hosted OmniRoute Auto Model

**Coding agents:** Claude Code, Cursor, Cline, Copilot, OpenCode, Aider, Continue, Kilo Code use one base URL and `auto`. No reconfig on provider changes.

**Fallback:** Connect free tiers with different limits; `auto` moves to next provider on quota. Logs show events.

**Compression:** RTK and Caveman compression, which the project says saves 15-95% of tokens on eligible workloads.

**MCP server:** Exposes `/api/mcp/stream` and `/api/mcp/sse` over HTTPS. Use Railway domain + Bearer key. Stdio is local only.

**A2A:** Built-in bridge lets agents call each other with same quota/fallback.

**Analytics:** Dashboard shows per-provider usage, quota, fallback counts; each `auto` request logs upstream.

## Dependencies for OmniRoute Auto Model Docker hosted on Railway

No external services. One container runs dashboard, API, MCP, A2A. SQLite in `/app/data`; mount a Railway volume there to persist.

### Deployment Dependencies for Managed OmniRoute Auto Model Service (AI Gateway)

Template pins `diegosouzapw/omniroute:3.8.51`. Set `PORT=20128`, `HOSTNAME=0.0.0.0`, `DATA_DIR=/app/data`, `AUTH_COOKIE_SECURE=true`, `REQUIRE_API_KEY=true`, and `NEXT_PUBLIC_BASE_URL`/`BASE_URL` to your domain. Health at `/healthz`. Five secrets generated: `INITIAL_PASSWORD`, `JWT_SECRET`, `API_KEY_SECRET`, `OMNIROUTE_WS_BRIDGE_SECRET`, `MACHINE_ID_SALT`; don't reuse. Keys encrypted with AES-256-GCM via `API_KEY_SECRET`.

### Implementation Details for OmniRoute Auto Model (Using OmniRoute official docker image)

Port 20128; Railway proxies HTTPS. `/v1` serves OpenAI/Claude/Gemini/Responses; `/dashboard` UI; `/healthz` readiness. Volume holds `omniroute.db` (WAL). Don't share volume across containers. `OMNIROUTE_MEMORY_MB` default 1024 fine for dashboard/chat; use 8192 and 10 GB container for Responses API.

## How does OmniRoute Auto Model compare against other AI gateway platforms

### OmniRoute Auto Model vs 9Router

- **Auto model:** OmniRoute `auto` auto-builds combo; 9Router manual rules.
- **Free tiers:** OmniRoute excludes `tos:avoid` by default; 9Router manual filtering.
- **Observability:** OmniRoute logs per-request upstream; 9Router aggregate only.
- **Deployment:** Both single container; OmniRoute no Redis/Postgres, 9Router often needs datastore.

### OmniRoute Auto Model vs LiteLLM

- **Virtual model:** LiteLLM needs explicit router/fallbacks; OmniRoute `auto` automatic.
- **Catalog:** OmniRoute 372 providers with 150+ free; LiteLLM manual setup.
- **Compression:** OmniRoute RTK/Caveman; LiteLLM none.
- **MCP:** OmniRoute built-in HTTP MCP; LiteLLM none.

### OmniRoute Auto Model vs OpenRouter

- **Pricing:** OmniRoute free, you pay providers; OpenRouter markup.
- **Transparency:** OmniRoute shows upstream; OpenRouter hides.
- **Auto model:** OpenRouter picks from aggregated pool; OmniRoute only your providers.
- **Self hosting:** OmniRoute on Railway; OpenRouter managed, not self host.

### OmniRoute Auto Model vs CLIProxyAPI

- **Scope:** CLIProxyAPI lightweight proxy; OmniRoute full gateway with dashboard/MCP/A2A.
- **Auto model:** CLIProxyAPI per-tool rules; OmniRoute one model.
- **State:** CLIProxyAPI stateless; OmniRoute SQLite persistence.
- **Compression/fallback:** CLIProxyAPI lacks RTK/Caveman; OmniRoute has both plus circuit breakers.

## How to use OmniRoute Auto Model (the OSS AI gateway)?

Deploy template, open `/dashboard`, log in with `INITIAL_PASSWORD`, verify `/healthz`. Add provider keys; they're encrypted in SQLite.

Set client base URL: Claude Code uses `ANTHROPIC_BASE_URL`; Cursor/Cline use OpenAI-compatible URL. Point to `https://your-domain/v1`, model `auto`, Bearer key.

Watch logs: each `auto` request shows routing, quota failures, final upstream. Disable providers from auto pool without deleting keys.

Test fallback: set tiny quota, send `auto` request, confirm next provider. Four-tier fallback plus circuit breakers avoids retries.

For MCP, use `https://your-domain/api/mcp/stream` or `/api/mcp/sse` with Bearer key. `omniroute --mcp` is local only.

## How to self host OmniRoute Auto Model on other VPS Services (OmniRoute Auto Model self hosting guide)

### Clone the Repository

Clone repo; official image `diegosouzapw/omniroute:3.8.51` or build source. Includes docker-compose and env example.

### Install Dependencies

Node 20+ and npm for manual install; Docker needs nothing. Image bundles dashboard, API, MCP, A2A. Run `npm install`.

### Configure Environment Variables

`.env` with `PORT=20128`, `HOSTNAME=0.0.0.0`, `DATA_DIR=/app/data`, `NEXT_PUBLIC_BASE_URL`/`BASE_URL`, `AUTH_COOKIE_SECURE=true`, `REQUIRE_API_KEY=true`. Generate five secrets. Set `OMNIROUTE_MEMORY_MB` (1024 light, 8192 Responses).

### Start the OmniRoute Auto Model Application

Run: `docker run -p 20128:20128 -v omniroute-data:/app/data --env-file .env diegosouzapw/omniroute:3.8.51`. Check `/healthz`, add keys via `/dashboard`. Use Caddy/Nginx for TLS.

## Official Pricing of OmniRoute Auto Model (OmniRoute Auto Model pricing)

OmniRoute is free, MIT. No hosted tier; you pay providers only. Free tiers stay free on your accounts; no markup. Self hosting cost: light use 1-2 GB ($5-15/mo on Railway); Responses traffic 8 GB heap/10 GB container (more). No gateway fees.

## OmniRoute Auto Model cloud vs self hosted comparison (Pricing, features, costs, and more)

### Monthly cost of self hosting OmniRoute Auto Model on Railway

Railway trial covers $5. 1-2 GB: $5-15/mo. 10 GB (8192 MB): $20-40/mo. Add provider usage.

### System Requirements for Hosting OmniRoute Auto Model on a VPS

Min: 1 vCPU, 1 GB RAM, 10 GB disk. Recommended for Responses: 2-4 vCPU, 8-10 GB RAM, 20 GB SSD. Use local NVMe/SSD for `/app/data`; avoid network filesystems.

## Frequently Asked Questions (FAQs)

### How do I authenticate MCP clients against my Railway OmniRoute URL?

Use HTTPS domain + Bearer key from dashboard. Stream endpoint `/api/mcp/stream`, SSE `/api/mcp/sse`. Send `Authorization: Bearer KEY`. Stdio local only.

### How much memory do I need for the Responses API and coding agents?

Default 1024 fine for dashboard/chat. For `/v1/responses`, set `OMNIROUTE_MEMORY_MB=8192` and 10 GB container. Raise if OOM.

### Are the 150 plus free provider tiers really free when I use OmniRoute Auto Model?

Yes, free with your accounts. OmniRoute no charge. `tos:avoid` excluded from `auto` by default; can use in manual combo if you accept terms.

### Can OmniRoute Auto Model surprise me with unexpected provider costs?

Yes, `auto` includes paid providers. Disable providers you don't want. Also capability differences: `auto` may pick model without tools/vision.

### Does OmniRoute Auto Model work with Cline, Cursor, and Claude Code without changing model names?

Yes, set base URL `/v1` and model `auto`. One model name across tools; no changes on provider changes.

### How do I see which upstream provider served an `auto` request?

Dashboard logs/usage show upstream provider and model per request, plus fallback events.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.
Keep the volume attached; it holds all state.


## 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/deploy-omniroute-auto-model-router
