Skip to main content

Introduction

Antigravity Manager provides a powerful proxy server that translates multiple AI protocol formats into Google’s Gemini API, enabling seamless integration with various AI tools and frameworks.

Supported Protocol Formats

The API supports three major protocol formats, allowing you to use Antigravity Manager as a drop-in replacement for:

1. OpenAI Protocol

Compatible with 99% of existing AI applications that use the OpenAI API format. Base URL: http://127.0.0.1:8045/v1 Supported Endpoints:
  • /v1/models - List available models
  • /v1/chat/completions - Chat completions (streaming & non-streaming)
  • /v1/completions - Text completions
  • /v1/responses - Codex CLI compatibility
  • /v1/images/generations - Image generation (Imagen 3)
  • /v1/images/edits - Image editing
  • /v1/audio/transcriptions - Audio transcription
Example Request:

2. Anthropic Protocol

Native support for Claude API format, including full Claude Code CLI functionality. Base URL: http://127.0.0.1:8045 Supported Endpoints:
  • /v1/messages - Claude messages API
  • /v1/messages/count_tokens - Token counting
  • /v1/models/claude - List Claude-compatible models
Features:
  • System prompts
  • Thinking mode (chain-of-thought)
  • Tool use and function calling
  • Vision and multimodal inputs
Example Request:

3. Gemini Protocol

Direct access to Google’s native Gemini API format. Base URL: http://127.0.0.1:8045 Supported Endpoints:
  • /v1beta/models - List available models
  • /v1beta/models/{model} - Get model info or generate content
  • /v1beta/models/{model}/countTokens - Count tokens
Example Request:

API Architecture

Default Configuration

Environment Variables

You can customize the server behavior using these environment variables:

Health Check

The API provides health check endpoints for monitoring: Endpoints:
  • GET /health
  • GET /healthz
Response:

Protocol Translation

Antigravity Manager automatically translates between different protocol formats:

Request Flow

  1. Client Request → Incoming request in OpenAI/Anthropic/Gemini format
  2. Authentication → Validates API key or user token
  3. Model Mapping → Maps requested model to internal Gemini model
  4. Protocol Translation → Converts request to Gemini format
  5. Account Selection → Chooses optimal Google account based on quota
  6. Upstream Request → Forwards to Google Gemini API
  7. Response Translation → Converts response back to requested format
  8. Client Response → Returns in original protocol format

Smart Features

  • Automatic Retry: Handles 429 and 401 errors with silent account rotation
  • Quota Management: Tracks and respects per-model usage limits
  • Session Binding: Maintains consistency across multi-turn conversations
  • Thinking Mode: Supports chain-of-thought reasoning across all protocols
  • Multimodal Support: Handles text, images, and audio inputs

Rate Limits

Rate limiting is handled transparently:
  • When an account hits quota limits, the system automatically switches to another available account
  • No interruption to client requests
  • Quota status is tracked in real-time and refreshed periodically

Error Handling

Standard HTTP status codes are returned:

Next Steps

Authentication

Learn how to authenticate API requests

Model Routing

Configure model mappings and routing