Documentation

Learn how to use the Antigravity API

Overview

Antigravity API is a proxy that allows you to access Google's Gemini and Claude models using your Google Cloud account quota. It provides:

  • OAuth authentication with PKCE (no API keys needed)
  • Multi-account load balancing (unlimited accounts)
  • Automatic endpoint fallback for reliability
  • Streaming support (SSE)
  • Compatible with Gemini SDK format

Authentication

1. Set up Dashboard

Go to the Dashboard and sign in with GitHub to get your API key.

2. Add Google Account

Click "Add Account" to generate an OAuth URL. Open the URL in your browser and login with your Google account.

3. Complete OAuth

After Google login, you'll be redirected to a localhost URL (the page won't load - that's expected). Copy the full URL from your browser's address bar and paste it back in the Dashboard.

4. Use the API Key

Copy your API key from the Dashboard and include it in your request headers:

Authorization: Bearer YOUR_API_KEY

API Endpoints

POST/v1beta/models/{model}:generateContent

Generate content using the specified model.

curl -X POST https://opendum.tech/v1beta/models/gemini-2.5-flash:generateContent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [{"text": "Explain quantum computing"}]
      }
    ],
    "generationConfig": {
      "maxOutputTokens": 2048,
      "temperature": 0.7
    }
  }'
POST/v1beta/models/{model}:streamGenerateContent

Stream content using Server-Sent Events (SSE).

curl -X POST https://opendum.tech/v1beta/models/gemini-2.5-flash:streamGenerateContent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents": [{"parts": [{"text": "Write a poem"}]}]}'
GET/api/accounts

List all configured Google accounts.

curl https://opendum.tech/api/accounts \
  -H "Authorization: Bearer YOUR_API_KEY"

OpenAI Compatible

POST/v1/chat/completions

OpenAI-compatible chat completions endpoint. Supports thinking/reasoning parameters.

curl -X POST https://opendum.tech/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5",
    "messages": [
      {"role": "user", "content": "Hello, how are you?"}
    ],
    "stream": false,
    "reasoning_effort": "medium",
    "include_thoughts": true
  }'

Thinking Parameters:

  • reasoning_effort: "none", "low", "medium", "high"
  • thinking_budget: Explicit token budget (overrides reasoning_effort)
  • include_thoughts: Include thinking content in response
GET/v1/models

List all available models (OpenAI-compatible format).

curl https://opendum.tech/v1/models

Anthropic Compatible

POST/v1/messages

Anthropic-compatible messages endpoint. Supports extended thinking.

curl -X POST https://opendum.tech/v1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5",
    "max_tokens": 4096,
    "messages": [
      {"role": "user", "content": "Explain quantum computing"}
    ],
    "thinking": {
      "type": "enabled",
      "budget_tokens": 8000
    }
  }'

Authentication:

  • x-api-key header (Anthropic-style)
  • • Or Authorization: Bearer header

Thinking Parameter:

  • type: "enabled" or "disabled"
  • budget_tokens: Minimum 1024 tokens

Available Models

Model IDFamilyFeatures
gemini-2.5-flashGeminiFast, cost-effective
gemini-2.5-flash-liteGeminiLightweight, minimal latency
gemini-3-pro-previewGeminiAdvanced reasoning
gemini-3-flashGeminiFast + thinking
claude-sonnet-4-5ClaudeBalanced, supports thinking
claude-opus-4-5ClaudeMost capable, supports thinking

Error Handling

401

Unauthorized

Invalid or expired token. Check your API key or re-authenticate.

429

Rate Limited

All accounts are rate limited. The response includes retryAfterMs indicating when to retry.

502

Bad Gateway

All Antigravity endpoints failed. Try again later.