Favicon of CliRelay

CliRelay

A self-hosted AI gateway connects Claude Code, Codex and Gemini CLI to shared provider accounts, with usage tracking and access controls.

CliRelay is an AI gateway for teams that want to manage coding assistants through a shared service on their own server. It builds on CLIProxyAPI and brings subscription accounts and provider API keys under central control.

  • Client and provider compatibility: Connect Claude Code, Codex, Gemini CLI and OpenAI-compatible clients through OpenAI, Anthropic or Gemini protocols, with request translation where needed.
  • Routing and failover: Group upstream accounts, distribute requests across them and switch away from accounts that fail or exhaust their allowance.
  • Usage and spending controls: Search request logs for token use, latency and cost, and apply spending caps, rate limits and model permissions to client keys or portal accounts.
  • Team access: Keep tenants' accounts, keys and data separate, assign roles and permissions, and audit security-sensitive changes.
  • Browser management: Manage provider credentials, available models and routing in a web console, while end users can check their own usage through portal accounts.

CliRelay is open source under the MIT license and supports Docker Compose deployment with PostgreSQL and Redis. The gateway and management console run on your server; requests routed to cloud providers leave that server and require internet access plus provider credentials. Supported services include Vertex AI, AWS Bedrock, OpenRouter and Ollama Cloud. Request metadata is recorded locally in the deployment's database, and full request and response body storage is optional and off by default.

Similar to CliRelay