Are you a developer using intelligent coding plugins like Cline or Roo Code and frequently encountering 429 too many requests
errors with the free tier of the Gemini API? This often happens due to concurrency limits when making multiple requests.
This tool provides a solution by aggregating multiple Gemini API keys and distributing requests among them. By using this extension, you can effectively overcome the limitations of a single free API key, achieving double freedom in both token usage and query frequency.
This is a project that integrates a Google Gemini API Key local proxy server into a VS Code extension. It aims to solve the concurrency limitations when using a single API Key and supports streaming responses.
- Embeds an HTTP proxy server within the VS Code extension.
- Manages multiple Google Gemini API Keys.
- Distributes API requests to different Keys based on a strategy (currently simple round-robin).
- Supports forwarding streaming responses from the Google Gemini API.
- Handles rate limiting errors and cools down Keys.
Install the extension from the VS Code Marketplace.
Alternatively, you can build and install from source. See the Development Guide for instructions.
API Keys are managed through the VS Code command palette.
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
- Run the command "Gemini: Add API Key".
- Enter your Gemini API Key in the input box. The input will be hidden like a password.
- You can add multiple keys by running the command again.
- To view a summary of added keys, run the command "Gemini: List API Keys".
- To modify an existing key, run the command "Gemini: Modify API Key".
- To delete a key, run the command "Gemini: Delete API Key".
Once the proxy server is successfully started, it will listen on a specific port (default is 3145). Other extensions that need to use the Gemini API (like Cline) can configure their API Endpoint to point to the address and port of this local proxy server.
For example, in the Cline extension settings, configure the Gemini API Endpoint to http://localhost:3145
.
- Consider more complex request distribution strategies.
If you find this project helpful, please consider giving it a star on GitHub! Your support is greatly appreciated.