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_KEYAPI Endpoints
/v1beta/models/{model}:generateContentGenerate 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
}
}'/v1beta/models/{model}:streamGenerateContentStream 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"}]}]}'/api/accountsList all configured Google accounts.
curl https://opendum.tech/api/accounts \ -H "Authorization: Bearer YOUR_API_KEY"
OpenAI Compatible
/v1/chat/completionsOpenAI-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
/v1/modelsList all available models (OpenAI-compatible format).
curl https://opendum.tech/v1/models
Anthropic Compatible
/v1/messagesAnthropic-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-keyheader (Anthropic-style) - • Or
Authorization: Bearerheader
Thinking Parameter:
- •
type: "enabled" or "disabled" - •
budget_tokens: Minimum 1024 tokens
Available Models
| Model ID | Family | Features |
|---|---|---|
| gemini-2.5-flash | Gemini | Fast, cost-effective |
| gemini-2.5-flash-lite | Gemini | Lightweight, minimal latency |
| gemini-3-pro-preview | Gemini | Advanced reasoning |
| gemini-3-flash | Gemini | Fast + thinking |
| claude-sonnet-4-5 | Claude | Balanced, supports thinking |
| claude-opus-4-5 | Claude | Most capable, supports thinking |
Error Handling
Unauthorized
Invalid or expired token. Check your API key or re-authenticate.
Rate Limited
All accounts are rate limited. The response includes retryAfterMs indicating when to retry.
Bad Gateway
All Antigravity endpoints failed. Try again later.