Android OAuth for Gemini API with each user's own billing project — supported architecture?

Hello,

We are developing a third-party Android app for adult users
in the EEA and are evaluating the following architecture
before implementing it.

Our proposed architecture is:

  • an Android OAuth client registered in the developer’s project;
  • authorization through Android AuthorizationClient;
  • direct calls to the Gemini Developer API generateContent endpoint;
  • x-goog-user-project set to a Cloud project owned by the user;
  • Generative Language API and billing enabled in that user’s project;
  • no developer-owned API key embedded in the app and no backend proxy.

Could you clarify the following?

  1. Is this architecture supported for a publicly distributed
    third-party Android app?

  2. Which OAuth scopes and IAM permissions are required
    for generateContent in this configuration?

  3. Does generateContent attribute quota and charges to the
    user’s project specified in x-goog-user-project, rather
    than the project that registers the Android OAuth client?

  4. What OAuth app verification requirements apply?

  5. Are there additional contractual requirements for this
    architecture when the app is distributed to EEA users?

We are not attempting to use Google AI Pro/Ultra subscription
benefits for external API requests. Our goal is for each user
to authorize access to their own API resources and bear
their own API usage costs.

Please provide the applicable official documentation or
identify any unsupported part of this architecture.

If these questions require clarification from a product,
billing, or policy team, please point us to the appropriate
official support channel.

Thank you for your help.

Best regards,
Danilo

Hello @Danny_W,
For complete details on authenticating and architecting client calls, please review our official Authentication with OAuth quickstart and the Gemini API Additional Terms of Service (specifically the Use Restrictions and Paid Services sections governing EEA distribution). If you require enterprise compliance or verified multi-tenant architectures, please consult the Google Cloud Vertex AI documentation.

Thanks, Payal. I reviewed the linked documentation, but I couldn’t find confirmation of the specific Android architecture described in my original post.

The user-facing goal is a simple “Connect with Google” flow through which users authorize the app to access their own Gemini API resources, with usage charged to their own billing-enabled Cloud project rather than mine. As noted above, this is separate from Google AI Pro/Ultra subscription benefits.

Could you confirm whether the proposed flow using Android AuthorizationClient, direct generateContent calls and a user-owned project specified through x-goog-user-project is supported for a publicly distributed Android app?

If it is supported, which scopes, IAM permissions and OAuth verification requirements apply? If not, which part is unsupported, and what is the recommended alternative?

I’d also appreciate clarification on whether any required user-project setup can be completed through an officially supported guided onboarding flow.

Thanks,
Danilo

One additional question about the API-key alternative: can a publicly distributed Android app let each user enter their own Gemini API key at runtime, keep it exclusively on their device, and use Gemini with Google Search grounding?

The key would not be embedded in the APK or sent to a developer-operated server. All usage would belong to the user’s project.

Does the recommendation to use a backend also apply to this user-owned-key setup?

Thanks,
Danilo