Sandbox
@badrisnarayanan/antigravity-claude-proxy

Anthropic API proxy for Claude Code and OpenClaw

This proxy accepts Anthropic Messages API requests and forwards them to Antigravity Cloud Code, then returns the result in Anthropic format. It also includes a CLI, a web dashboard, account management, and model settings for Claude Code and related clients.

3,957 stars555 forksJavaScriptUpdated 11d ago
Who it's for

Builders who want Claude Code or OpenClaw to use Antigravity-backed Claude and Gemini models through a local proxy.

What it delivers

You can keep using an Anthropic-compatible client while routing requests through Antigravity instead of the official Claude API.

What it does

Anthropic-compatible proxy

Accepts Anthropic Messages API requests and converts them to Antigravity Cloud Code calls.

Claude Code setup

Provides settings and environment variable examples for pointing Claude Code at the local proxy.

Account management

Adds Google account linking, OAuth flow support, and account status checks.

Web console

Includes a browser UI for accounts, settings, health, and Claude CLI configuration.

Load balancing and fallback

Supports multiple accounts and documented load-balancing behavior.

OpenClaw integration

Documents how to connect the proxy to OpenClaw / ClawdBot.

How to get it

  1. 1Run
    # 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
  2. 2Run
    git clone https://github.com/badri-s2001/antigravity-claude-proxy.git
    cd antigravity-claude-proxy
    npm install
    npm start
  3. 3If 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
  4. 4To use a custom port
    PORT=3001 antigravity-claude-proxy start
  5. 5Run
    # Health check
    curl http://localhost:8080/health
    
    # Check account status and quota limits
    curl "http://localhost:8080/account-limits?format=table"

README

Antigravity Claude Proxy

npm version npm downloads License: MIT

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.

Antigravity Claude Proxy Banner

⚠️ WARNING: Google has been issuing ToS violation bans on accounts connected to this proxy. Use at your own risk.

⚠️ Terms of Service Warning — Read Before Installing

[!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)  │
└──────────────────┘     └─────────────────────┘     └────────────────────────────┘
  1. Receives requests in Anthropic Messages API format
  2. Uses OAuth tokens from added Google accounts (or Antigravity's local database)
  3. Transforms to Google Generative AI format with Cloud Code wrapping
  4. Sends to Antigravity's Cloud Code API
  5. Converts responses back to Anthropic format with full thinking/streaming support

Prerequisites

  • Node.js 18 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.

CommandDescription
acc startLaunch proxy in the background
acc stopShut down the proxy
acc restartRestart the proxy
acc statusCheck proxy health and PID
acc uiOpen the web dashboard
acc start --logRun in foreground with visible logs

2. Link Account(s)

Choose one of the following methods to authorize the proxy:

Method A: Web Dashboard (Recommended)

  1. With the proxy running, open http://localhost:8080 in your browser.
  2. Navigate to the Accounts tab and click Add Account.
  3. 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)

  1. Open the WebUI at http://localhost:8080.
  2. Go to SettingsClaude CLI.
  3. 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.
  4. Click Apply to Claude CLI to save your changes.

[!TIP] > Configuration Precedence: System environment variables (set in shell profile like .zshrc) take precedence over the settings.json file. 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 ~/.zshrc with ~/.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": true to ~/.claude.json (macOS/Linux) or %USERPROFILE%\.claude.json (Windows), then restart your terminal and try again.

Proxy Mode vs. Paid Mode

Toggle in SettingsClaude CLI:

Feature🔌 Proxy Mode💳 Paid Mode
BackendLocal Server (Antigravity)Official Anthropic Credits
CostFree (Google Cloud)Paid (Anthropic Credits)
ModelsClaude + GeminiClaude 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


Credits

This project is based on insights and code from:


License

MIT


Buy Me A Coffee

Star History

Star History Chart

Files in the repo

Repository payload18 top-level entries
  • .github
  • bin
  • docs
  • images
  • public
  • src
  • tests
  • .gitattributes
  • .gitignore
  • .npmignore
  • CLAUDE.md
  • config.example.json
  • LICENSE
  • package-lock.json
  • package.json
  • postcss.config.js
  • README.md
  • tailwind.config.js

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k