Google AI Studio sustains that Gemini 2 experimental APIs are for free (0$).
I want to experiment about the creation of a sort of “engineer” that finds the right combination of prompts and data to solve very complex tasks. I don’t want abuse of Gemini API (anyway I’ve tokens daily limitation), but a similar experiment, even if not original, would cost me a lot of API calls.
Can I experiment without excepting thousands of dollars of debts?
Yes, even the non experimentals gave free tiers. The free tiers give you a limited number of requests per minute. So you can experiment within that limit and never pay a penny. They won’t even ask you for a credit card to begin. In fact, the way you concert from a free tier to a paid tier is adding your CC. So as long as you don’t do that, it’s free to use and test with within the limits.
Thank you
Are there API call or information in the reply to be sure about the current cost of the calls?
Yes, you can use usage_metadata on the response object to get the output token counts and count_tokens to get the input tokens. You can total this to determine the total input and output tokens in separate buckets to determine your cost based on the model your using. You will have to do the math yourself or within your code. We just write it all into a data table and have reports pages that show our running cost to ensure it jives with what Google cloud console billing reports show which has been accurate for the most part. Images are always 258 input tokens regardless of size or resolution (assuming use of Gemini API vs Vertex) so no need to count that.
See following for more details:
1 Like
If we implement in our apps like web using javascript, its also free?
The free tier is free but is rate limited. And yes, it’s free if used via API in your apps using whatever coding language you prefer.