caidaoli/ccLoad

Self-hosted AI API gateway for Claude Code, Codex and Gemini: pool API keys and subscription accounts behind one endpoint with failover, protocol conversion and cost tracking.

ccLoad – Self‑hosted AI API gateway

What it does – ccLoad is a Go‑based reverse‑proxy you run on your own machine or server. It sits in front of many different large‑language‑model providers (Claude, OpenAI, Gemini, Codex, etc.) and presents a single API endpoint plus a token that your client tools use. The gateway picks an upstream channel (a set of credentials or a subscription account), retries on failure, converts between different request formats, and records usage and cost.

Who it’s for –

  • Developers who have several AI subscriptions and want a single point of access so that a quota‑exhausted key doesn’t break a coding session.
  • Teams that need per‑user or per‑project API tokens with limits on models, spend, or concurrency.
  • Operators who manage many credentials and want health‑based routing, scheduled health checks, and a web console.

Key features

  • Channel management – add API‑key based services, relay URLs, or OAuth‑based accounts (Claude, Codex/ChatGPT, Antigravity, xAI, etc.). Each channel lists the models it can serve.
  • Failover & cooldown – automatic retry with exponential back‑off, scoped to key/model/channel, and respects upstream rate‑limit windows.
  • Protocol translation – supports Anthropic, OpenAI, Codex Responses, and Gemini clients; converts requests when the client and upstream protocols differ.
  • Token‑based access control – generate API tokens with per‑token cost caps, model allow‑/deny‑lists, concurrency limits, and read‑only console view.
  • Observability – dashboard showing live requests, logs, cost breakdowns, and the ability to abort in‑flight requests.
  • Lightweight deployment – single binary with embedded SQLite (optional MySQL/PostgreSQL), Docker images for amd64/arm64, Homebrew formula, and even a free Hugging Face Spaces option.

How to get started

  1. Install – Docker (recommended), Docker‑Compose, Homebrew, or download the binary from the releases page.
  2. Run – the service listens on port 8080; set the admin password via CCLOAD_PASS.
  3. Admin console – visit http://<host>:8080/web/ to add channels and create client tokens.
  4. Configure a client – point Claude Code, Codex CLI, or any OpenAI‑compatible SDK to http://<host>:8080/v1 and use the generated token as the API key.
  5. Monitor – use the built‑in dashboard for usage, cost, and health information.

Why use it – It removes the need to embed many different keys in your code, gives you automatic failover when a provider is down or a quota is exhausted, and lets you keep a clear accounting of how much each model or token costs.

License – MIT.

Related

  • Project
  • Project
  • Project
  • Project
  • Project