---
title: "Deploy CLIProxyAPI | (Just Updated) Your Subscription as an API, Key-Locked From Boot"
description: "OpenAI-compatible proxy for your CLI plans, API key enforced from boot"
category: "AI/ML"
url: https://railway.com/deploy/cliproxyapi
---

# Deploy CLIProxyAPI | (Just Updated) Your Subscription as an API, Key-Locked From Boot

OpenAI-compatible proxy for your CLI plans, API key enforced from boot

**[Deploy CLIProxyAPI | (Just Updated) Your Subscription as an API, Key-Locked From Boot on Railway](https://railway.com/template/cliproxyapi)**

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

- **Creator:** SuperSlowSloth
- **Category:** AI/ML
- **Total deploys:** 12

## Template content

### cliproxyapi

- **Image:** eceasy/cli-proxy-api@sha256:7145258f0bec00e12d6fa19488baaa15768c0e234538ce80528d0da9bc6aef2b
- **Start command:** `/bin/sh -c "mkdir -p /data/auths; if [ ! -f /data/config.yaml ]; then echo cG9ydDogUE9SVE5VTQpyZW1vdGUtbWFuYWdlbWVudDoKICBhbGxvdy1yZW1vdGU6IHRydWUKICBzZWNyZXQta2V5OiBNR01US0VZCmF1dGgtZGlyOiAvZGF0YS9hdXRocwphcGkta2V5czoKICAtIEFQSUtFWVZBTApkZWJ1ZzogZmFsc2UK | base64 -d > /data/config.yaml; fi; sed -i s/PORTNUM/${PORT:-8317}/ /data/config.yaml; sed -i s/MGMTKEY/$MANAGEMENT_PASSWORD/ /data/config.yaml; sed -i s/APIKEYVAL/$API_KEY/ /data/config.yaml; exec /CLIProxyAPI/CLIProxyAPI --config /data/config.yaml"`
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host CLIProxyAPI on Railway

CLIProxyAPI (48k+ stars) wraps the CLI/subscription plans you already pay for — Claude Code,
ChatGPT Codex, Gemini/Antigravity, Grok — behind one OpenAI-, Gemini-, Claude- and
Codex-compatible HTTP API, so any tool that speaks the OpenAI API can use them.

This listing is the hardened build: the proxy comes up with a **generated API key already
enforced** and a **generated management password**, its OAuth logins live on a volume, and the
image is pinned by digest.

## About Hosting CLIProxyAPI

One container, ~15 MB resident, no database. Railway injects `PORT`; the service writes its
config to a mounted volume on first boot and keeps it there, so the accounts you sign in through
the management panel survive every redeploy. Two variables are pre-filled with per-deploy
secrets — there is nothing to type before clicking Deploy, and nothing left blank.

## Why Deploy CLIProxyAPI Here

- **No open proxy.** `api-keys` is seeded from a `${{secret(48)}}` on first boot, so an
  unauthenticated request gets `401` from the first second. A proxy on a public Railway domain
  with no key is a stranger burning your subscription quota.
- **A management password nobody else knows.** The panel key is a `${{secret(32)}}`, not a
  documented placeholder. It is bcrypt-hashed on first start.
- **Your logins survive a redeploy.** `auth-dir` is `/data/auths` on the volume, not the
  container's ephemeral home directory — signing your accounts back in after every deploy is the
  usual failure of self-hosted builds of this proxy.
- **Pinned by digest**, not a moving `latest` tag, and health-checked on `/healthz` so Railway
  does not route traffic before the proxy answers.

## Common Use Cases

- Point an OpenAI-compatible client (Cline, Roo, LibreChat, an SDK) at your own subscription.
- Give an agent or CI job a single stable endpoint with one API key you can rotate.
- Pool several provider accounts behind one URL, managed from the built-in control panel.

## Dependencies for CLIProxyAPI

- [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) (MIT), image
  `eceasy/cli-proxy-api`, pinned by digest.

### Deployment Dependencies

- A Railway volume for `/data` (config + OAuth credentials) — included in the template.
- Your own provider accounts, signed in once through `/v0/management` after deploy.


## 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/cliproxyapi
