使用该代理可能违反 Google 服务条款,已有账号被封或影子封禁的报告,建议用小号;默认监听 8080 端口,需与 Claude Code 的 ANTHROPIC_BASE_URL 保持一致;以 systemd 运行时需设置 CLAUDE_CONFIG_PATH 指向真实用户的 .claude 目录,否则 WebUI 读写不到 Claude CLI 配置
antigravity-claude-proxy
badrisnarayananMIT活跃维护把 Antigravity 提供的 Claude 和 Gemini 模型包装成本地代理接口,让 Claude Code、OpenClaw 等客户端直接调用这些模型。
Proxy that exposes Antigravity provided claude / gemini models, so we can use them in Claude Code and OpenClaw (Clawdbot)
npx antigravity-claude-proxy@latest startREADME 未说明硬件要求,仅要求 Node.js 22.19.0 或更高版本,并需安装 Antigravity 或提供 Google 账号
把 Antigravity 的 Claude/Gemini 模型包装成 Anthropic 兼容 API,供 Claude Code 和 OpenClaw 直接使用
把 Antigravity 提供的 Claude 和 Gemini 模型包装成本地代理接口,让 Claude Code、OpenClaw 等客户端直接调用这些模型。
核心能力
- 接收 Anthropic Messages 格式请求并转换为 Google Generative AI 格式
- 支持 OAuth 多账号接入与 Antigravity 本地会话自动检测
- 保留 thinking 与流式输出并转回 Anthropic 格式
- 提供 acc start/stop/status 等后台进程管理命令
- 内置 Web 控制台管理账号、配额与 Claude CLI 配置
容易踩的坑
- v3.0.0最新正式版2026-11-07 · 2026-11-07 12:03 UTC
⚠️ Breaking Changes
- Node.js 22.19.0 or later is now required. Node.js 18 and 20 are no longer supported. Check your version with
node --versionand upgrade before updating the proxy. - Core dependencies upgraded to new major versions: Express 5, undici 8, and better-sqlite3 13. The proxy's API behaves the same, but if you run it from source or patch it, see the Express 5 and undici 8 migration notes. better-sqlite3 13 also adds support for Node.js 26.
What's New
- Security fixes:
proxy-addrupgraded to 2.0.8 (CVE-2026-90711), andnpm auditnow reports 0 vulnerabilities. Updated packages include undici, express, body-parser, qs, path-to-regexp and postcss. - Web UI styling fixed: the compiled stylesheet was out of date, so some red and amber warning and error styles in the Accounts and Settings views showed up unstyled. They display correctly again.
Contributors
Thanks to @anupamme for the
proxy-addrsecurity upgrade for CVE-2026-90711 (#407)! - Node.js 22.19.0 or later is now required. Node.js 18 and 20 are no longer supported. Check your version with
- v2.9.32026-11-07 · 2026-11-07 08:09 UTC
查看更新说明
What's New
- Better Gemini cache hit rate when several conversations run at once: each conversation now gets its own session ID, built from the account and the first user message. Before, every conversation on an account shared one ID, so running several Claude Code sessions or subagents together pushed each other's cached prompts out, and hit rates stuck around 45-55%.
- Long-running conversations keep their cache after 2 hours and across restarts: thinking signatures no longer expire after 2 hours, and they are saved to
~/.config/antigravity-proxy/signature-store.jsonso they survive a proxy restart. Before, old conversation history got rewritten after the expiry, which broke the cached prompt. You can change the file location withANTIGRAVITY_SIGNATURE_STORE. - Correct token usage reporting: streamed responses now report the final
input_tokensinmessage_deltainstead of an early estimate that left out cached tokens (#389).output_tokensnow counts thinking tokens too, in both streaming and non-streaming responses.
Contributors
Thanks to @tracycam for the per-conversation session IDs and persistent signature cache (#367) and for the usage token accounting fixes (#406)!
- v2.9.22026-11-02 · 2026-11-02 18:50 UTC
查看更新说明
What's New
- Fixed opaque 429 / RESOURCE_EXHAUSTED errors when using the Claude Code CLI: "Claude Code" and "Anthropic" are now scrubbed from the system prompt sent to Cloud Code (whole words only, so code identifiers like
convertAnthropicToGoogleare left untouched) - Claude Code's default model names (
claude-opus-5-5,claude-sonnet-5-5,claude-haiku-5-5,claude-opus-5,claude-sonnet-5, and olderclaude-3-5/3-7-sonnetIDs) now map automatically to available backend models instead of failing with "Invalid model" - Usage stats now record the backend model actually used, and only count requests that succeed (invalid or failed requests are no longer counted)
- Existing usage history with legacy model names (
opus-5-5,sonnet-5-5,haiku-5-5) is migrated automatically on startup, with totals preserved - Dashboard usage chart hides models with no requests in the selected range
Contributors
Thanks to @tsaijamey for scrubbing Claude Code and Anthropic identity from the system prompt (#401)! Thanks to @endymoonz for tracking the resolved backend model in usage stats and migrating legacy stats (#402)!
- Fixed opaque 429 / RESOURCE_EXHAUSTED errors when using the Claude Code CLI: "Claude Code" and "Anthropic" are now scrubbed from the system prompt sent to Cloud Code (whole words only, so code identifiers like
- v2.9.12026-10-23 · 2026-10-23 08:56 UTC
查看更新说明
What's New
- Gemini output limit raised to 64K tokens: Gemini requests are now capped at 65,536 output tokens instead of 16,384, so long responses from Gemini 3.8 and Gemini 4 Argon are no longer cut short.
- Faster small Gemini requests: when a client sends a small
max_tokens(≤1024) without asking for thinking, the proxy now uses a minimal thinking budget. Thinking can no longer use up the output budget and leave an empty reply. This mostly helps short utility calls like title generation. - Fewer synthetic tool-loop messages on Gemini: a Gemini tool call that carries a valid
thoughtSignaturenow counts as valid thinking, so the proxy no longer injects unnecessary "recovery" messages into tool loops.
Contributors
Thanks to @tsaijamey for the Gemini output cap, thinking budget and tool-loop fixes (#393)!
- v2.9.02026-10-23 · 2026-10-23 08:24 UTC
查看更新说明
What's New
- Gemini 4 Argon support: requests now use the Antigravity Hub User-Agent format, which the backend requires to list and serve newer models like
gemini-4-argon-*. The client version can now also be set in config (antigravityClientVersion/antigravityIdeVersion), and models with codename IDs are classified using the provider metadata the backend reports. - Security fix: web UI log viewer: log messages are now displayed as plain text instead of HTML. Before this, an upstream HTML error page, or a crafted request field that ended up in the logs, could inject styles or run scripts in the web console.
- Fix: tool schemas with non-string
const/enum: values likeconst: trueorenum: [1, 2, 3]are now converted to strings. They used to make every tool-enabled request fail with HTTP 400 on both Claude and Gemini models (#379). - Fix: hidden placeholder models: the backend now returns unusable
*-disabledIDs (e.g.gemini-4-argon-disabledon free-tier accounts), and these no longer appear in/v1/models.
Contributors
Thanks to @osmangokmenx for Gemini 4 Argon / Hub User-Agent support (#392), @helenanova for fixing HTML injection in the log viewer (#383), and @shifulegend for fixing non-string
const/enumtool schemas (#385)! - Gemini 4 Argon support: requests now use the Antigravity Hub User-Agent format, which the backend requires to list and serve newer models like
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Antigravity Claude Proxy
A proxy server that exposes an Anthropic-compatible API backed by Antigravity's Cloud Code, letting you use Claude and Gemini models with Claude Code CLI and OpenClaw / ClawdBot.

⚠️ WARNING: Google has been issuing ToS violation bans on accounts connected to this proxy. Use at your own risk.
[!CAUTION] Using this proxy may violate Google's Terms of Service. A small number of users have reported their Google accounts being banned or shadow-banned (restricted access without explicit notification).
By using this proxy, you acknowledge:
- This is an unofficial tool not endorsed by Google
- Your account may be suspended or permanently banned
- You assume all risks associated with using this proxy
Recommendation: Do not use your main account. Use a burner account instead, and optionally add it to your main account's family plan if needed.
How It Works
┌──────────────────┐ ┌─────────────────────┐ ┌────────────────────────────┐
│ Claude Code │────▶│ This Proxy Server │────▶│ Antigravity Cloud Code │
│ (Anthropic │ │ (Anthropic → Google│ │ (daily-cloudcode-pa. │
│ API format) │ │ Generative AI) │ │ sandbox.googleapis.com) │
└──────────────────┘ └─────────────────────┘ └────────────────────────────┘
- Receives requests in Anthropic Messages API format
- Uses OAuth tokens from added Google accounts (or Antigravity's local database)
- Transforms to Google Generative AI format with Cloud Code wrapping
- Sends to Antigravity's Cloud Code API
- Converts responses back to Anthropic format with full thinking/streaming support
Prerequisites
- Node.js 22.19.0 or later
- Antigravity installed (for single-account mode) OR Google account(s) for multi-account mode
Installation
Option 1: npm (Recommended)
# Run directly with npx (no install needed)
npx antigravity-claude-proxy@latest start
# Or install globally
npm install -g antigravity-claude-proxy@latest
antigravity-claude-proxy start
Option 2: Clone Repository
git clone https://github.com/badri-s2001/antigravity-claude-proxy.git
cd antigravity-claude-proxy
npm install
npm start
Quick Start
1. Start the Proxy Server
# If installed globally
acc start
# or: antigravity-claude-proxy start
# If using npx
npx antigravity-claude-proxy@latest start
# If cloned locally
npm start
The server launches as a background process on http://localhost:8080 by default and survives terminal closure.
| Command | Description |
|---|---|
acc start | Launch proxy in the background |
acc stop | Shut down the proxy |
acc restart | Restart the proxy |
acc status | Check proxy health and PID |
acc ui | Open the web dashboard |
acc start --log | Run in foreground with visible logs |
2. Link Account(s)
Choose one of the following methods to authorize the proxy:
Method A: Web Dashboard (Recommended)
- With the proxy running, open
http://localhost:8080in your browser. - Navigate to the Accounts tab and click Add Account.
- Complete the Google OAuth authorization in the popup window.
Headless/Remote Servers: If running on a server without a browser, the WebUI supports a "Manual Authorization" mode. After clicking "Add Account", you can copy the OAuth URL, complete authorization on your local machine, and paste the authorization code back.
Method B: CLI (Desktop or Headless)
If you prefer the terminal or are on a remote server:
# Desktop (opens browser)
antigravity-claude-proxy accounts add
# Headless (Docker/SSH)
antigravity-claude-proxy accounts add --no-browser
For full CLI account management options, run
antigravity-claude-proxy accounts --help.
Method C: Automatic (Antigravity Users)
If you have the Antigravity app installed and logged in, the proxy will automatically detect your local session. No additional setup is required.
To use a custom port:
PORT=3001 antigravity-claude-proxy start
3. Verify It's Working
# Health check
curl http://localhost:8080/health
# Check account status and quota limits
curl "http://localhost:8080/account-limits?format=table"
Using with Claude Code CLI
Configure Claude Code
You can configure these settings in two ways:
Via Web Console (Recommended)
- Open the WebUI at
http://localhost:8080. - Go to Settings → Claude CLI.
- Use the Connection Mode toggle to switch between:
- Proxy Mode: Uses the local proxy server (Antigravity Cloud Code). Configure models, base URL, and presets here.
- Paid Mode: Uses the official Anthropic Credits directly (requires your own subscription). This hides proxy settings to prevent accidental misconfiguration.
- Click Apply to Claude CLI to save your changes.
[!TIP] > Configuration Precedence: System environment variables (set in shell profile like
.zshrc) take precedence over thesettings.jsonfile. If you use the Web Console to manage settings, ensure you haven't manually exported conflicting variables in your terminal.
Manual Configuration
Create or edit the Claude Code settings file:
macOS: ~/.claude/settings.json
Linux: ~/.claude/settings.json
Windows: %USERPROFILE%\.claude\settings.json
Add this configuration:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "test",
"ANTHROPIC_BASE_URL": "http://localhost:8080",
"ANTHROPIC_MODEL": "claude-opus-4-6-thinking",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6-thinking",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-4-6",
"CLAUDE_CODE_SUBAGENT_MODEL": "claude-sonnet-4-6",
"ENABLE_EXPERIMENTAL_MCP_CLI": "true"
}
}
Or to use Gemini models:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "test",
"ANTHROPIC_BASE_URL": "http://localhost:8080",
"ANTHROPIC_MODEL": "gemini-3.1-pro-low",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gemini-3.1-pro-low",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gemini-3.5-flash-low",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gemini-3.5-flash-low",
"CLAUDE_CODE_SUBAGENT_MODEL": "gemini-3.5-flash-low",
"ENABLE_EXPERIMENTAL_MCP_CLI": "true"
}
}
Load Environment Variables
Add the proxy settings to your shell profile:
macOS / Linux:
echo 'export ANTHROPIC_BASE_URL="http://localhost:8080"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="test"' >> ~/.zshrc
source ~/.zshrc
For Bash users, replace
~/.zshrcwith~/.bashrc
Windows (PowerShell):
Add-Content $PROFILE "`n`$env:ANTHROPIC_BASE_URL = 'http://localhost:8080'"
Add-Content $PROFILE "`$env:ANTHROPIC_AUTH_TOKEN = 'test'"
. $PROFILE
Windows (Command Prompt):
setx ANTHROPIC_BASE_URL "http://localhost:8080"
setx ANTHROPIC_AUTH_TOKEN "test"
Restart your terminal for changes to take effect.
Run Claude Code
# Make sure the proxy is running first
antigravity-claude-proxy start
# In another terminal, run Claude Code
claude
Note: If Claude Code asks you to select a login method, add
"hasCompletedOnboarding": trueto~/.claude.json(macOS/Linux) or%USERPROFILE%\.claude.json(Windows), then restart your terminal and try again.
Proxy Mode vs. Paid Mode
Toggle in Settings → Claude CLI:
| Feature | 🔌 Proxy Mode | 💳 Paid Mode |
|---|---|---|
| Backend | Local Server (Antigravity) | Official Anthropic Credits |
| Cost | Free (Google Cloud) | Paid (Anthropic Credits) |
| Models | Claude + Gemini | Claude Only |
Paid Mode automatically clears proxy settings so you can use your official Anthropic account directly.
Multiple Claude Code Instances (Optional)
To run both the official Claude Code and Antigravity version simultaneously, add this alias:
macOS / Linux:
# Add to ~/.zshrc or ~/.bashrc
alias claude-antigravity='CLAUDE_CONFIG_DIR=~/.claude-account-antigravity ANTHROPIC_BASE_URL="http://localhost:8080" ANTHROPIC_AUTH_TOKEN="test" command claude'
Windows (PowerShell):
# Add to $PROFILE
function claude-antigravity {
$env:CLAUDE_CONFIG_DIR = "$env:USERPROFILE\.claude-account-antigravity"
$env:ANTHROPIC_BASE_URL = "http://localhost:8080"
$env:ANTHROPIC_AUTH_TOKEN = "test"
claude
}
Then run claude for official API or claude-antigravity for this proxy.
Running as a System Service (systemd)
When running as a systemd service, the proxy runs under a different user (e.g. root), so it can't find your Claude CLI settings at ~/.claude/settings.json. Set CLAUDE_CONFIG_PATH to point to the real user's .claude directory:
# /etc/systemd/system/antigravity-proxy.service
[Service]
Environment=CLAUDE_CONFIG_PATH=/home/youruser/.claude
ExecStart=/usr/bin/node /path/to/antigravity-claude-proxy/src/index.js
Without this, the WebUI's Claude CLI tab won't be able to read or write your Claude Code configuration.
Documentation
- Available Models
- Multi-Account Load Balancing
- Web Management Console
- Advanced Configuration
- macOS Menu Bar App
- OpenClaw / ClawdBot Integration
- API Endpoints
- Testing
- Troubleshooting
- Safety, Usage, and Risk Notices
- Legal
- Development
Credits
This project is based on insights and code from:
- opencode-antigravity-auth - Antigravity OAuth plugin for OpenCode
- claude-code-proxy - Anthropic API proxy using LiteLLM
License
MIT