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)

v3.0.0发布于 2026-11-07 12:03 UTC4,050star +5 / 7 天575fork同步于 2026-11-10 17:40 UTC

怎么上手

由 README 提炼,执行前请确认
npx antigravity-claude-proxy@latest start
硬件要求按 README 说明

README 未说明硬件要求,仅要求 Node.js 22.19.0 或更高版本,并需安装 Antigravity 或提供 Google 账号

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把 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 配置

容易踩的坑

使用该代理可能违反 Google 服务条款,已有账号被封或影子封禁的报告,建议用小号;默认监听 8080 端口,需与 Claude Code 的 ANTHROPIC_BASE_URL 保持一致;以 systemd 运行时需设置 CLAUDE_CONFIG_PATH 指向真实用户的 .claude 目录,否则 WebUI 读写不到 Claude CLI 配置

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v3.0.0
  1. 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 --version and 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-addr upgraded to 2.0.8 (CVE-2026-90711), and npm audit now 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-addr security upgrade for CVE-2026-90711 (#407)!

  2. 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.json so 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 with ANTIGRAVITY_SIGNATURE_STORE.
    • Correct token usage reporting: streamed responses now report the final input_tokens in message_delta instead of an early estimate that left out cached tokens (#389). output_tokens now 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)!

  3. 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 convertAnthropicToGoogle are 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 older claude-3-5/3-7-sonnet IDs) 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)!

  4. 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 thoughtSignature now 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)!

  5. 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 like const: true or enum: [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 *-disabled IDs (e.g. gemini-4-argon-disabled on 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/enum tool schemas (#385)!

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    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.

    [!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 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.

    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 Settings → Claude 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 Settings → Claude 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


    Star History

    Star History Chart