CliRelay

Anyone who pays for Claude Code, Codex, and Gemini CLI separately ends up juggling three endpoints, three sets of keys, and three kinds of rate-limit surprise, and CliRelay collapses all of that into one self-hosted gateway with a control panel. Clients speak the OpenAI Chat or Responses, Anthropic Messages, or Gemini protocol, and CliRelay translates each request for whichever upstream account is healthy. Channel groups limit where each key may send traffic, round-robin, fill-first, and session-sticky scheduling spread it, and cooldowns with automatic failover move requests off accounts that have run out of quota. Add upstreams from the /manage console through browser sign-in, device codes, or bulk credential import, covering Claude, Codex, Gemini, Antigravity, Vertex AI, AWS Bedrock, Grok, Qwen, Kimi, and any OpenAI-compatible service. Portal accounts own client keys with daily, period, and lifetime quotas, RPM and TPM limits, and per-model pricing. A monitor center scores health and charts live traffic, P50 to P99 latency, and time to first token, while every request lands in a searchable log with tokens, latency, and cost. Tenants, roles with resource.action permissions, content moderation profiles, an outbound proxy pool, and an audit trail make shared deployments workable, and the console speaks English, Simplified Chinese, and Russian. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. MIT licensed.

CliRelay
CliRelay
CliRelay
CliRelay
CliRelay
CliRelay
CliRelay

Benefits

  • One endpoint for every provider
  • Claude Code, Codex CLI, Gemini CLI, and any OpenAI-compatible client connect to http://your-host:8317 using the OpenAI, Anthropic, or Gemini protocol, with each request translated for the upstream account that serves it.
  • Failover when accounts run dry
  • Channel groups, round-robin, fill-first, or session-sticky scheduling, and per-channel cooldowns shift traffic away from exhausted or failing accounts automatically, so a spent quota does not interrupt a coding session.
  • Spend caps for every key
  • Portal accounts own client keys with daily, period, and lifetime quotas plus RPM and TPM limits, and per-model pricing turns each logged request into a cost figure that resets in one click.
  • Built to be run by teams
  • Tenants keep accounts, keys, and data apart, roles grant resource.action permissions, and an audit log records who changed what, from where, and whether the change succeeded.

Features

  • Monitor center and logs
  • Health score, six golden-signal tiles, P50 to P99 latency, time to first token, failure analysis, and a request log with tokens, latency, cost, and optional stored bodies.
  • Guided account onboarding
  • One Add AI account dialog covers browser sign-in, device codes, and credential import for Claude, Codex, Antigravity, and Grok, with bulk import that retries failed rows on its own.
  • Model catalog and pricing
  • A model plaza and catalog list capabilities, serving channels, and per-million-token prices, with an optional OpenRouter sync, a built-in model test, and a reusable outbound proxy pool.
  • Visual config editor
  • Edit the running configuration through grouped forms with inline validation or as YAML, apply a low-resource profile for small hosts, and check for updates from the system info page.
  • Terminal UI and storage options
  • A terminal UI starts with the -tui flag, and configuration and credentials can live in local files, PostgreSQL, Git, or an S3-compatible object store.
  • Moderation and CC Switch presets
  • Content moderation profiles can be tested against sample text and bound to accounts or keys, and CC Switch builds one-click import presets for Claude Code and Codex.

Apps Similar to CliRelay