Unlocking Premium Performance: A Technical Deep Dive into Antigravity OAuth Bridge
NoeFabris/opencode-antigravity-auth
The repository you're looking at, opencode-antigravity-auth, is essentially a "bridge" for developers working within high-tier IDE environments. Let’s break down why this is a game-changer for your workflow and how to get it running.
As developers, we often face a dilemma
we want the power of top-tier AI models (like the latest reasoning or pro-level models), but managing individual API keys and dealing with strict "free tier" rate limits is a headache.
This tool solves two major pain points
Identity Federation
It lets your local or open-source tools "piggyback" off your existing Google IDE (Antigravity) credentials.
Higher Throughput
By authenticating via OAuth as a verified user, you bypass standard public rate limits and tap into the professional-grade limits assigned to your Google account.
The goal is to get your local environment to recognize your Google-based session. Here is the general workflow for an engineer
Ensure you have the Google Cloud CLI (gcloud) installed and that you are logged into the account that has access to the Antigravity IDE environment.
Typically, you'll want to clone the repo and install the dependencies. Since this is likely a Python-based utility
git clone https://github.com/NoeFabris/opencode-antigravity-auth.git
cd opencode-antigravity-auth
pip install -r requirements.txt
You'll need to trigger the OAuth flow to generate a local token. Run the auth script provided in the repo
python auth_bridge.py --login
This will open a browser window asking you to sign in with your Google Workspace or Developer account.
Once authenticated, the library provides a wrapper to inject these credentials into your requests. Here is how you might use it in a script to call a high-level model
from antigravity_auth import AuthenticatedSession
# Initialize a session that automatically handles OAuth headers
session = AuthenticatedSession()
def call_advanced_model(prompt):
# This endpoint now recognizes you via your Google IDE credentials
url = "https://api.antigravity-internal.google/v1/models/pro-3:predict"
payload = {
"contents": [{"parts": [{"text": prompt}]}]
}
response = session.post(url, json=payload)
return response.json()
# Example usage
result = call_advanced_model("Explain quantum entanglement like I'm five.")
print(result)
Token Refresh
The library usually handles token refreshing in the background. If you get a 401 Unauthorized error, just re-run the login command.
Rate Limit Monitoring
Keep an eye on your headers. Most responses from the Antigravity backend will include x-ratelimit-remaining, helping you pace your automated tasks.
Security
Never commit the generated .auth_token or credentials.json files to your version control! Add them to your .gitignore immediately.
This setup is a massive level-up for anyone building local agents or automation tools that need the "heavy lifting" capabilities of premium models without the friction of standard API management.