Is there an easy way to get clients to subscribe to Google AI API so as to send the cost of the tokens to the customer

I want a risk-free way of using the Google AI API, such that when a user downloads my app they can subscribe to my Google API service and I can pass the cost of the tokens onto the consumer. i.e. I don’t want to go bankrupt because someone downloaded my app and is using it 24-7 and using millions of tokens.

e.g. I want to put a button on my app they click it and sign up and whenever they use tokens in the app the price is passed on to them (within some limits set).

I also want this service to be transferable to any other apps using the Google AI service.

I might want them to sign up to either a monthly fee for a maximum number of tokens or a pay-as-you go model, or even a free-tier. Maybe even the developer could get 10% cut of the profits.

Is this currently possible, or might anything be planned in this regard?


As an idea, perhaps it could be as simple as requiring the user to log in with a gmail email address or Google Play login, and then is granted X amount of tokens per month. This would be a great feature if it is possible.

2 Likes

AFAIK there is no good way that would follow Googles TOS

Really this was a comment for any Google AI developers to let them know I would like a way for my users to sign in to my app and the cost of the tokens be on them instead of the developer.

This seems like a sensible way of pricing things to make things risk-free for developers.

As an example of how this would work, consider the “super-chat” button on YouTube, this gives some money to the youtuber and some money to Google. Now imagine that instead of this was a button “buy more LLM tokens” inside my app.

Currently there is no easy way to transfer the cost of LLM tokens onto the users. I think this is would be a really useful API functionality to have and Google could easily implement it because they already have the Google Play payment system.

Anyway, that’s just my idea. I hope the Google Developers like my idea :slightly_smiling_face:

Hi

I’m doing that in my application onleeAssistant by asking user an API Key

I do that for Gemini and ChatGPT

Stéphane

1 Like

Yes, that is called the “bring your own API key” model.

That is one way of doing it. But I don’t think it is the perfect solution. There are some problems

  • When you get your API key it says “don’t share your API key” so that could put users off from using the API key with your app.
  • It is a bit complicated for users to find out how to get an API key. So I am hoping Google will invent a better way to make it much easier for users. (It is easy for us because we are developers and so have big brains :grin:). I would prefer something more automatic to give a new API key to the user without taking them outside the app.
  • On mobile phones it is a bit difficult to copy and paste keys.

So those would be my problems. I don’t know if Google developers read these forums but I’m hoping they’ll invent a better way of doing it.

1 Like