Skip to content

Latest commit

 

History

History
265 lines (188 loc) · 6.01 KB

File metadata and controls

265 lines (188 loc) · 6.01 KB

Antigravity Setup Guide

Track your Antigravity AI model quota usage with onWatch.


What is Antigravity?

Antigravity is an AI coding assistant that provides access to multiple AI models including Claude, Gemini, and GPT variants. onWatch can monitor your model quotas by connecting to the locally running Antigravity language server process.


Prerequisites

  • Antigravity installed and running
  • onWatch installed (Quick Start)

How It Works

onWatch automatically detects the Antigravity language server running on your machine by:

  1. Scanning for the antigravity process
  2. Extracting the CSRF token and port from command-line arguments
  3. Connecting via the Connect RPC protocol
  4. Polling the /exa.language_server_pb.LanguageServerService/GetUserStatus endpoint

No manual configuration is required for local development.


Quick Start (Auto-Detection)

Step 1: Enable Antigravity in onWatch

Add to your .env file:

cd ~/.onwatch

Edit .env and add:

ANTIGRAVITY_ENABLED=true

Or set it as an environment variable:

export ANTIGRAVITY_ENABLED=true

Step 2: Restart onWatch

onwatch stop
onwatch

Or in debug mode to verify:

onwatch --debug

You should see:

Antigravity auto-detection enabled (process scanning mode)
Starting Antigravity agent (interval: 60s)
connected to Antigravity language server port=63516 protocol=https

Step 3: View Dashboard

Open http://localhost:9211 and click the antigravity tab.

You'll see quota cards for each model, including:

  • Claude Sonnet
  • Gemini Pro
  • GPT-4 variants
  • And other available models

Docker/Container Configuration

In containerized environments where process scanning doesn't work, you can manually configure the connection:

Environment Variables

Variable Description Example
ANTIGRAVITY_ENABLED Enable Antigravity provider true
ANTIGRAVITY_BASE_URL Base URL of the language server https://127.0.0.1:42100
ANTIGRAVITY_CSRF_TOKEN CSRF token from the process your_csrf_token_here

Example Docker Compose

services:
  onwatch:
    image: ghcr.io/onllm-dev/onwatch:latest
    environment:
      - ANTIGRAVITY_ENABLED=true
      - ANTIGRAVITY_BASE_URL=https://host.docker.internal:42100
      - ANTIGRAVITY_CSRF_TOKEN=your_csrf_token
    ports:
      - "9211:9211"

Finding the Port and Token

On the host machine, find the running Antigravity process:

# macOS/Linux
ps aux | grep antigravity | grep -E "csrf_token|extension_server_port"

# Example output:
# /path/to/antigravity --csrf_token=abc123 --extension_server_port=42100

Extract the values:

  • --extension_server_port=42100 - Use as the port in ANTIGRAVITY_BASE_URL
  • --csrf_token=abc123 - Use as ANTIGRAVITY_CSRF_TOKEN

What Gets Tracked

Metric Description
Model Quotas Per-model remaining fraction (0.0 to 1.0)
Reset Times When each model's quota resets
Prompt Credits Available credits for your plan
Plan Info Your subscription tier (Free, Pro, etc.)

The dashboard shows:

  • Usage percentage for each AI model
  • Remaining quota with color indicators
  • Reset countdown timers
  • Usage history and projections

Supported Models

onWatch tracks all models available in your Antigravity subscription:

Model ID Display Name
claude-4-5-sonnet Claude 4.5 Sonnet
claude-4-5-sonnet-thinking Claude 4.5 Sonnet (Thinking)
gemini-3-pro Gemini 3 Pro
gemini-3-flash Gemini 3 Flash
(others) Automatically detected

Troubleshooting

"Antigravity agent not starting"

  1. Verify Antigravity is running:

    ps aux | grep antigravity
  2. Check if the process has the required arguments:

    ps aux | grep antigravity | grep csrf_token
  3. Ensure ANTIGRAVITY_ENABLED=true is set

"No models showing"

  • Make sure you're logged into Antigravity
  • Check that your subscription is active
  • Run onWatch in debug mode: onwatch --debug

"Connection refused"

The language server might be using a self-signed certificate. onWatch handles this automatically, but if you're using manual configuration:

  • Ensure the port is correct
  • Try both https:// and http:// protocols
  • Check firewall settings

"CSRF token invalid"

The token changes when Antigravity restarts. For auto-detection mode, restart onWatch after restarting Antigravity:

onwatch stop && onwatch

For manual configuration, update ANTIGRAVITY_CSRF_TOKEN with the new value.


API Details

onWatch uses the Connect RPC protocol to communicate with the Antigravity language server:

Endpoint:

POST /exa.language_server_pb.LanguageServerService/GetUserStatus

Headers:

Content-Type: application/json
Connect-Protocol-Version: 1
X-Codeium-Csrf-Token: <token>

Response structure:

{
  "userStatus": {
    "email": "user@example.com",
    "planStatus": {
      "availablePromptCredits": 500,
      "planInfo": {
        "planName": "Pro",
        "monthlyPromptCredits": 1000
      }
    },
    "cascadeModelConfigData": {
      "clientModelConfigs": [
        {
          "label": "Claude Sonnet",
          "modelOrAlias": {"model": "claude-4-5-sonnet"},
          "quotaInfo": {
            "remainingFraction": 0.75,
            "resetTime": "2026-02-24T12:00:00Z"
          }
        }
      ]
    }
  }
}

Security Notes

  • onWatch connects only to localhost (or your configured URL)
  • The CSRF token is never sent to external servers
  • All data stays on your machine (SQLite database)
  • Auto-detection only reads process arguments, not memory

See Also