antigravity-sdk-python icon indicating copy to clipboard operation
antigravity-sdk-python copied to clipboard

Support Google Account OAuth and reuse of CLI authentication file

Open synote opened this issue 6 months ago • 22 comments

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-cli and 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

synote avatar May 21 '26 09:05 synote

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:

synote avatar May 21 '26 10:05 synote

This needs to happen. I want to implement this SDK but not without the ability to use the subscriptions.

Unravl avatar May 23 '26 07:05 Unravl

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.

ai2therescue avatar May 27 '26 03:05 ai2therescue

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

synote avatar May 27 '26 05:05 synote

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

NannaOlympicBroadcast avatar May 27 '26 12:05 NannaOlympicBroadcast

so still nothing?

tiagodocouto avatar Jun 25 '26 10:06 tiagodocouto

unfortunetly form now i will drop Google models from my project due to this issue. im switching back to local llms + Claude code sdk

wwardaww avatar Jul 06 '26 17:07 wwardaww

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.

hksbindra avatar Jul 09 '26 11:07 hksbindra

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.5
  • agy 1.1.0
  • no GEMINI_API_KEY, Vertex credentials, or ADC configured
  • a healthy existing agy OAuth login

A few implementation details may be useful:

  1. The current macOS agy login is stored in Keychain under service gemini, account antigravity. Its value contains a base64-encoded envelope with an OAuth access token and expiry.

  2. 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.

  3. Passing the token only as Authorization: Bearer ... through GeminiAPIEndpoint.http_headers does not work: localharness still rejects the configuration because a Gemini API key is required.

  4. Supplying the OAuth token as both the required api_key and 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=sse

    whereas the OAuth-backed Antigravity/Cloud Code service uses the /v1internal:streamGenerateContent protocol.

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.

bearyung avatar Jul 09 '26 19:07 bearyung

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!

NTaylorMullen avatar Jul 09 '26 20:07 NTaylorMullen

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

rmie avatar Aug 01 '26 16:08 rmie

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.

NTaylorMullen avatar Aug 01 '26 17:08 NTaylorMullen

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

wwardaww avatar Aug 01 '26 20:08 wwardaww

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)?

NTaylorMullen avatar Aug 01 '26 21:08 NTaylorMullen

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. 😔

alejandrooro08 avatar Aug 02 '26 06:08 alejandrooro08

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.

synote avatar Aug 02 '26 12:08 synote

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! ☕✨

ncouture avatar Aug 07 '26 10:08 ncouture

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 avatar Aug 13 '26 18:08 akshitsharmacodes

@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.

HighOnCode55 avatar Aug 15 '26 01:08 HighOnCode55

我觉得Google跟不想做这个。

gy212 avatar Sep 12 '26 02:09 gy212