CliRelay  by kittors

AI API proxy service unifying diverse models

Created 2 months ago
545 stars

Top 58.1% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

CliRelay offers a unified proxy server for AI CLI tools like Gemini, Claude, and OpenAI Codex. It consolidates existing subscriptions and credentials into a single, OpenAI/Gemini/Claude-compatible API service, simplifying integration and enabling flexible routing across multiple AI models for developers and power users.

How It Works

This project is a heavily enhanced fork of CLIProxyAPI, featuring a production-grade management layer. It routes requests from a unified endpoint (:8317) to various upstream AI providers (Gemini, OpenAI, Claude, Qwen). Key architectural choices include smart load balancing, automatic failover, multimodal support, and comprehensive request logging via SQLite for monitoring and analytics.

Quick Start & Requirements

Recommended installation is via Docker Compose:

  1. Clone: git clone https://github.com/kittors/CliRelay.git && cd CliRelay
  2. Configure: cp config.example.yaml config.yaml and edit with credentials.
  3. Run: docker compose up -d Prerequisites: Docker, Docker Compose. API endpoint: http://localhost:8317. Management panel: http://localhost:8317/manage. Full guides: help.router-for.me.

Highlighted Details

  • Unified Endpoint: Consolidates Gemini, Claude, Codex, Qwen, iFlow, Antigravity, Vertex, and OpenAI-compatible upstreams under http://localhost:8317.
  • Smart Routing & Failover: Features load balancing, group/path routing, and automatic failover for reliability.
  • Comprehensive Monitoring: Detailed SQLite logging captures usage, latency, and status, with analytics and real-time stats.
  • API Key Management: Supports per-key quotas, rate limiting, team permissions, and self-service usage lookup.
  • Multimodal & Streaming: Handles text/image inputs, image generation, function calling, and SSE streaming.

Maintenance & Community

A significant fork of router-for-me/CLIProxyAPI, it builds upon the original's core logic. Contributions should target the dev branch. The GitHub repository is the primary community hub.

Licensing & Compatibility

Licensed under the permissive MIT License, allowing broad compatibility and commercial use. Works with any upstream supporting the OpenAI Chat Completions protocol.

Limitations & Caveats

As a fork, it extends its predecessor's functionality; users should note potential complexities from the added management layer. Production deployments should avoid the allow-unauthenticated: true setting.

Health Check
Last Commit

11 hours ago

Responsiveness

Inactive

Pull Requests (30d)
56
Issues (30d)
12
Star History
406 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.