A multi-protocol AI API proxy server with account pooling, API key management, and a visual dashboard. Use Claude Code, Codex CLI, Gemini CLI, and OpenClaw through a unified local proxy — with multi-account rotation, intelligent routing, free model routing, usage analytics, and one-click configuration.
- Claude Code — Proxies Anthropic Messages API (
/v1/messages) with streaming - Codex CLI — Proxies OpenAI Responses API (
/v1/responses), Chat Completions (/v1/chat/completions), and Codex Internal API (/backend-api/codex/responses) - Gemini CLI — Proxies Gemini API (
/v1beta/models/*) with one-click patch - OpenClaw — Custom provider injection via
anthropic-messagesoropenai-completions
- ChatGPT Account Pool — OAuth login, multi-account rotation (sticky / round-robin / random), auto token refresh, per-account quota tracking
- Claude Account Pool — OAuth PKCE login, token refresh with source writeback to Claude Code credentials
- Antigravity Account Pool — Google OAuth login for enterprise models, automatic model discovery and project management
- API Key Pool — Support for OpenAI, Azure OpenAI, Anthropic, Google Gemini, Vertex AI, MiniMax, Moonshot, ZhipuAI keys with automatic failover and load balancing
- Key Validation — One-click connectivity test for each API key
- Smart Token Refresh — Only refreshes when tokens are about to expire (< 5 min), syncs back to source CLI tools
- Priority Mode — Choose between Account Pool First or API Key First when both are available
- Routing Mode — Automatic routing or manual per-app credential assignments
- App Routing — Bind each app (Claude Code, Codex, Gemini CLI, OpenClaw) to a specific ChatGPT account, Claude account, or API key
- Model Mapping — Customize which upstream model each provider resolves to
- Free Model Routing — Routes
claude-haikurequests to free models (DeepSeek, Qwen, MiniMax, etc.) via Kilo AI — no API key needed
- Usage & Costs — Per-account, per-model, per-provider usage and cost statistics with daily/monthly breakdown
- Request Logs — Full request/response logging with date and provider filtering, error-only view
- Real-time Log Stream — Live SSE log stream for debugging
- Pricing Registry — View and customize per-provider, per-model pricing with manual overrides
- Dashboard — Quick status metrics (total/available accounts, expired tokens, default plan), quick test buttons, Claude Code usage example
- Chat UI — Interactive chat interface with source selector (ChatGPT, Claude, API keys), model selection, system prompt, and chat history
- Account Management — Tabbed interface for ChatGPT, Claude, and Antigravity accounts with add/remove/enable/disable/switch
- API Key Management — Add, test, edit, disable API keys with provider-specific fields (Azure deployment name/API version, Vertex project ID/location)
- Tool Installer — Detect and install/update Node.js, Claude Code, Codex CLI, Gemini CLI, OpenClaw — auto-detects OS, shows version status, checks for updates
- Resources Catalog — Curated directory of free and trial LLM API resources with provider details, limits, and compatibility info
- One-click CLI Configuration — Configure Claude Code, Codex CLI, Gemini CLI, OpenClaw with a single button
- i18n — English and Chinese interface
- Dark/Light Theme — Toggle between dark and light mode
| Dashboard | Chat UI |
|---|---|
![]() |
![]() |
| Account Management | API Key Management |
|---|---|
![]() |
![]() |
| Settings & App Routing | Usage & Costs |
|---|---|
![]() |
![]() |
| Request Logs | Pricing Registry |
|---|---|
![]() |
![]() |
| Tool Installer | Resources Catalog |
|---|---|
![]() |
![]() |
┌─────────────┐ ┌───────────┐ ┌────────────┐ ┌──────────┐
│ Claude Code │ │ Codex CLI │ │ Gemini CLI │ │ OpenClaw │
└──────┬──────┘ └─────┬─────┘ └──────┬─────┘ └────┬─────┘
│ │ │ │
└───────────────┼───────────────┼──────────────┘
▼
┌─────────────────────┐
│ CliGate │
│ localhost:8081 │
│ │
│ ┌───────────────┐ │
│ │ Protocol │ │
│ │ Translation │ │
│ └───────┬───────┘ │
│ │ │
│ ┌───────▼───────┐ │
│ │ Account Pool │ │
│ │ & Key Router │ │
│ └───────┬───────┘ │
└──────────┼──────────┘
│
┌───────┬───────┼───────┬───────┐
▼ ▼ ▼ ▼ ▼
┌────────┐┌────────┐┌────────┐┌────────┐┌────────┐
│Anthropic││ OpenAI ││Google ││Vertex ││Kilo AI │
│ API ││ API ││Gemini ││ AI ││ (Free) │
└────────┘└────────┘└────────┘└────────┘└────────┘
npx cligate@latest startnpm install -g cligate
cligate startDownload the latest release from Releases.
cligate startDashboard opens at http://localhost:8081
Web Dashboard (recommended):
- Open http://localhost:8081 → Accounts tab
- Click Add Account → Login with ChatGPT / Claude / Google (Antigravity)
- Or go to API Keys tab → Add API Key with your OpenAI, Azure, Gemini, Vertex AI, or other provider keys
- Accounts are automatically saved and tokens are auto-refreshed
CLI:
cligate accounts add # Opens browser
cligate accounts add --no-browser # Headless/VMClick the one-click configure button in the Dashboard or Settings tab, or manually:
Claude Code:
export ANTHROPIC_BASE_URL=http://localhost:8081
export ANTHROPIC_API_KEY=any-key
claudeCodex CLI:
# ~/.codex/config.toml
chatgpt_base_url = "http://localhost:8081/backend-api/"
openai_base_url = "http://localhost:8081"Gemini CLI: Use the one-click patch button in the dashboard.
OpenClaw: Use the one-click configure button, or add manually to ~/.openclaw/openclaw.json:
{
"models": {
"providers": {
"proxypool": {
"baseUrl": "http://localhost:8081",
"apiKey": "sk-ant-proxy",
"api": "anthropic-messages"
}
}
}
}In the Settings tab:
- Priority Mode — Choose "Account Pool First" or "API Key First"
- Routing Mode — "Automatic" for smart routing, or "App Assigned" to bind each app to a specific credential
- App Assignments — Bind Claude Code, Codex, Gemini CLI, or OpenClaw to a specific account or API key
| Requested Model | Routed To | Auth Required |
|---|---|---|
claude-sonnet-4-6 |
GPT-5.2 Codex / Anthropic API | Yes |
claude-opus-4-6 |
GPT-5.3 Codex / Anthropic API | Yes |
claude-haiku-4-5 |
Free model via Kilo AI | No |
The haiku model can be changed to any free model (DeepSeek R1, Qwen3, MiniMax, etc.) from the Settings tab.
| Endpoint | Protocol | Used By |
|---|---|---|
POST /v1/messages |
Anthropic Messages | Claude Code, OpenClaw |
POST /v1/chat/completions |
OpenAI Chat Completions | Codex CLI, OpenClaw |
POST /v1/responses |
OpenAI Responses | Codex CLI |
POST /backend-api/codex/responses |
Codex Internal | Codex CLI |
POST /v1beta/models/* |
Gemini API | Gemini CLI |
GET /v1/models |
OpenAI Models | All |
GET /health |
Health Check | Monitoring |
See API Documentation for the full reference.
- 100% Local — Runs entirely on
localhost, no external server involved - Direct Connection — Connects directly to official APIs (OpenAI, Anthropic, Google), no third-party relay
- No Telemetry — Zero data collection, zero tracking
- Token Safety — Credentials stored locally with
0600permissions, smart refresh avoids unnecessary token rotation - Source Writeback — When tokens are refreshed for imported accounts, they are synced back to the source CLI tool so it keeps working
-
GitHub Discussions — Ask questions, share ideas, report issues
-
Discord — Real-time chat with the community
-
WeChat — Scan to add the author, note "CliGate" to join the group
If this project helps you, consider supporting its development:
This project is licensed under AGPL-3.0.
This project is an independent open-source tool. It is not affiliated with, endorsed by, or sponsored by Anthropic, OpenAI, or Google. All trademarks belong to their respective owners. Use responsibly and in accordance with applicable Terms of Service.










