English | 简体中文
Local (or VPS) HTTP proxy that turns agy (Antigravity CLI) quota into standard OpenAI, Anthropic (Claude), and Gemini Native API endpoints.
Features true streaming reasoning, tool call visualization, configurable permission modes, multi-account rotation, and a bilingual admin dashboard.
- 🚀 Full Protocol Compatibility:
- OpenAI:
POST /v1/chat/completions(stream & non-stream) +GET /v1/models - Anthropic:
POST /v1/messages(Claude thinking compatible) - Gemini Native:
POST /v1beta/models/{model}:generateContent
- OpenAI:
- 🧠 True Streaming Reasoning:
- Emits real-time reasoning content into
delta.reasoning_contentanddelta.reasoning(OpenAI),thinking_delta(Anthropic), and native thought parts (Gemini); - Native support for Gemini 3.8 Flash / Pro with auto-configured
--effort(low/medium/high) to prevent 502 errors.
- Emits real-time reasoning content into
- ⚙️ Real-time Tool Call Visualization:
- Intercepts CLI tool execution events (running commands, file operations, web searches) and injects them live into the thought stream (e.g.
⚙️ [调用工具] ...and↳ 完成); - Prevents timeouts and perceived freezes in long-running coding agents like Trae, Cursor, and Cline.
- Intercepts CLI tool execution events (running commands, file operations, web searches) and injects them live into the thought stream (e.g.
- 🛡️ Configurable Permission Modes:
skip(default): fully automated headless execution (--dangerously-skip-permissions);accept-edits: auto-approves workspace edits;plan: read-only planning mode.
- 🌐 Modern Bilingual Dashboard (i18n):
- Built-in web dashboard with seamless English / 中文 switching;
- Account health status, 1d/7d/30d token and request usage statistics, quota viewer, and egress proxy checker.
- 🔄 Smart Account Rotation:
- Isolated home directories for independent multi-account concurrency;
- Automatic cooldown and failover on rate limits.
- 🌐 Egress Proxy Pool:
- Route through HTTP / Socks5 proxy pool to avoid IP restrictions.
| Path | Protocol | Notes |
|---|---|---|
POST /v1/chat/completions |
OpenAI | Chat completions, stream + non-stream, thinking delta |
POST /v1/messages |
Anthropic | Claude messages API with thinking blocks |
POST /v1beta/models/{m}:generateContent |
Gemini | Google Gemini native endpoint |
GET /v1/models |
OpenAI | Available model list |
GET /healthz |
General | Liveness probe |
GET /admin/ui |
Dashboard | Web admin console (loopback open; remote needs API key) |
Default listen: 127.0.0.1:1413. Client key: sk-agy-local (configurable in config.json).
- Node.js (>= 18)
- Official
agyCLI installed and logged in at least once.
git clone https://github.com/tinytinycn/agy-proxy.git
cd agy-proxy
npm install
cp config.json.example config.json
cp accounts.json.example accounts.json
cp proxies.txt.example proxies.txtnode server.jsOpen Dashboard: http://127.0.0.1:1413/admin/ui
- Go to settings and add a custom OpenAI API provider.
- Settings:
- API Base URL:
http://127.0.0.1:1413/v1 - API Key:
sk-agy-local - Model:
gemini-3.8-flashorgemini-3.8-pro
- API Base URL:
- Enjoy live thinking collapsible blocks and tool execution steps directly in the chat!
curl http://127.0.0.1:1413/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-agy-local" \
-d '{
"model": "gemini-3.8-flash",
"stream": true,
"messages": [{"role": "user", "content": "Explain quicksort with examples"}]
}'{
"apiKey": "sk-agy-local",
"rotation": "rotate",
"maxAccountRetries": 4,
"cooldownMs": 60000,
"defaultModel": "gemini-3.8-flash",
"permissionMode": "skip",
"adminAuth": false,
"listenHost": "127.0.0.1",
"listenPort": 1413,
"maxInflight": 8,
"egress": {
"mode": "rotate",
"enabled": false,
"failThreshold": 3
}
}export AGY_PROXY_HOST=0.0.0.0
export AGY_PROXY_PORT=1413
export AGY_BIN=/home/ubuntu/.local/bin/agy
npm install -g pm2
pm2 start server.js --name "agy-proxy"- Remote dashboard:
http://<VPS_IP>:1413/admin/ui?key=sk-agy-local - Linux accounts run under isolated
homes/for parallel execution.
| File | Role |
|---|---|
server.js |
HTTP gateway (OpenAI / Anthropic / Gemini routing & streaming) |
agy_cli.js |
CLI subprocess execution, stream tag parsing & tool interception |
accounts.js |
Account pool, concurrency lock, and rotation |
proxies.js |
Egress HTTP/Socks5 pool |
auth.js |
OAuth login flow via CLI |
quota.js |
/quota balance checking per account |
usage.js |
1d / 7d / 30d request and token statistics |
dashboard.html |
Admin UI with English / Chinese i18n support |
config.json |
Server and proxy configuration |
Distributed under the MIT License.