Skip to content

About

Local OpenAI, Anthropic & Gemini API bridge for Antigravity — use Claude Sonnet/Opus 4.6, Gemini 3.7/3.6/3.5, and GPT-OSS with opencode, Claude Code, Cline & more

Topics

Resources

Stars

55 stars

Watchers

1 watching

Forks

Repository files navigation

AG (Antigravity) Local Bridge

Open VSX Version Open VSX Downloads GitHub Stars GitHub Issues License Buy Me A Coffee

Exposes your running Antigravity instance as a local OpenAI-compatible API on localhost:11435.

Use your Antigravity subscription with any tool that speaks OpenAI — opencode, aider, continue.dev, or plain curl.

How it Works

Your tool → HTTP :11435 → VS Code extension → Antigravity sidecar (ConnectRPC) → Cloud AI

The extension runs inside Antigravity's VS Code process, discovers the sidecar via process inspection, intercepts CSRF tokens from Antigravity's own traffic, and proxies your requests through the same authenticated channel Antigravity uses internally.

Features

  • Multi-Protocol API — drop-in compatible with OpenAI (/v1/chat/completions), Anthropic (/v1/messages), and Gemini (/v1beta/models/...)
  • 3-Way Streaming Strategy — configurable smart (instant low-TTFB pseudo-streaming for chat + raw for tools), raw (pure LLM completions & swarm), or cascade
  • Multi-Sidecar Swarm — automatic round-robin load balancing and quota pooling across multiple Google accounts
  • Multimedia Input Support — images, audio, video, and files forwarded through Antigravity's media channels
  • Function Calling & Tools — full support for client-side tool calling and structured outputs
  • Workspace-Aware — automatically detects and applies workspace context via x-workspace-dir / x-workspace-uri headers

Available Models

Model ID Description
antigravity-claude-sonnet-4-6 Claude Sonnet 4.6 with Thinking (default)
antigravity-claude-opus-4-6-thinking Claude Opus 4.6 with Thinking
antigravity-claude-opus-5-5-high Claude Opus 5.5 — High thinking
antigravity-claude-opus-5-5-medium Claude Opus 5.5 — Medium thinking
antigravity-claude-opus-5-5-low Claude Opus 5.5 — Low thinking
antigravity-claude-sonnet-5-5-high Claude Sonnet 5.5 — High thinking
antigravity-claude-sonnet-5-5-medium Claude Sonnet 5.5 — Medium thinking
antigravity-claude-sonnet-5-5-low Claude Sonnet 5.5 — Low thinking
antigravity-gemini-4-argon-high Gemini 4 Argon — High thinking
antigravity-gemini-4-argon-medium Gemini 4 Argon — Medium thinking
antigravity-gemini-4-argon-low Gemini 4 Argon — Low thinking
antigravity-gemini-4-hydrogen-xhigh Gemini 4 Hydrogen — XHigh thinking
antigravity-gemini-4-hydrogen-high Gemini 4 Hydrogen — High thinking
antigravity-gemini-4-hydrogen-medium Gemini 4 Hydrogen — Medium thinking
antigravity-gemini-4-hydrogen-low Gemini 4 Hydrogen — Low thinking
antigravity-gemini-4-carbon-high Gemini 4 Carbon — High thinking
antigravity-gemini-4-carbon-medium Gemini 4 Carbon — Medium thinking
antigravity-gemini-4-carbon-low Gemini 4 Carbon — Low thinking
antigravity-gemini-4-carbon Gemini 4 Carbon
antigravity-gemini-pro-orchestrator-g1-pro Orchestrator (Argon)
antigravity-gemini-3.8-flash-high Gemini 3.8 Flash — High thinking
antigravity-gemini-3.8-flash-medium Gemini 3.8 Flash — Medium thinking
antigravity-gemini-3.8-flash-low Gemini 3.8 Flash — Low thinking
antigravity-gemini-3.7-flash-high Gemini 3.7 Flash — High thinking
antigravity-gemini-3.7-flash-medium Gemini 3.7 Flash — Medium thinking
antigravity-gemini-3.7-flash-low Gemini 3.7 Flash — Low thinking
antigravity-gemini-3.6-flash-high Gemini 3.6 Flash — High thinking
antigravity-gemini-3.6-flash-medium Gemini 3.6 Flash — Medium thinking
antigravity-gemini-3.6-flash-low Gemini 3.6 Flash — Low thinking
antigravity-gemini-3.5-flash Gemini 3.5 Flash — High thinking
antigravity-gemini-3.5-flash-medium Gemini 3.5 Flash — Medium thinking
antigravity-gemini-3.5-flash-low Gemini 3.5 Flash — Low thinking
antigravity-gemini-3-flash Gemini 3 Flash
antigravity-gemini-3.1-pro-high Gemini 3.1 Pro — High thinking
antigravity-gemini-3.1-pro-low Gemini 3.1 Pro — Low thinking
antigravity-gpt-oss-120b GPT-OSS 120B Medium

Short aliases: All models can also be referenced with intuitive short names like gemini-3.8, gemini-3.8-flash, gemini-3.7, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash, gemini-3.1-pro, claude-sonnet-4-6, claude-opus-4-6-thinking, etc.

Installation

From Open VSX (recommended)

  1. Open Antigravity
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "AG Local Bridge" by marcodiniz
  4. Click Install
  5. Reload Antigravity (Ctrl+Shift+P → Developer: Reload Window)

Manual install

  1. Clone into your Antigravity extensions directory:

    # Windows
    git clone https://github.com/marcodiniz/ag-local-bridge "%USERPROFILE%\.antigravity\extensions\ag-local-bridge-1.0.0-universal"
    
    # macOS / Linux
    git clone https://github.com/marcodiniz/ag-local-bridge ~/.antigravity/extensions/ag-local-bridge-1.0.0-universal
  2. Reload Antigravity (Ctrl+Shift+P → Developer: Reload Window)

Verify

Look for "AG Local Bridge" in the Output panel — you should see:

✅ Server running on http://localhost:11435

Usage

With opencode

Add to ~/.config/opencode/opencode.json:

{
  "provider": {
    "ag-local-bridge": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "AG Local Bridge",
      "options": {
        "baseURL": "http://localhost:11435/v1",
        "apiKey": "local"
      },
      "models": {
        "antigravity-claude-sonnet-4-6": {
          "name": "Claude Sonnet 4.6 (Antigravity)",
          "modalities": { "input": ["text", "image", "audio", "video", "file"], "output": ["text"] },
          "limit": { "context": 200000, "output": 64000 }
        },
        "antigravity-claude-opus-4-6-thinking": {
          "name": "Claude Opus 4.6 Thinking (Antigravity)",
          "modalities": { "input": ["text", "image", "audio", "video", "file"], "output": ["text"] },
          "limit": { "context": 200000, "output": 64000 }
        },
        "antigravity-gemini-3.1-pro-high": {
          "name": "Gemini 3.1 Pro High (Antigravity)",
          "modalities": { "input": ["text", "image", "audio", "video", "file"], "output": ["text"] },
          "limit": { "context": 1048576, "output": 65535 }
        },
        "antigravity-gemini-3.1-pro-low": {
          "name": "Gemini 3.1 Pro Low (Antigravity)",
          "modalities": { "input": ["text", "image", "audio", "video", "file"], "output": ["text"] },
          "limit": { "context": 1048576, "output": 65535 }
        },
        "antigravity-gemini-3-flash": {
          "name": "Gemini 3 Flash (Antigravity)",
          "modalities": { "input": ["text", "image", "audio", "video", "file"], "output": ["text"] },
          "limit": { "context": 1048576, "output": 65536 }
        },
        "antigravity-gpt-oss-120b": {
          "name": "GPT-OSS 120B Medium (Antigravity)",
          "modalities": { "input": ["text", "image", "audio", "video", "file"], "output": ["text"] },
          "limit": { "context": 128000, "output": 16384 }
        }
      }
    }
  }
}

Then select ag-local-bridge/antigravity-claude-sonnet-4-6 as your model.

Media support: The modalities field enables image/audio/video/file input in clients that expose those attachments. Text-only requests use the faster raw inference path; requests with media use the Antigravity Cascade media channel.

With curl

# List models
curl http://localhost:11435/v1/models

# Chat completion
curl http://localhost:11435/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "antigravity-claude-sonnet-4-6",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": false
  }'

# Streaming
curl http://localhost:11435/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "antigravity-gemini-3.1-pro-high",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'

# With image (base64 data URL)
curl http://localhost:11435/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "antigravity-claude-sonnet-4-6",
    "messages": [{"role": "user", "content": [
      {"type": "text", "text": "What do you see?"},
      {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBOR..."}}
    ]}],
    "stream": false
  }'

# Responses API
curl http://localhost:11435/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "antigravity-claude-sonnet-4-6",
    "input": "Hello from the Responses API"
  }'

With any OpenAI-compatible client

Base URL: http://localhost:11435/v1
API Key:  anything (not validated)

API Endpoints

OpenAI Endpoints

Method Path Description
GET /v1/models List available models in OpenAI format
POST /v1/chat/completions Chat completion (streaming & non-streaming)
POST /v1/responses OpenAI Responses API adapter

Anthropic Endpoints

Method Path Description
POST /v1/messages Anthropic Messages API (streaming & tools)
POST /v1/messages/count_tokens Preflight token count mock (for Claude CLI)

Gemini Endpoints

Method Path Description
GET /v1beta/models List models in Gemini format
POST /v1beta/models/:model:generateContent Gemini Native generateContent
POST /v1beta/models/:model:streamGenerateContent Gemini Native streaming endpoint

Utility & Debug Endpoints

Method Path Description
POST /v1/proxy Forward arbitrary RPC to sidecar
GET /v1/debug Debug info (sidecar ports, CSRF, captures)

Multimedia Support

Media sent via OpenAI chat content parts or Responses input items is handled as follows:

  1. Base64 data URLs (data:image/png;base64,..., data:audio/wav;base64,..., etc.) — decoded and forwarded inline
  2. Remote URLs (https://...) — downloaded, then forwarded inline
  3. File URIs (file:///C:/path/to/media.mp4) — read directly from disk
  4. Responses items (input_image, input_audio, input_file) — converted to the same media channel

The sidecar ultimately decides which model/media combinations are accepted. Unsupported media types will surface as upstream provider errors.

Workspace Context

Pass workspace context via HTTP headers:

Header Description
x-workspace-dir Absolute filesystem path (e.g. C:\code\myproject)
x-workspace-uri File URI (e.g. file:///C:/code/myproject)

When set, the bridge switches the active VS Code workspace folder before creating a Cascade, ensuring the agent operates in the correct project context.

Architecture

The extension uses a 2-tier fallback strategy:

  1. Tier 1 — Sidecar ConnectRPC (preferred): Discovers the Antigravity sidecar process, connects via HTTP/2 with CSRF authentication, and uses the Cascade API (StartCascade → SendUserCascadeMessage → poll GetCascadeTrajectory). Conversations are multiplexed and the active workspace is auto-detected.

  2. Tier 2 — Command Dispatch: Last resort — fires the message through antigravity.executeCascadeAction.

Commands

Command Description
AG Local Bridge: Start Server Start the HTTP server
AG Local Bridge: Stop Server Stop the HTTP server
AG Local Bridge: Show Status Display connection status
AG Local Bridge: Probe Sidecar Test sidecar connectivity
AG Local Bridge: List Available LM Models List configured models and sidecar status
AG Local Bridge: List Available Chat Commands (Debug) List chat commands available for debugging

Configuration

Setting Default Description
agLocalBridge.port 11435 HTTP server port
agLocalBridge.logRequests false Log request/response details
agLocalBridge.streamingMode "smart" Streaming strategy: 'smart' (low-TTFB Cascade pseudo-streaming for chat, Raw for tools), 'raw' (strictly GetModelResponse unary inference), or 'cascade' (forced trajectory delta streaming)

Requirements

  • Antigravity installed and running
  • Active Antigravity subscription (Free/Pro/Teams/Enterprise)

Contributing

We use a beta → master release flow:

Branch Role Publishes as
beta Default / development Pre-release
master Stable releases only Stable
  1. Fork & branch off beta (the default branch).
  2. Open your PR against beta — GitHub will target it automatically.
  3. Once merged, a pre-release is published to Open VSX for beta testers.
  4. When a beta build is ready for general availability, the maintainer merges beta → master to cut a stable release.

Note: master is protected — direct pushes are not allowed. All changes flow through beta first.

License

MIT

About

Local OpenAI, Anthropic & Gemini API bridge for Antigravity — use Claude Sonnet/Opus 4.6, Gemini 3.7/3.6/3.5, and GPT-OSS with opencode, Claude Code, Cline & more

Topics

Resources

Stars

55 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages