Support Google Account OAuth and reuse of CLI authentication file
Currently the antigravity-sdk-python only supports API Key authentication. This limitation presents two main problems:
- Google One & Advanced Subscribers: Many individual developers have consumer premium subscriptions, they cannot use their personal Google accounts to authenticate within the SDK and are instead forced to set up developer API keys.
- Authentication Fragmentation: if a developer has already logged in and authenticated antigravity-cli, they still have to manually create and export an API key to use the SDK.
Proposal
I recommend supporting Google Account OAuth Authentication natively in the Python SDK. The solution should ideally provide:
- Direct Integration with CLI Credentials: The SDK connection strategies should automatically check for existing credentials created by
antigravity-cliand use the auth json to proceed authorize request. - Authentication Methods on Initialization: Provide a clear authentication flow within the SDK to trigger browser-based Google OAuth and return redirect url
We are currently planning to migrate GeminiCLI in Sublime Text to use the antigravity backend/SDK. Users usually manage their own authentication locally in the CLI and A significant portion uses Google One subscribe. Integrating antigravity credential would naturally provide a zero-configuration developer experience for anyone who has already run the CLI's login command:
This needs to happen. I want to implement this SDK but not without the ability to use the subscriptions.
Given the history of OpenClaw abuse and their commercial interests, I doubt this will be realised. They intend to develop Antigravity IDE and Subscription exclusively for fully human-driven use. By limiting the option to only be available through GCP or API, they commercially reward the Google team.
Given the history of OpenClaw abuse and their commercial interests, I doubt this will be realised. They intend to develop Antigravity IDE and Subscription exclusively for fully human-driven use. By limiting the option to only be available through GCP or API, they commercially reward the Google team.
Other developer agent ecosystems already support consumer OAuth authentication for their SDKs.
Both codex app-server and the claude agent SDK natively support consumer OAuth subscription credentials. Supporting Google Account OAuth in the Antigravity SDK would align with these established patterns
If you count using credits in agy-sdk as abuse, why gemini cli support oauth and giving credits to 3rd party and does not count as abuse
so still nothing?
unfortunetly form now i will drop Google models from my project due to this issue. im switching back to local llms + Claude code sdk
C'mon guys, what's the hold up?? Either do it or close this issue. This false hope isn't going to do anybody any good.
We reproduced this while evaluating the SDK for a local desktop application where users should be able to consume their existing Antigravity subscription/login rather than configure a separate developer API key.
Tested on macOS with:
google-antigravity==0.1.5agy 1.1.0- no
GEMINI_API_KEY, Vertex credentials, or ADC configured - a healthy existing
agyOAuth login
A few implementation details may be useful:
-
The current macOS
agylogin is stored in Keychain under servicegemini, accountantigravity. Its value contains a base64-encoded envelope with an OAuth access token and expiry. -
That access token is valid for direct Bearer-authenticated requests to the Antigravity Cloud Code backend. We already use it successfully for image generation through
https://daily-cloudcode-pa.googleapis.com/v1internal:generateContent. -
Passing the token only as
Authorization: Bearer ...throughGeminiAPIEndpoint.http_headersdoes not work:localharnessstill rejects the configuration because a Gemini API key is required. -
Supplying the OAuth token as both the required
api_keyand the Bearer header allows the SDK session to start, but the first model turn fails with HTTP 404. The SDK sends:/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=ssewhereas the OAuth-backed Antigravity/Cloud Code service uses the
/v1internal:streamGenerateContentprotocol.
This suggests that implementing OAuth reuse will require a first-class Antigravity/Cloud Code endpoint or connection strategy, not only loading the CLI credential into the existing GeminiAPIEndpoint. The SDK needs to use the Cloud Code request routes/schema while refreshing and consuming the user's existing OAuth session.
Native support for this would give SDK integrations the same zero-configuration subscription-backed experience users already get from agy, Codex, and Claude's agent tooling.
Hey friends, just want to thank everyone for the energy and the detailed technical breakdowns in this thread. We hear you, and we want a zero-config experience as much as anyone. That said, bridging a consumer-facing session into a programmatic SDK layer presents some real architectural and policy challenges. We're actively digging in and will post updates as things become clearer!
We're actively digging in and will post updates as things become clearer!
The Google developer's response ("We're actively digging in...") is essentially PR speak acknowledging the feature request. -- Gemini 3.1 Pro
Ehhh it's more than that. We're talking with teams, prototyping and ultimately trying to get a clear view of what it'd take. There are a lot of dials here that it involves.
Like how to be one of i develop an app using claude sdk via anrt gravity 2.0. But i can t develop same app via antygravity sdk some how anty garvity 2.0 cant figure out how to use anty gravity sdk
Like how to be one of i develop an app using claude sdk via anrt gravity 2.0. But i can t develop same app via antygravity sdk some how anty garvity 2.0 cant figure out how to use anty gravity sdk
When configuring Antigravity 2.0 in your initial landing did you add the Antigravity SDK skill (it's a checkbox)?
I'm sorry, because the poverty of life I don't have active credit card to use for buy a email domain and also I don't have money to do anything. 😔
Many individual users rely on their existing Google One subscriptions. If products built on top of the Gemini SDK cannot recognize or use those subscriptionsk, many users simply will not adopt them.
We're actively digging in and will post updates as things become clearer!
The Google developer's response ("We're actively digging in...") is essentially PR speak acknowledging the feature request. -- Gemini 3.1 Pro
How dare anyone diminish this thread when we are out here making git commits AND emotional commitments at 3:00 AM? We're talking about next-gen stuff on a beta SDK that hasn't even reached to 0.2.0!
We are talking about high-stakes enterprise architecture here! Personally, I’ve been trying to leverage the internal OAuth credentials of the Firebase GitHub Deployment Automation App. It definitely has the Gemini LLM Editor role attached—which is fine by me. As a cool, mid-life-crisis techie and well-behaved Netizen, my infrastructure relies entirely on Security Through Brand Recognition.
If hackers breach my fake-root container running on the YAML Tomato Operating System 🍅 (spooky!), they won't wipe my database. They’ll look up my name, land on my GenAI-generated LinkedIn article:
"What a Startled Deer in My Backyard Taught Me About B2B SaaS Growth"
...and politely ⭐ star my repository instead.
Life’s far too dull without teams of genius Google engineers holding emergency summits to investigate whether zero-auth is a valid pipeline workflow, or a spiritual state of being.
P.S. To the Google Team & Any Future Hiring Managers Reading This:
On a real note, huge respect to the team digging into this. It is genuinely very SRE-ly of you to acknowledge the ticket and engage with us instead of piping all us users straight into the /dev/null void...
Just trying to drop a little cheer into the issue queue while you do the real heavy lifting. Keep up the awesome work! ☕✨
Hey everyone! 👋
I was looking into this and actually got a working prototype running on my fork. Since external PRs are turned off right now, I figured I'd share how I solved it in case it's helpful for the official fix!
Basically, I used the keyring library to pull the agy CLI token directly from the system credential store. Then, I added a new CloudCodeEndpoint that automatically intercepts the token if an API key isn't provided.
The neat trick is that I mapped this new endpoint down to the existing GeminiAPIEndpoint proto with the daily-cloudcode-pa.googleapis.com base URL and a Bearer token header. It seamlessly routes the traffic to the consumer endpoint without needing to touch the pre-compiled Go binary at all!
If you're curious, you can check out the changes on my fork here: https://github.com/akshitsharmacodes/antigravity-sdk-python/tree/feature/oauth-support
Hope this helps!
@akshitsharmacodes Problem is they don't wan't to let this happen. People got accounts banned using google OAouth in PI code. It's in the user policies, you can't use your account with third party coding agents.
我觉得Google跟不想做这个。