---
title: "Deploy OmniRoute Free Models"
description: "Route coding tools across free provider tiers"
category: "AI/ML"
url: https://railway.com/deploy/deploy-omniroute-free-ai-models
---

# Deploy OmniRoute Free Models

Route coding tools across free provider tiers

**[Deploy OmniRoute Free Models on Railway](https://railway.com/template/deploy-omniroute-free-ai-models)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-omniroute-free-ai-models/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 Free Models (Open-Source AI Gateway) on Railway

OmniRoute Free Models is a self-hosted AI gateway for MCP users who want coding tools to use free provider tiers. Route Claude Code, Codex, Cursor, Cline, Copilot, OpenCode, Aider, Continue, and Kilo Code through one endpoint with fallback, quota awareness, and a built-in MCP server.

A practical free-models setup: put your paid subscription or key first in a combo, then two or three free-tier providers behind it. When the paid tier hits its quota, OmniRoute falls through to the free ones instead of failing the request, and the dashboard shows which tier served each call. Check the usage view weekly, because free tiers change limits and drop models without notice. Never send secrets or customer data through a free tier that logs prompts.

## About Hosting OmniRoute Free Models open-source software on Railway (self hosted OmniRoute template)

The Railway template runs one service from pinned image diegosouzapw/omniroute:3.8.51, port 20128, health /healthz, volume /app/data. Dashboard /dashboard, API /v1 (OpenAI, Claude, Gemini, Responses compatible). SQLite WAL in /app/data; no Postgres or Redis. Provider keys AES-256-GCM encrypted. Generated secrets: INITIAL_PASSWORD, JWT_SECRET, API_KEY_SECRET, OMNIROUTE_WS_BRIDGE_SECRET, MACHINE_ID_SALT. Fixed vars: 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. MIT licensed; you pay providers.

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

OpenRouter is hosted; OmniRoute puts routing in your Railway project. Catalog has 372 providers with 150+ free tiers; tos:avoid excluded from auto. Build paid primary then free fallback, quota-aware. $5 trial tests /v1/responses before raising memory.

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 Free Models 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 Free Models self hosting

| Provider | Strengths | Trade-offs for OmniRoute Free Models |
|---|---|---|
| DigitalOcean | Predictable droplets, simple block storage | You manage Docker, TLS, and public domain; no one-click volume or health check wiring |
| AWS | Flexible, IAM control, many regions | ECS, ALB, and EBS setup is overkill for a small gateway |
| Hetzner | Cheap VPS capacity, strong CPU per dollar | Manual reverse proxy and certificate renewal; no managed deploy from template |

Railway wins the first hour because the template wires volume, port, health check, and secrets. A VPS is cheaper at scale, but you run updates, backups, and TLS.

## Common Use Cases for hosted OmniRoute Free Models

- Route Claude Code, Codex, Cursor, Cline, Copilot, OpenCode, Aider, Continue, or Kilo Code through one /v1 endpoint.
- Four-tier fallback: paid primary, cheaper paid secondary, free tier tertiary, final free model.
- Cooldown provider keys after rate limits instead of crashing sessions.
- Built-in MCP server over HTTPS with Bearer API key.
- Usage and quota analytics in the dashboard.
- RTK + Caveman compression (15-95% token cuts on eligible workloads).

## Dependencies for OmniRoute Free Models Docker hosted on Railway

No separate database, queue, or cache. Dependencies: official Docker image, Railway volume for /app/data, public HTTPS domain for remote MCP, provider API keys. Image bundles Node.js runtime. OMNIROUTE_MEMORY_MB=1024 for dashboard and light chat; set 8192 with about 10 GB RAM for coding agents using /v1/responses.

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

- Railway service running diegosouzapw/omniroute:3.8.51 on port 20128.
- Health check /healthz.
- Persistent volume /app/data for SQLite WAL and encrypted keys.
- Generated secrets: INITIAL_PASSWORD, JWT_SECRET, API_KEY_SECRET, OMNIROUTE_WS_BRIDGE_SECRET, MACHINE_ID_SALT.
- Fixed env: 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.
- OMNIROUTE_MEMORY_MB=1024 or 8192.

### Implementation Details for OmniRoute Free Models (Using OmniRoute official docker image)

One Node.js process serves dashboard, /v1 API, HTTP MCP. SQLite WAL handles concurrent reads. Keys AES-256-GCM encrypted. 372-provider catalog with free tiers when you bring accounts. Model "auto", 19 routing strategies, four-tier fallback, circuit breakers, key cooldowns all run in container. tos:avoid providers excluded from auto.

## How does OmniRoute Free Models compare against other AI gateway platforms

### OmniRoute Free Models vs 9Router

- **Free tier routing:** Tracks free tiers and excludes tos:avoid from auto; 9Router lacks that.
- **Fallback depth:** Four-tier with circuit breakers and cooldowns; 9Router not default.
- **MCP server:** /api/mcp/stream and /api/mcp/sse over HTTPS; 9Router not same.
- **Compression:** RTK + Caveman built in; 9Router no.

### OmniRoute Free Models vs LiteLLM

- **Provider breadth:** 372-provider catalog, 150+ free tiers, tos:avoid filtering; LiteLLM broad but less explicit.
- **Coding memory:** OMNIROUTE_MEMORY_MB=8192 documented for /v1/responses; LiteLLM no single flag.
- **MCP server:** Built in; LiteLLM needs glue.
- **Analytics:** Usage and quota in dashboard.

### OmniRoute Free Models vs OpenRouter

- **Hosting:** Self-hosted on Railway; OpenRouter hosted.
- **Free tiers:** Your own accounts; OpenRouter its infrastructure.
- **Cost:** MIT, no per-token markup; OpenRouter margin.
- **Control:** Circuit breakers, cooldowns, fallback tiers; OpenRouter abstracts.

### OmniRoute Free Models vs CLIProxyAPI

- **Interface:** Dashboard, /v1 API, HTTP MCP; CLIProxyAPI CLI-first.
- **MCP transport:** HTTPS Bearer; CLIProxyAPI local stdio.
- **Fallback:** Four-tier and quota-aware cooldowns; CLIProxyAPI lighter.
- **Deployment:** One Railway service with volume; CLIProxyAPI local tool.

## How to use OmniRoute Free Models (the OSS AI gateway)?

1. Deploy template on Railway, open /dashboard.
2. Add keys: one paid model, several free tier accounts.
3. Set OMNIROUTE_MEMORY_MB=8192 for coding agents.
4. Create fallback chain: paid, cheaper paid, free tier, final free.
5. Point coding tool at Railway public domain /v1 with API key.
6. MCP clients: public domain /api/mcp/stream or /api/mcp/sse with Bearer token.
7. Watch dashboard for quota events, adjust order.

## How to self host OmniRoute Free Models on other VPS Services (OmniRoute Free Models self hosting guide)

### Clone the Repository

Clone OmniRoute repo onto VPS with 1 GB RAM light or 10 GB for coding agents. Docker image direct also works; repo gives env examples.

### Install Dependencies

Install Docker and Caddy or nginx. Docker is simpler; image bundles runtime.

### Configure Environment Variables

Set PORT=20128, HOSTNAME=0.0.0.0, DATA_DIR=/app/data, BASE_URL, NEXT_PUBLIC_BASE_URL, AUTH_COOKIE_SECURE=true, REQUIRE_API_KEY=true. Generate INITIAL_PASSWORD, JWT_SECRET, API_KEY_SECRET, OMNIROUTE_WS_BRIDGE_SECRET, MACHINE_ID_SALT. Set OMNIROUTE_MEMORY_MB=8192 for coding.

### Start the OmniRoute Free Models Application

Run Docker with volume /app/data, publish 20128. Reverse proxy HTTPS to 20128. Open /dashboard, add keys, test /v1/responses.

## Official Pricing of OmniRoute Free Models (OmniRoute Free Models pricing)

MIT licensed, software free. Pay Railway infra and paid provider tokens. Free tiers cost nothing but rate-limited, may log prompts, change without notice. $5 trial tests light instance; 8192 MB memory raises monthly cost.

## OmniRoute Free Models cloud vs self hosted comparison (Pricing, features, costs, and more)

### Monthly cost of self hosting OmniRoute Free Models on Railway

Light 1-2 GB RAM about $5-15/mo on Railway: dashboard, light chat, occasional /v1/responses. Raising OMNIROUTE_MEMORY_MB=8192 for Claude Code, Codex, Cursor, Cline, Copilot needs about 10 GB RAM, higher cost. Provider tokens separate.

### System Requirements for Hosting OmniRoute Free Models on a VPS

Light: 1-2 GB RAM, one CPU. Coding agents: OMNIROUTE_MEMORY_MB=8192, about 10 GB container RAM. Disk modest, a few GB; logs and compression caches can grow.

## Frequently Asked Questions (FAQs)

### How do I authenticate MCP clients over HTTPS on Railway?

Use Railway public domain with /api/mcp/stream or /api/mcp/sse. Send API key as Bearer token in Authorization header. stdio omniroute --mcp is local; Railway container already serves HTTP MCP.

### How much memory does OmniRoute need for Claude Code or Codex with /v1/responses?

Set OMNIROUTE_MEMORY_MB=8192. Upstream: coding agents need about 8 GB heap and ~10 GB container RAM. Default 1024 is dashboard and light chat only.

### Are free provider tiers really enough for coding agents?

Not alone. Free tiers slower, rate-limited, change often. Use as fallback behind paid. OmniRoute cools keys and moves tiers, but all-free chains hit limits more.

### Why are some free providers excluded from auto routing?

tos:avoid flags providers whose terms prohibit automated gateway use. Excluded from automatic routing by default; you can review manually, but default protects you.

### Does OmniRoute Free Models require Postgres or Redis?

No. SQLite WAL in /app/data. No Postgres, Redis, queue. One service, one volume.

### Can I mix paid and free models in one fallback chain?

Yes. Four-tier chain: paid primary, cheaper paid secondary, free tier tertiary, final free. Circuit breakers and cooldowns per tier; rate-limited free hands off cleanly.


## 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-free-ai-models
