SkillAgentSearch skills...

CliRelay

Wrap Gemini CLI, Antigravity, ChatGPT Codex, Claude Code, Qwen Code, iFlow as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini 2.5 Pro, GPT 5, Claude, Qwen model through API

Install / Use

/learn @kittors/CliRelay
About this skill

Quality Score

0/100

Supported Platforms

Claude Code
Claude Desktop
Gemini CLI
OpenAI Codex

README

<p align="center"> <img src="https://img.shields.io/badge/Go-1.26+-00ADD8?style=for-the-badge&logo=go&logoColor=white" alt="Go"> <img src="https://img.shields.io/badge/License-MIT-22c55e?style=for-the-badge" alt="License"> <img src="https://img.shields.io/github/stars/kittors/CliRelay?style=for-the-badge&color=f59e0b" alt="Stars"> <img src="https://img.shields.io/github/forks/kittors/CliRelay?style=for-the-badge&color=8b5cf6" alt="Forks"> </p> <h1 align="center">🔀 CliRelay</h1> <p align="center"> <strong>A unified proxy server for AI CLI tools — use your <em>existing</em> subscriptions with any OpenAI / Gemini / Claude / Codex compatible client.</strong> </p> <p align="center"> English | <a href="README_CN.md">中文</a> </p> <p align="center"> <a href="https://help.router-for.me/">📖 Docs</a> · <a href="https://github.com/kittors/codeProxy">🖥️ Management Panel</a> · <a href="https://github.com/kittors/CliRelay/issues">🐛 Report Bug</a> · <a href="https://github.com/kittors/CliRelay/pulls">✨ Request Feature</a> </p>

⚡ What is CliRelay?

✨ 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 lets you proxy requests from AI coding tools and compatible API clients (Claude Code, Gemini CLI, OpenAI Codex, Amp CLI, OpenAI-compatible clients, etc.) through a single unified endpoint. Authenticate with OAuth, API keys, cookies, or a mix of them, and CliRelay handles routing, failover, usage logging, /manage web hosting, and terminal management workflows automatically.

┌───────────────────────┐         ┌──────────────┐         ┌────────────────────┐
│   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       │
│  Any OAI-compatible   │         └──────────────┘         │  Vertex / OpenAI   │
└───────────────────────┘                                  │  iFlow / Qwen /    │
                                                           │  Kimi / Claude     │
                                                           └────────────────────┘

✨ Key Features

🔌 Multi-Provider Proxy Engine

| Feature | Description | |:--------|:------------| | 🌐 Unified Endpoint | One http://localhost:8317 fronts Gemini, Claude, Codex, Qwen, iFlow, Antigravity, Vertex-compatible endpoints, OpenAI-compatible upstreams, and Amp integration | | ⚖️ Smart Load Balancing | Round-robin or fill-first scheduling across multiple API keys for the same provider | | 🔄 Auto Failover | Automatically switches to backup channels when quotas are exhausted or errors occur | | 🧠 Multimodal Support | Full support for text + image inputs, function calling (tools), and streaming SSE responses | | 🔗 OpenAI-Compatible | Works with any upstream that speaks the OpenAI Chat Completions protocol |

📊 Request Logging & Monitoring (SQLite)

| Feature | Description | |:--------|:------------| | 📝 Full Request Capture | Every API request is logged to SQLite with timestamp, model, tokens (in/out/reasoning/cache), latency, status, and source channel | | 💬 Message Body Storage | Full request/response message content captured in compressed SQLite 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 | | 🗄️ No-CGO SQLite | Uses modernc.org/sqlite — pure Go, no CGO dependency, easy cross-compilation |

🔐 API Key & Access Management

| Feature | Description | |:--------|:------------| | 🔑 API Key CRUD | Create, edit, delete API keys via Management API — each with custom name, notes, and independent enable/disable toggle | | 📊 Per-Key Quotas | Set max token / request quotas per key with automatic enforcement | | ⏱️ Rate Limiting | Per-key rate limiting (requests per minute/hour) | | 🔒 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) |

🔗 Provider Channel Management

| Feature | Description | |:--------|:------------| | 📋 Multi-Tab Config | Manage channels organized by provider type: Gemini, Claude, Codex, Vertex, OpenAI Compatible, Ampcode | | 🏷️ Channel Naming | Each channel can have a custom name, notes, proxy URL, custom headers, and model alias mappings | | ⏱️ 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) | | 📊 Channel Stats | Per-channel success/fail counts and model availability displayed on each channel card |

🛡️ Security & Authentication

| Feature | Description | |:--------|:------------| | 🔐 OAuth Support | Native OAuth flows for Gemini, Claude, Codex, Qwen, iFlow, Antigravity, and Kimi, plus device/browser/cookie variants where supported | | 🔒 TLS Handling | Configurable TLS settings for upstream communication | | 🏠 Panel Isolation | Management panel access controlled independently with admin password | | 🛡️ Request Cloaking | Upstream requests are stripped of client-identifying headers for privacy |

🗄️ Data Persistence

| Feature | Description | |:--------|:------------| | 💾 SQLite Storage | All usage data, request logs, and message bodies stored in local SQLite database | | 🔄 Redis Backup | Optional Redis integration for periodic snapshotting and cross-restart metric preservation | | 🗃️ Pluggable Auth/Config Backends | Local files by default, with optional PostgreSQL, Git, or S3-compatible object storage backends for config/auth persistence | | 📦 Config Snapshots | Import/export entire system configuration as JSON for backup and migration |

📸 Management Panel Preview

CliRelay can expose a built-in web control panel at /manage. The server can host bundled SPA assets or fall back to synced management assets from the configured panel repository.

The latest panel walkthrough below covers all 13 core screens now shipped in the management workflow.

| Screen | What operators can do there | | :----- | :-------------------------- | | Dashboard Overview | Review KPIs, health score, system status, resource usage, throughput, and channel latency | | Monitor Center | Analyze model distribution, daily trends, API Key usage share, and time-range summaries | | Request Logs | Filter and inspect requests by time range, key, model, channel, and status | | Request Details | Read formatted prompt/response bodies with Markdown rendering and collapsible blocks | | AI Providers | Manage provider tabs, channel health, model coverage, and CRUD operations | | Auth Files | Inspect stored auth files, rename channels, configure prefixes/proxies, and download credentials | | OAuth Login | Start provider authorization and submit remote callback URLs | | API Keys | Control key quotas, RPM/TPM, allowed models, channel bindings, and shortcuts | | Model Pricing | Maintain quota-cost pricing for input, output, and cache dimensions | | Quota | Review remaining refresh time and quota progress across provider families | | Config | Edit source YAML, search config, and switch runtime/config views | | System | Inspect base URLs, versions, lookup links, and discovered model inventory | | Logs | Stream runtime logs with search, download, clear, and visibility toggles |

1. Dashboard Overview

<p align="center"> <img src="docs/images/dashboard-overview.png" width="100%" /> </p> <p align="center"><em>Dashboard — KPI cards, health score, live system monitor, throughput, storage, and channel latency ranking.</em></p>

2. Monitor Center

<p align="center"> <img src="docs/images/monitor-center-zh.png" width="100%" /> </p> <p align="center"><em>Monitor Center (Chinese locale) — request summary, model distribution, daily token/request trends, and API Key usage share.</em></p>

3. Request Logs

<p align="center"> <img src="docs/images/request-logs-table.png" width="100%" /> </p> <p align="center"><em>Request Logs — time-range switcher, multi-filter toolbar, high-density table, and success metrics at a glance.</em></p>

4. Request Details Viewer

<p align="center"> <img src="docs/images/request-details-modal.png" width="100%" /> </p> <p align="center"><em>Request Details — input/output tabs, Markdown rendering, collapsible sections, and copy/export helpers.</em></p>

5. AI Providers

<p align="center"> <img src="docs/images/providers-codex.png" width="100%" /> </p> <p align="center"><em>AI Providers — provider tabs, per-channel success/failure stats, model badges, latency bars, and CRUD actions.</em></p>

6. Auth Files

<p align="center"> <img src="docs/images/auth-files-grid.png" width="100%" /> </p> <p align="center"><em>Auth Files — card-based inventory for saved credential
View on GitHub
GitHub Stars163
CategoryDevelopment
Updated3h ago
Forks9

Languages

Go

Security Score

95/100

Audited on Apr 4, 2026

No findings