Skip to main content

Antigravity Provider

Access premium AI models (Claude Opus 4.6, Claude Sonnet 4.6, Gemini 3 Pro) through Antigravity’s OAuth-based platform. Features real-time quota monitoring and multi-account support.

Overview

Antigravity provides access to Claude and Gemini models through a subscription service. CCS integrates seamlessly with OAuth authentication and real-time quota tracking. Provider Identifier: agy Command: ccs agy Supported Models:
  • Claude Opus 4.6 Thinking (default) - Latest flagship with extended thinking
  • Claude Opus 4.6 - Latest flagship standard
  • Claude Sonnet 4.6 Thinking - Balanced with extended thinking
  • Claude Sonnet 4.6 - Fast and capable
  • Gemini 3 Pro - Google’s latest model via Antigravity
  • Interactive model picker via --config
Claude 4.5 model IDs are deprecated in AGY as of v7.51. Existing sessions referencing 4.5 model IDs are automatically migrated to their 4.6 equivalents. Re-run ccs doctor --fix if you see 502 errors after upgrading.

Authentication

First-Time Setup

# Run Antigravity for the first time
ccs agy "analyze this code"

# Browser opens automatically
# → Complete OAuth login
# → Token cached at ~/.ccs/cliproxy/auth/
# → Future runs require no re-auth
Authentication Flow:
  1. Authorization Code flow via browser callback
  2. OAuth tokens include project_id for quota API access
  3. Token cached locally with auto-refresh
  4. Proactive token refresh prevents mid-request failures

Manual Authentication

# Authenticate without starting a session
ccs agy --auth

# Headless mode (server/SSH environments)
ccs agy --headless
# → Displays URL for manual browser authentication
# → Includes SSH tunnel instructions if needed

Logout

# Clear all Antigravity tokens
ccs agy --logout

Real-Time Quota Display

Unique Feature: CCS displays real-time quota percentages for Antigravity accounts.
# Quota checked automatically before execution
ccs agy "your prompt"

# Output before Claude starts:
# [i] Antigravity Quota:
#     Claude Opus 4.5 Thinking: 85% used (resets 2024-01-05 23:59:59 UTC)
#     Gemini 3 Pro: 42% used (resets 2024-01-05 23:59:59 UTC)
Quota API Integration:
  • Fetches from Antigravity internal API
  • Displays usage percentage (0-100%)
  • Shows reset time for each model
  • Auto-refreshes tokens if expired
Error Handling:
  • 403 Forbidden: Account lacks quota access (displays warning)
  • Unprovisioned: Account not activated in Antigravity app (prompts to sign in)
  • Token Expired: Auto-refreshes via Google OAuth

Multi-Account Support

Manage multiple Antigravity accounts for quota rotation:

Add Account

# Add new account (preserves existing)
ccs agy --auth --add

List Accounts

# Show all authenticated Antigravity accounts
ccs agy --accounts

# Output:
# Accounts for agy:
#   [default] work (work@company.com) - Quota: 85%
#   personal (personal@gmail.com) - Quota: 12%

Switch Account

# Switch to specific account by nickname
ccs agy --use personal

# Next command uses personal's account
ccs agy "your prompt"

Rename Account

# Rename default account nickname
ccs agy --nickname main-account
Account Registry: ~/.ccs/cliproxy/accounts.json Auto-Nicknames: Generated from email prefix (e.g., john@gmail.comjohn)

Model Configuration

Antigravity supports interactive model selection with extended context support:
# Open model picker
ccs agy --config

# Interactive menu appears:
# Available models for Antigravity:
# 1. Claude Opus 4.6 Thinking (Recommended, default)
# 2. Claude Opus 4.6
# 3. Claude Sonnet 4.6 Thinking
# 4. Claude Sonnet 4.6
# 5. Gemini 3 Pro
# 6. Gemini 3 Pro Preview
# Select model [1-6]:
Model Settings: ~/.ccs/agy.settings.json First-Run Behavior: Prompts for model selection before first execution Extended Context Support:
  • Claude Opus 4.6: Use --1m flag for 1M token window (opt-in)
  • Gemini 3 Pro: 1M token window auto-enabled by default
  • Other models: Standard context windows
Auto-Rotation: CLIProxyAPI can auto-rotate accounts on rate limit (configured in config.yaml)

Commands

Basic Usage

# Run with Antigravity
ccs agy "explain this architecture"

# Interactive chat
ccs agy

Authentication Flags

FlagDescription
--authTrigger OAuth flow (no session)
--logoutClear all tokens
--headlessDisplay URL for remote auth
--auth --addAdd new account (keep existing)

Account Management Flags

FlagDescription
--accountsList all accounts with quota info
--use <nickname>Switch default account
--nickname <name>Rename default account

Configuration Flags

FlagDescription
--configInteractive model picker

Storage Locations

PathPurpose
~/.ccs/cliproxy/auth/antigravity-*.jsonOAuth tokens (one per account)
~/.ccs/cliproxy/accounts.jsonAccount registry with nicknames
~/.ccs/agy.settings.jsonModel configuration
~/.ccs/cliproxy/config.yamlCLIProxy unified config

Quota Management

Pre-flight Check

CCS checks account quota before starting sessions:
# Automatic quota check before execution
ccs agy "your prompt"
# → Checks all accounts, selects healthiest one
# → Skips exhausted or paused accounts
Configuration:
# config.yaml
quota_management:
  mode: hybrid  # auto | manual | hybrid
  auto:
    preflight_check: true      # Check before request
    exhaustion_threshold: 5    # Skip accounts below 5%
    tier_priority: ["paid"]    # Prefer paid accounts
    cooldown_minutes: 5        # Skip exhausted for 5min

Pause/Resume Accounts

Manually control which accounts are used:
# Pause an account from rotation
ccs cliproxy pause agy user@gmail.com

# Resume a paused account
ccs cliproxy resume agy user@gmail.com

# Check status of all accounts
ccs cliproxy status agy
Dashboard: Pause/resume toggles also available in web dashboard account dropdown.

Project ID Display

Dashboard shows GCP project_id for each Antigravity account:
  • Location: OAuth Providers → Antigravity → Account dropdown
  • Field: Read-only with folder icon (FolderCode)
  • Privacy: Respects privacy blur mode (Settings → Privacy)
  • Tooltip: “GCP Project ID (read-only)”
Warning State: If project_id shows “N/A” with warning badge:
  • Cause: Account authenticated before project_id tracking
  • Impact: Quota API calls may fail
  • Solution: Re-authenticate to refresh token with project_id
# Fix missing project_id
ccs agy --logout
ccs agy --auth
# Verify in Dashboard: OAuth Providers → Antigravity

Account Tiers

Antigravity accounts have tier classifications for quota prioritization: Tier Types:
TierDescriptionPriority
ultraPremium tier with highest limitsHighest
proProfessional tier with standard limitsMedium
freeFree tier with limited quotaLowest
unknownTier detection failedLowest
Tier Storage: ~/.ccs/cliproxy/accounts.json.providers.agy.accounts[].tier Tier Prioritization: CCS uses tier information for intelligent account selection:
# config.yaml
quota_management:
  auto:
    tier_priority: ["ultra", "pro", "free"]  # Selection order
When multiple accounts are available, CCS prefers higher-tier accounts:
  1. Select accounts with quota above threshold
  2. Sort by tier (ultra, pro, free — highest first)
  3. Use highest-tier account with available quota
Dashboard Display: Tier badges appear in:
  • Account list (ccs agy --accounts)
  • Dashboard OAuth Providers → Antigravity dropdown
  • Quota status cards
Tier Detection: Tiers are set manually via accounts.json or Dashboard UI. CCS does not auto-detect tier from Antigravity API.

Token Format

{
  "type": "antigravity",
  "access_token": "...",
  "refresh_token": "...",
  "email": "user@example.com",
  "expired": "2024-12-31T23:59:59Z",
  "project_id": "..."
}
Project ID: Required for quota API calls, obtained during OAuth flow

Quota API Endpoints

CCS uses Antigravity’s internal API:
  1. loadCodeAssist - Get project ID
  2. fetchAvailableModels - Get quota percentages & reset times
Authentication: OAuth tokens from ~/.ccs/cliproxy/auth/antigravity-*.json Auto-Refresh: Tokens refresh automatically if expired or expiring soon (under 5 minutes)

Quota Response

{
  models: [
    {
      name: "gemini-3-pro-high",
      displayName: "Gemini 3 Pro",
      percentage: 85,  // 0-100
      resetTime: "2024-01-05T23:59:59Z"
    }
  ],
  lastUpdated: 1704499200000,
  isForbidden: false,
  isUnprovisioned: false
}

Requirements

  • Antigravity subscription
  • Browser for OAuth (or --headless for servers)
  • Network access to Antigravity authentication servers

Troubleshooting

Quota Not Displaying

# Check account status
ccs agy --accounts

# Re-authenticate if needed
ccs agy --logout
ccs agy --auth

Account Unprovisioned

Error: “Account not activated in Antigravity app” Solution: Sign in to Antigravity web app at least once to provision your account

403 Forbidden on Quota API

Error: “Account lacks quota access” Solution: Verify subscription is active. Contact Antigravity support if issue persists.

Project ID Shows N/A

Warning: “Project ID: N/A” in Dashboard account dropdown Cause: OAuth token missing project_id (authenticated before feature added) Solution:
  1. Remove account: ccs agy --logout
  2. Re-authenticate: ccs agy --auth
  3. Verify in Dashboard: OAuth Providers → Antigravity → Account dropdown
  4. Confirm project_id displays (e.g., “project-123456”)
Note: Re-authentication is required only once per account. Project ID persists after successful OAuth.

Token Expiry

Tokens refresh automatically. If refresh fails:
# Re-authenticate
ccs agy --auth

Cost Information

Antigravity Subscription Required: Check antigravity.dev for current pricing Usage Limits: Subject to quota limits shown in real-time display

Next Steps

Multi-Account Setup

Manage multiple Antigravity accounts