by kittors
Self-hosted AI gateway for coding CLIs — one OpenAI/Claude/Gemini/Codex-compatible endpoint, with a multi-tenant web console, request logs, and spend quotas.
# Add to your Claude Code skills
git clone https://github.com/kittors/CliRelayGuides for using cli tools skills like CliRelay.
Last scanned: 8/5/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-08-05T06:27:13.017Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}CliRelay is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by kittors. Self-hosted AI gateway for coding CLIs — one OpenAI/Claude/Gemini/Codex-compatible endpoint, with a multi-tenant web console, request logs, and spend quotas. It has 882 GitHub stars.
Yes. CliRelay passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/kittors/CliRelay" and add it to your Claude Code skills directory (see the Installation section above).
CliRelay is primarily written in Go. It is open-source under kittors on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh CliRelay against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
✨ Heavily enhanced fork of the CLIProxyAPI project — rebuilt with a production-grade management layer, web control panel hosting, and a terminal TUI for day-2 operations.
CliRelay turns AI CLI subscriptions, OAuth credentials, API keys, and compatible upstream services into one managed API layer. It proxies Claude Code, Gemini CLI, OpenAI Codex, Qwen, iFlow, Kimi, Antigravity, xAI/Grok, OpenCode Go, ClinePass, Ollama Cloud, Bedrock, Amp, Vertex, OpenAI-compatible clients, and other AI coding tools through a unified endpoint, then adds routing groups, failover, request logging, quota control, model pricing, image-generation support, content moderation, online updates, /manage web hosting, and terminal management workflows around that traffic.
It is built to be operated by more than one person. Tenants, users, roles, and a fine-grained permission model (governance.tenants, models.write, providers.test, …) decide which pages, buttons, and actions each account gets, and every security-sensitive change lands in an audit log. Portal accounts let end users hold several API keys under one identity and check their own usage without an admin in the loop.
The current runtime data stack is PostgreSQL 15+, Redis 7+, and Ent ORM. PostgreSQL is the source of truth for runtime data; Redis is used for cache, locks, limits, queues, and rebuildable state. SQLite is legacy-only and is supported as an import source during migration.
┌───────────────────────┐ ┌──────────────┐ ┌────────────────────┐
│ AI Coding Tools │ │ │ │ Upstream Providers │
│ │ │ │ ──────▶ │ Google Gemini │
│ Claude Code │ ──────▶ │ CliRelay │ ──────▶ │ OpenAI / Codex │
│ Gemini CLI │ │ :8317 │ ──────▶ │ Anthropic Claude │
│ OpenAI Codex │ │ │ ──────▶ │ Qwen / iFlow │
│ Amp CLI / IDE │ │ │ ──────▶ │ Antigravity/xAI │
│ Any OAI-compatible │ └──────────────┘ │ Vertex / Bedrock │
└───────────────────────┘ │ OpenCode/Cline │
│ Ollama / Amp │
└────────────────────┘
| Feature | Description |
|---|---|
| 🌐 Unified Endpoint | One http://localhost:8317 fronts Gemini, Claude, Codex, Qwen, iFlow, Kimi, Antigravity, xAI/Grok, Vertex, Bedrock, OpenCode Go, ClinePass, Ollama Cloud, OpenAI-compatible upstreams, and Amp integration |
| ⚖️ Smart Load Balancing | Round-robin or fill-first scheduling across multiple API keys for the same provider |
| 🧭 Group & Path Routing | Bind channels into groups, restrict API keys to allowed groups, and expose custom path namespaces for teams or workloads |
| 🔄 Auto Failover | Automatically switches to backup channels when quotas are exhausted or errors occur |
| 🧠 Multimodal Support | Full support for text + image inputs, image-generation routing, function calling (tools), and streaming SSE responses |
| 🔗 OpenAI-Compatible | Works with any upstream that speaks the OpenAI Chat Completions protocol |
| Feature | Description |
|---|---|
| 📝 Full Request Capture | Every API request is logged to PostgreSQL with timestamp, model, tokens (in/out/reasoning/cache), latency, status, and source channel |
| 💬 Message Body Storage | Full request/response message content captured in compressed PostgreSQL storage, with separate retention for content vs. metadata |
| 🔍 Advanced Querying | Filter logs by API Key, model, status, time range with efficient pagination (LIMIT/OFFSET) |
| 📈 Analytics Aggregation | Pre-computed dashboards: daily trends, model distribution, hourly heatmaps, per-key statistics |
| 🏥 Health Score Engine | Real-time 0–100 health score considering success rate, latency, active channels, and error patterns |
| 📡 WebSocket Monitoring | Live system stats streamed via WebSocket: CPU, memory, goroutines, network I/O, DB size |
| 🗄️ Ent + PostgreSQL | Uses PostgreSQL 15+ as the runtime primary database with Ent-generated schema metadata |
| Feature | Description |
|---|---|
| 🏢 Tenant Lifecycle | Create tenants and manage their lease periods; runtime data is scoped by tenant end to end |
| 👤 User Management | Manage the accounts inside the active tenant, with password policy and reset flows |
| 🎭 Role Permissions | Fine-grained resource.action permissions (governance.tenants, models.write, providers.test, …) decide which pages, buttons, and actions an account can reach |
| 🧾 Audit Logs | Security-sensitive account and tenant changes are recorded and reviewable in the panel |
| 🧭 Menu Management | Curate which navigation entries a tenant sees, keeping menus aligned with granted permissions |
| Feature | Description |
|---|---|
| 🔑 API Key CRUD | Create, edit, delete API keys via Management API — each with custom name, notes, and independent enable/disable toggle |
| 🧑💼 Portal Accounts | Group several API keys under one end-user account, so a person is managed once instead of key by key |
| 📊 Per-Key Quotas | Set max token / request quotas per key with automatic enforcement |
| 🔁 Period Quota Resets | Reset spending quotas for a chosen period, for a whole account or a single owned key |
| ⏱️ Rate Limiting | Per-key rate limiting (requests per minute/hour) |
| 🧩 Permission Profiles | Reusable profiles bind scoped channel access and model permissions to keys |
| 🔒 Key Masking | API keys are always displayed masked (sk-***xxx) in UI and logs |
| 🌍 Public Lookup Page | End users can query their own usage stats and request logs via a public self-service page (no login required) |
| Feature | Description |
|---|---|
| 📋 Multi-Tab Config | Manage channels organized by provider type: Gemini, Claude, Codex, OpenCode Go, ClinePass, Ollama Cloud, Vertex, Bedrock, OpenAI Compatible, and Ampcode |
| 🏷️ Channel Naming | Each channel can have a custom name, notes, proxy URL, custom headers, and model alias mappings |
| 🧩 Reusable Proxy Pool | Maintain outbound proxy entries once and attach them to OAuth/auth channels when needed |
| ⏱️ Latency Tracking | Average latency (latency_ms) tracked per channel with visual indicators |
| 🔄 Enable/Disable | Individually toggle channels on/off without deletion |
| 🚫 Model Exclusions | Exclude specific models from a channel (e.g., block expensive models on backup keys) |
| 🧾 Model Library Sync | Maintain custom models and sync model IDs/pricing from OpenRouter for quota accounting |
| 📊 Channel Stats | Per-channel success/fail counts and model availability displayed on each channel card |
| Feature | Description |
|---|---|
| 🔐 OAuth Support | Native OAuth flows for Gemini, Claude, Codex, Qwen, iFlow, Antigravity, Kimi, and xAI/Grok, plus device/browser/cookie variants where supported |
| 🪪 Identity Fingerprints | Centralize upstream identity metadata so providers receive consistent client fingerprints |
| 🧹 Content Moderation | Build reusable moderation profiles, test them against sample content, and bind them to AI accounts, provider keys, or a provider default |
| 🔒 TLS Handling | Configurable TLS settings for upstream communication |
| 🏠 Panel Isolation | Management panel access controlled independently with admin password |
| 🌐 Scoped CORS | Browser and extension callers are allowlisted explicitly, including a controlled chrome-extension://* form; the preflight advertises every auth header the server actually accepts |
| 🛡️ Request Cloaking | Upstream requests are stripped of client-identifying headers for privacy |
| Feature | Description |
|---|---|
| 🖥️ Visual Management Panel | Configure providers, auth, API keys, models, routing, logs, updates, and system status from /manage |
| 🌐 Trilingual UI | Built-in i18n for the management panel — Simplified Chinese, English, and Russian — plus Compose/TUI language selection |
| 🌙 **Dark |