EDIT May 12: Google added new rate limits to AI studio this morning, 25 RPD, so this is effectively no longer working. We had a good run!
EDIT: The Open Router integration and google ai studio key method seems like the easiest way that works for everyone, especially if you already have an openrouter account. Pasting that method here for visibility:
Get a Google AI Studio API key from https://aistudio.google.com/apikey
Plug that API key into the Google AI Studio integration on https://openrouter.ai/settings/integrations, select enabled but not "Use as fallback"
You can now use your Openrouter key anywhere and as long as you select Gemini 2.5 Pro Experimental as your model, it will use your key. (4. If you also add a GCP key and have Vertex AI enabled for the project, obtained as per the instructions below, you can add that to your integrations as well, and you will have two sources of 2.5 Pro backing your Openrouter calls.)
Hey all,
After dealing with Openrouter and Requesty giving me constant rate limits for Gemini 2.5 Pro, I got frustrated and decided to get things set up directly through Google's APIs. I have now sent over 60 million tokens in a single day without hitting any rate limits, all for $0—an equivalent usage with Claude would have cost $180. I also had a few other engineers confirm these steps. Here's how to do it and then integrate with Roo Code--but this should work for other tools like Cline, too:
Setting Up Google Cloud
Create or log into your Google Cloud account.
Open the Google Cloud Console.
Create a new Google Cloud project (I named mine "Roo Code").
Enable billing for your newly created Google Cloud project.
Enable the Vertex AI API.
Enable the Gemini API from the API overview page.
In your project dashboard, navigate to APIs & Services → Credentials.
Click "Create Credentials" → "API Key".
Copy the generated API key and save it securely.
Integrating with Your IDE (Example: Roo Code)
In VSCode or Cursor, navigate to the extensions marketplace (Shift + Cmd + X on Mac), search for and install "Roo Code" (or your preferred tool like Cline).
Open Roo Code (Cmd + Shift + P, then type "View: Show Roo Code").
Click to configure a new API provider, selecting "Google Gemini".
Paste the API key you saved earlier into the API key field.
Select "google/gemini-2.5-pro-exp-03-25:free" as the model.
Click Save.
There you go! Happy coding. Let me know if you run into any issues.
Edit: looks like some are having issues. A few ideas/alternatives:
Use a Vertex api key, but gemini api as provider in Roo Code.There is only one key, ignore this alternative.Use vertex api as the provider in Roo Code--its just a little more complicated, you'll have to create a service account in the credentials page of the project, and paste the json in Roo Code when configuring the provider
If you have an OpenRouter account, you can go to the integrations page https://openrouter.ai/settings/integrations and add your vertex api key to the google vertex integration. You can also add a google ai studio api key to the Google AI Studio integration. In each setting window where you add the key, make sure it is enabled. Then, in Roo Code, you use your openrouter account, but whenever it uses Gemini 2.5 pro free, it will default to your API key, not one of theirs which is being rotated among many users.
I've been using Gemini 2.0 Flash and 2.0 Flash Thinking through third-party software AI providers like ChatLLM, which accesses these models via API. While these providers promise privacy, I'm still concerned about Google's role. If the underlying API is free, does that mean Google is extensively using our data for training and other purposes, regardless of what the third-party provider claims? What are your thoughts on this? Are there any ways to mitigate the risks, especially when using these APIs through intermediaries?
Gemini 1.5 APIs are not free. So, I would respect Google to respect user privacy for the 1.5 LLMs.
There are not paid versions of Gemini 2.0 Flash and 2.0 Flash Thinking at the moment. I can't pay even if I want to.
Videos
Just noticed that Google completely gutted free tier API limits - if you have any projects that were using flash models with big daily limits - please check those as most likely if you are not at leas tier 1 - you will be seeing 429's in your console just like i did. This came out of nowhere. Hope this gives a heads up to some people.
Was kind of surprised why my personal project hit quota limit. Checking the limits, it's massively reduced.
Checkout this short tutorial on how to generate you r Google Gemini model API key for free and codes to use it with any language : https://youtu.be/J8ksL3oqqUE?si=cEFBUzfE4ZPmUtE-
We have been using millions of token but the dashboard bill has been 0 in the past couple days.
As everyone know, Copilot limit the premium models to 300 request/month. Google on the other hand is looking to expend their business and are now offering 100 request per day for free of Gemini 2.5 Pro on their API. It's back on the free tier!
100 RPD (Request Per Day) for Gemini 2.5 Pro
250 RPD for Gemini 2.5 Flash. (It was 500 until now, so they lowered that, but that model is mostly 4.1 intelligence level, maybe slightly above or below depending on the language. And 250 per day is already more than enough.)
https://ai.google.dev/gemini-api/docs/rate-limits
Update: Now they updated the model in the list, just go to the Manage Models... in the model selector and click Gemini, enter your API key from Google AI Studio, select both Pro and Flash and you are good to go.
Make sure you use Gemini 2.5 Pro at the bottom of the list, if not, it count toward your 300 requests.
The model is much smarter than the free 4.1. So that's ~3000 request per month + your 300 premium that you can keep for Sonnet 4. I hope it helps someone. I will surely use that most of the time now instead of the 4.1.
Hey folks,
I’m looking for the best free way to access the Gemini API. I know Google offers a free tier via AI Studio, but are there any better options?
I'm considering enabling billing for the Gemini API because free tier won't be able to use pro models anymore.
My main questions: Does the paid tier still include any free usage allowance (eg. free for anything within the free tier rate limit, only pay for things above the free tier rate limit), or does everything become billable once you enable billing?
I really tried as hard as I can, but I can not find a way how to calculate price of single response I receive from Gemini API.
This page: Gemini API Pricing | Google AI for Developers
What does "context caching" stands for? For reading cached tokens? Also, how cache creation is billed? Do you pay for whole time-to-live when you create cache or you are billed as time passes? Do you pay for cache writing operation also or only for storage?
If you are Google employee reading this, tell your bosses that working with Gemini API is most painful among all API providers. Especially this stupid billing account relation, I have never experienced such bullshit billing system. Also, explanation on how to calculate price of one API response is lowest level bullshit. Thank you.
Gemini Free Tier is now down to 20 requests per day, which is essentially unusable for most of us. You might see the same thing in your logs (see below):
I can't see waht the paid tied gives us in terms of increasing requests, so if anyone has a link to that page, please add it in the comments.
Either way, what are our options? Can we do this locally? Is there another more cost effective option than a paid Google AI tier? Anyone tried the paid tier - how many requests does it give and how much is it?
If you do AI locally - please point me in the right direction on how to do this (currently using Rpi for HA)
UPDATE: So far Gemini paid tier is costing around 1p per day.
"error": { "code": 429, "message": "You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. To monitor your current usage, head to: https://ai.dev/usage?tab=rate-limit. \n* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 20, model: gemini-2.5-flash..Since a lot of AI-related features on GCP ask for this API, I just wanna double check if it has a free tier quota for testing before enabling it.
I checked this page https://cloud.google.com/free/docs/free-cloud-features , but Gemini for Google Cloud is not in it.
hey guys, very simple questions but I'm kinda lost, can I call a prompt in python through the gemini API, all free? that is no subscription, billing, etc. and if so what are the limits? my use case would be very low number of requests, like 10 per day max, and the tokes for the prompt and response wouldn't be much more than 100
thanks in advance!
Max requests are 60 per minute: https://blog.google/technology/ai/gemini-api-developers-cloud/
Costs early next year:
Limited to these countries: https://support.google.com/bard/answer/14294096?hl=en ?
Function calling supported: https://twitter.com/sundarpichai/status/1734952757722001626
For those using Gemini 2.5 full-time during the day and exceeding 25 requests per day.
What are your daily costs?
I created an API in Google AI Studio and created a Google Cloud Account with it. So i made my first tests in RooCode with around 400k Tokens. Issue: why is the billing amount not moving? Still sitting at 0$. Iam confused about the pricing of 2.5 Pro in general.
Or is the API currently free? I dont get it
I have set up my ai studio account to use gemini 1.5 pro over the api, after a long time of trying to figure out and not go crazy due to the google's ecosystem, I managed to set it up and it seems to be free but limited. I want to switch to pay as you go as it says on the gemini website but for the love of God I have no idea how, the whole google services ecosystem is so ridiculously complicated that I almost want to throw it all away. Make an account here, give some weird permissions there, add credit card in another place, set up some kind of billing account in a completely different place... I ended up having like 10 tabs open just to get an api key working... Some info on the Gemini Website says you can use pay-as-you-go, in another place says it's coming in the future and in Google Cloud everything is set up but you can’t understand anything, when will it be billed, how it will be billed... I am lost...
I would love if they just made it clear and added everything regarding my billing and usage and everything in the AI Studio the way OpenAI and Anthropic does. I know they have a big ecosystem and all kinds of guardrails and security measures, but some effort on their part is needed... this is insane
Now that the Gemini API has removed its daily free token limit, I'm looking for any other API providers that still offer a free daily tier. I really enjoy working with Cline, but I currently can't afford to pay for API access.
Does anyone know of any alternatives with a free tier that works well with Cline?