EvanZhouDev / gemini-ai

The simpler JavaScript Gemini SDK
https://www.npmjs.com/package/gemini-ai
GNU General Public License v3.0
95 stars 16 forks source link

Support for multiple API Keys #14

Closed XInTheDark closed 4 weeks ago

XInTheDark commented 4 weeks ago

Hi again! Would it be beneficial to implement support for multiple API Keys? Instead of inputting one key, support can be added for passing an array of API Keys during initialisation. In the API, it could try to make a request using each API Key in order; if for example the key isn't valid or if a rate limit is reached, then it goes on to try the next key.

Reason: The main downside to using gemini-1.5-pro is simply the low rate limits (only 50 requests per day, pretty low for normal use). If we can input 5 API keys for example (this is quite feasible as most people have quite a few google accounts), the limit becomes 250 which is much better and suitable for daily use.

I believe this isn't against Gemini ToS, as I didn't see anything about forbidding multiple google accounts. Please feel free to close this if it in fact is.

EvanZhouDev commented 4 weeks ago

My original thought is that this is out of scope. It has been made that you can make individual Gemini object so that you can do this on your own. However, if you believe that this is in scope, please let me know your argument.

XInTheDark commented 4 weeks ago

Indeed, I also agree that the extra complexity isn't worth it, and currently it's pretty simple for the user to implement this anyways. Closing :)