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.
┌──────────────────┐ ┌─────────────────────┐ ┌────────────────────────────┐
│ 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
- Node.js 18 or later
- Antigravity installed (for single-account mode) OR Google account(s) for multi-account mode
# 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 startgit clone https://github.com/badri-s2001/antigravity-claude-proxy.git
cd antigravity-claude-proxy
npm install
npm start# If installed via npm
antigravity-claude-proxy start
# If using npx
npx antigravity-claude-proxy@latest start
# If cloned locally
npm startThe server runs on http://localhost:8080 by default.
Choose one of the following methods to authorize the proxy:
- 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.
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-browserFor full CLI account management options, run
antigravity-claude-proxy accounts --help.
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# Health check
curl http://localhost:8080/health
# Check account status and quota limits
curl "http://localhost:8080/account-limits?format=table"You can configure these settings in two ways:
- Open the WebUI at
http://localhost:8080. - Go to Settings → Claude CLI.
- Select your preferred models and click Apply to Claude CLI.
[!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.
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-5-thinking",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5-thinking",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5-thinking",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gemini-2.5-flash-lite[1m]",
"CLAUDE_CODE_SUBAGENT_MODEL": "claude-sonnet-4-5-thinking",
"ENABLE_EXPERIMENTAL_MCP_CLI": "true"
}
}(Please use gemini-2.5-flash-lite as the default haiku model, even if others are claude, as claude code makes several calls via the haiku model for background tasks. If you use claude model for it, you may use you claude usage sooner)
Or to use Gemini models:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "test",
"ANTHROPIC_BASE_URL": "http://localhost:8080",
"ANTHROPIC_MODEL": "gemini-3-pro-high[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gemini-3-pro-high[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gemini-3-flash[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gemini-2.5-flash-lite[1m]",
"CLAUDE_CODE_SUBAGENT_MODEL": "gemini-3-flash[1m]",
"ENABLE_EXPERIMENTAL_MCP_CLI": "true"
}
}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 ~/.zshrcFor 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'"
. $PROFILEWindows (Command Prompt):
setx ANTHROPIC_BASE_URL "http://localhost:8080"
setx ANTHROPIC_AUTH_TOKEN "test"Restart your terminal for changes to take effect.
# Make sure the proxy is running first
antigravity-claude-proxy start
# In another terminal, run Claude Code
claudeNote: 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.
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.
| Model ID | Description |
|---|---|
claude-sonnet-4-5-thinking |
Claude Sonnet 4.5 with extended thinking |
claude-opus-4-5-thinking |
Claude Opus 4.5 with extended thinking |
claude-sonnet-4-5 |
Claude Sonnet 4.5 without thinking |
| Model ID | Description |
|---|---|
gemini-3-flash |
Gemini 3 Flash with thinking |
gemini-3-pro-low |
Gemini 3 Pro Low with thinking |
gemini-3-pro-high |
Gemini 3 Pro High with thinking |
Gemini models include full thinking support with thoughtSignature handling for multi-turn conversations.
When you add multiple accounts, the proxy automatically:
- Sticky account selection: Stays on the same account to maximize prompt cache hits
- Smart rate limit handling: Waits for short rate limits (≤2 min), switches accounts for longer ones
- Automatic cooldown: Rate-limited accounts become available after reset time expires
- Invalid account detection: Accounts needing re-authentication are marked and skipped
- Prompt caching support: Stable session IDs enable cache hits across conversation turns
Check account status, subscription tiers, and quota anytime:
# Web UI: http://localhost:8080/ (Accounts tab - shows tier badges and quota progress)
# CLI Table:
curl "http://localhost:8080/account-limits?format=table"If you prefer using the terminal for management:
# List all accounts
antigravity-claude-proxy accounts list
# Verify account health
antigravity-claude-proxy accounts verify
# Interactive CLI menu
antigravity-claude-proxy accountsThe proxy includes a built-in, modern web interface for real-time monitoring and configuration. Access the console at: http://localhost:8080 (default port).
- Real-time Dashboard: Monitor request volume, active accounts, model health, and subscription tier distribution.
- Visual Model Quota: Track per-model usage and next reset times with color-coded progress indicators.
- Account Management: Add/remove Google accounts via OAuth, view subscription tiers (Free/Pro/Ultra) and quota status at a glance.
- Claude CLI Configuration: Edit your
~/.claude/settings.jsondirectly from the browser. - Persistent History: Tracks request volume by model family for 30 days, persisting across server restarts.
- Time Range Filtering: Analyze usage trends over 1H, 6H, 24H, 7D, or All Time periods.
- Smart Analysis: Auto-select top 5 most used models or toggle between Family/Model views.
- Live Logs: Stream server logs with level-based filtering and search.
- Advanced Tuning: Configure retries, timeouts, and debug mode on the fly.
- Bilingual Interface: Full support for English and Chinese (switch via Settings).
While most users can use the default settings, you can tune the proxy behavior via the Settings → Server tab in the WebUI or by creating a config.json file.
- API Key Authentication: Protect
/v1/*API endpoints withAPI_KEYenv var orapiKeyin config. - WebUI Password: Secure your dashboard with
WEBUI_PASSWORDenv var or in config. - Custom Port: Change the default
8080port. - Retry Logic: Configure
maxRetries,retryBaseMs, andretryMaxMs. - Load Balancing: Adjust
defaultCooldownMsandmaxWaitBeforeErrorMs. - Persistence: Enable
persistTokenCacheto save OAuth sessions across restarts.
Refer to config.example.json for a complete list of fields and documentation.
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/account-limits |
GET | Account status and quota limits (add ?format=table for ASCII table) |
/v1/messages |
POST | Anthropic Messages API |
/v1/models |
GET | List available models |
/refresh-token |
POST | Force token refresh |
Run the test suite (requires server running):
# Start server in one terminal
npm start
# Run tests in another terminal
npm testIndividual tests:
npm run test:signatures # Thinking signatures
npm run test:multiturn # Multi-turn with tools
npm run test:streaming # Streaming SSE events
npm run test:interleaved # Interleaved thinking
npm run test:images # Image processing
npm run test:caching # Prompt cachingIf using single-account mode with Antigravity:
- Make sure Antigravity app is installed and running
- Ensure you're logged in to Antigravity
Or add accounts via OAuth instead: antigravity-claude-proxy accounts add
The token might have expired. Try:
curl -X POST http://localhost:8080/refresh-tokenOr re-authenticate the account:
antigravity-claude-proxy accountsWith multiple accounts, the proxy automatically switches to the next available account. With a single account, you'll need to wait for the rate limit to reset.
Re-authenticate the account:
antigravity-claude-proxy accounts
# Choose "Re-authenticate" for the invalid account- Personal / internal development only
- Respect internal quotas and data handling policies
- Not for production services or bypassing intended limits
- Production application traffic
- High-volume automated extraction
- Any use that violates Acceptable Use Policies
By using this software, you acknowledge and accept the following:
-
Terms of Service risk: This approach may violate the Terms of Service of AI model providers (Anthropic, Google, etc.). You are solely responsible for ensuring compliance with all applicable terms and policies.
-
Account risk: Providers may detect this usage pattern and take punitive action, including suspension, permanent ban, or loss of access to paid subscriptions.
-
No guarantees: Providers may change APIs, authentication, or policies at any time, which can break this method without notice.
-
Assumption of risk: You assume all legal, financial, and technical risks. The authors and contributors of this project bear no responsibility for any consequences arising from your use.
Use at your own risk. Proceed only if you understand and accept these risks.
-
Not affiliated with Google or Anthropic. This is an independent open-source project and is not endorsed by, sponsored by, or affiliated with Google LLC or Anthropic PBC.
-
"Antigravity", "Gemini", "Google Cloud", and "Google" are trademarks of Google LLC.
-
"Claude" and "Anthropic" are trademarks of Anthropic PBC.
-
Software is provided "as is", without warranty. You are responsible for complying with all applicable Terms of Service and Acceptable Use Policies.
This project uses a local Tailwind CSS build system. CSS is pre-compiled and included in the repository, so you can run the project immediately after cloning.
git clone https://github.com/badri-s2001/antigravity-claude-proxy.git
cd antigravity-claude-proxy
npm install # Automatically builds CSS via prepare hook
npm start # Start server (no rebuild needed)If you need to modify styles in public/css/src/input.css:
# Option 1: Build once
npm run build:css
# Option 2: Watch for changes (auto-rebuild)
npm run watch:css
# Option 3: Watch both CSS and server (recommended)
npm run dev:fullFile Structure:
public/css/src/input.css- Source CSS with Tailwind@applydirectives (edit this)public/css/style.css- Compiled & minified CSS (auto-generated, don't edit)tailwind.config.js- Tailwind configurationpostcss.config.js- PostCSS configuration
If you're only working on backend code and don't need frontend dev tools:
npm install --production # Skip devDependencies (saves ~20MB)
npm startNote: Pre-compiled CSS is committed to the repository, so you don't need to rebuild unless modifying styles.
See CLAUDE.md for detailed architecture documentation, including:
- Request flow and module organization
- Frontend architecture (Alpine.js + Tailwind)
- Service layer patterns (
ErrorHandler.withLoading,AccountActions) - Dashboard module documentation
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
MIT


