# CliRelay

> A self-hosted AI gateway that unifies coding CLI subscriptions behind one endpoint, with a web console for multi-tenant management, request logging, and quota controls.

- **Licence:** MIT
- **Latest version:** v0.5.9
- **Open source:** oss
- **Languages:** Go
- **Platforms:** Docker Compose
- **Tags:** PostgreSQL, Redis, LLM, Anthropic, Openai, Api Gateway, Ai Gateway, Docker, Go, Self Hosted, Codex, Multi Tenant, Claude code, Openai compatible, Llm proxy, OpenAI Codex, Gemini Cli

## Description

CliRelay is a self-hosted AI gateway that consolidates your AI coding subscriptions and API keys behind a single endpoint compatible with OpenAI, Claude, Gemini, and Codex clients. It provides a multi-tenant web console at /manage for adding upstream accounts through OAuth sign-in, credential import, or API keys. You can manage client keys with spending quotas and rate limits, route requests across channel groups with automatic failover, and view detailed request logs showing token usage and cost. The proxy handles translation between OpenAI Chat/Responses, Anthropic Messages, and Gemini protocols. It requires PostgreSQL 15+ for persistent data and Redis 7+ for caches, locks, and rate limits. Deployment uses Docker Compose, which also runs an updater sidecar for in-panel updates. The project extends CLIProxyAPI with a management layer, control panel, and operational features.

## Links

- [Homepage](https://github.com/kittors/clirelay)
- [Docker](ghcr.io/kittors/clirelay)
- [Documentation](https://help.router-for.me/)
- [Releases](https://github.com/kittors/CliRelay/releases)
- [Issue tracker](https://github.com/kittors/CliRelay/issues)
- [Production checklist](https://github.com/kittors/CliRelay/blob/main/docs/production-checklist.md)
- [Multi-instance deployment guide](https://github.com/kittors/CliRelay/blob/main/docs/multi-instance-deployment.md)
- [PostgreSQL/Redis runtime guide](https://github.com/kittors/CliRelay/blob/main/docs/postgres-redis-migration.md)
- [SDK usage documentation](https://github.com/kittors/CliRelay/blob/main/docs/sdk-usage.md)

---
Source: https://selfhost.directory/project/clirelay