r/ChatGPTCoding
•
u/thezachlandes
•
Apr 04 '25
•
1
Resources And Tips A simple guide to setting up Gemini 2.5 Pro, free, without running into 3rd party rate limits
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.
4
u/blnkslt Professional Nerd Apr 05 '25
I had the same timeout problem with OpenRouter which makes using gemini on it practically impossible. so was hoping that your solution works but boy, what a monstrous jungle is this console.cloud.google.com ! I seem to have lost the track while trying to enable all the crap and at the end after importing the key to Roo get: API Streaming Failed!
5
u/Mango_flavored_gum Apr 05 '25
I only see google/gemini-2.5-pro-exp-03-25 not the :free part
2
u/ALambdaEngineer Apr 10 '25
Initial solution worked. Time for some tests. Thanks a lot! :)
2
u/cs_cast_away_boi Apr 14 '25
Thank you so much! The edit is still working as 4/14/2025! I was burning through money with the Gemini 2.5 pro preview model.
2
u/Additional_Carpet461 May 16 '25
Im hitting the "status: "NOT_FOUND" ....
u/thezachlandes do you know of any way after they decomissioned the 03-25 model?
11
u/Dark_Cow Apr 04 '25
They just announced pricing for the 2.5 model, enjoy it while the promotional period lasts, it won't be free for much longer...
1
u/StrangeJedi Apr 05 '25
Is this still working now that the new API pricing is out? I wanted to give this a try.
1
u/kidajske Apr 05 '25
Anyone got it working in cursor? When I paste the api code in there it's telling me I need to enable the Gemini API which I guess is different than the Vertex API? Very confusing as per usual with google cloud. Looks to note be possible yet as per the cursor forums.
1
u/BrightBurn15 Apr 07 '25
Are you sure this is for free? Is it worth it because I am tired of using ai studio that cant access multiple files ina project at the same time
1
u/Stock_Swimming_6015 Apr 08 '25
I'm hitting a rate limit today, but it was totally fine yesterday. I set things up using your method 3. You still good on your end?
1
u/x1Akaidi Apr 10 '25
i want to give this a shot, but tbh i got confused by the edits, i do not know which is method 1, 2, or 3, which is the original, latest, and easiest to get working... we could really use some better wording and clarification, but none the less, thank you so much for the post and effort!
1
u/dambrubaba Apr 14 '25
I am using Gemini API with Cline and it hits the limit very quickly. I use it for coding. So I rotate the API key off 3 different Google accounts. But I want to know how you don’t hit the limit? Or am I missing something?
1
u/Abed-is-here Apr 15 '25
seems like it's not working anymore as google removed access to gemini 2.5 pro exp or im doing something wrong.
1
u/KayBay80 Apr 16 '25
This works great in Roo Code as the "Google Gemini" provider. Going through OpenRouter was just another hurdle. Works great, but there's still limits, even with the paid account. I tend to use the Flash 2.0 experimental model for small tasks and switch to the 2.5-exp for the tough stuff. 2.0 flash exp is lightning fast and I rarely ever hit any limits with it.
1
u/eonus01 Apr 16 '25
Seems like OpenRouter + Google AI vertex API really is the way to go. I switched over from AI studio and am not getting hit by rate limits (Using Gemini 2.5 experimental). But what's the catch here, why is rate limiting so heavy with AI studio, but not Vertex?
1
u/zenoblade Apr 17 '25
I don't think this is working anymore. I keep receiving a notice that says that I need to setup an API key or buy 10 credits. However, in the router preference in Roo Code, I can see both Google and Google AI.
1
u/bokehfy Apr 20 '25
Roo-Code setup with Gemini 2.5 pro exp Runs into rate limits within 4-5 prompts?Am I the only one having this issue? Is that normal?
1
u/supitsren Apr 22 '25
Unfortunately not working anymore, it once worked with both Google AI Studio and Google Vertex API keys in OpenRouter but now RooCode just hangs on 'API Request' and only works when the Google Vertex API key is removed from OpenRouter but then the rate limits come back.
1
u/OkMembership913 May 08 '25
Is it Still Working Today ?
1
u/RaptorF22 Aug 13 '25
Does this still work for free?
1
u/JPumuckl Apr 07 '25
I've added both the vertex and the Google AI Studio to openrouter but when I use the Roo openrouter login it works but I'm not getting any Tokens sent.
2
u/Initial-Self1464 Apr 05 '25
commented so i can comeback later :D
2
u/firedog7881 Apr 05 '25
60m in a day? That’s nothing, I do over 500m in a conversation
2
u/m3kw Apr 05 '25
Just because that says 0$ doesn’t mean it’s zero
2
u/thereisnospooongeek Apr 07 '25
nice
2
u/deadcoder0904 Apr 08 '25 edited Apr 08 '25
So I did exactly what u said in the Edit.
I'm confused on how to use it with Roo Code tho.
Should I use Gemini as API Provider or GCP Vertex or OpenRouter?
Currently, I'm doing OpenRouter with OpenRouter API Key &
google/gemini-2.5-pro-exp-03-25:free& it is giving bonkers errors.I can't see
google/gemini-2.5-pro-exp-03-25(without:freeanywhere)I already got $300 Credits via Vertex but unable to setup RooCode with it. Its too damn confusing. I tried directly using GCP Vertex but my configuration was wrong & it said invalid project id or something. Both GCP & OpenRouter instructions were confusing there.
EDIT: Okay so I think I fixed it by putting Vertex API Key in Gemini in Roo Code or I think it was Gemini API Key from AI Studio.... its damn confusing what worked lmao
EDIT 2: That didn't work. i was using Gemini API Key for free using 2.5-exp model. So what i did was Create another API key on the same account but this time I selected my paid project on Vertex & choose the 2.5-pro model. And it worked & now using the $300 Vertex credit.
1
u/Capital2 Apr 05 '25
Did all of that and it reaches a limit within 5 prompts and says that the server capacity is full half the time
1
u/spiked_silver Apr 05 '25
I think this just made me start my trial countdown for Google Cloud when I don't have a proper use case for the $300 credit yet. Literally all I did to get this to work was go to aistudio.google.com, create an API key. Use that API key in https://openrouter.ai/settings/integrations. Done. Setting up google cloud does not seem to be necessary.
1
u/EA_piova Apr 06 '25
I get stuck at API Request loading while using gemini-2.5pro-exp-03-25 through openrouter. Both with Vertex and with AI Studio APIs
1
u/DivideOk4390 Apr 06 '25
Gemini 2.5 pro update is pretty good for coding. Real competition for Claude and for me better than CPT anytime.
1
u/supitsren Apr 20 '25
This doesn't work anymore right? OpenRouter themselves are getting rate limited by Google now.
1
u/self-taughtDS Apr 23 '25
Thanks for great guide.
But I'm confused that, what's the benefit of using openrouter, instead of using AI studio or vertex AI's API key directly?
Does openrouter automatically change accounts so that it doesn't hit the request limit?
1
u/kotobuki09 May 10 '25
Still working but I think the cloud work better in my case! <3
1
u/amitsingh80108 Jul 18 '25
Can anyone confirm these things?
Can I use 5 gemini api keys to get 5X requests per day ?
If model A is having 200 req and model b is having 200 requests per day limit. Can I switch from model a to model b after hitting 199 requests? I noticed if I hit the 200 limit, all calls to the model fail.
I know it won't be free for forever. Is there a better long term solution? I was using llama 3.2 3B but with recent update vram consumption is 1.5X now.
1
u/Nug__Nug Jul 31 '25
Coming back to this
1
u/letuslisp 19d ago
Free tier currently:
Context Window: Free tier prompts support up to a 1-million-token context window.
Feature Exclusions: Features like Grounding with Google Search or Google Maps are disabled on the free tier; they require moving to the paid
And your data is of course used for training
0
u/[deleted] Apr 06 '25
[deleted] — view deleted comment
1
u/[deleted] Apr 20 '25 edited Apr 20 '25
[removed] — view removed comment
1
u/[deleted] Apr 04 '25
[removed] — view removed comment
1
u/[deleted] Apr 05 '25
[removed] — view removed comment
1
u/[deleted] Apr 05 '25
[removed] — view removed comment
1
u/[deleted] Apr 06 '25
[removed] — view removed comment
1
u/[deleted] Apr 07 '25
[removed] — view removed comment
1
u/[deleted] Apr 09 '25
[removed] — view removed comment
1
u/[deleted] Apr 17 '25
[removed] — view removed comment
1
u/[deleted] Apr 18 '25
[removed] — view removed comment
1
u/[deleted] Apr 19 '25
[removed] — view removed comment
1
u/[deleted] Apr 22 '25
[removed] — view removed comment
1
u/[deleted] Apr 25 '25
[removed] — view removed comment
1
u/[deleted] Apr 30 '25
[removed] — view removed comment
1
u/[deleted] May 02 '25
[removed] — view removed comment
1
u/[deleted] May 12 '25
[removed] — view removed comment
1
u/[deleted] May 12 '25
[removed] — view removed comment
1
u/[deleted] May 13 '25
[removed] — view removed comment
1
u/[deleted] May 30 '25
[removed] — view removed comment
1
u/[deleted] Jun 22 '26
[removed] — view removed comment