Multiply Gemini API Free Credits with Load Balancing
Google offers developers a generous Gemini API free usage credits through Google AI Studio It's easy to get an API key. Free packages usually include a per-minute rate limit and total daily Token Call volume. Although the amount of a single key is limited, by registering different accounts to apply for multiple keys, and with the help of load balancing tools, you can effectively break through this limitation and multiply the amount.
In this article, we will present gemini-balance, a program designed to provide Google Gemini API provides proxy and load balancing functionality to the application. This project was developed by the developer snailyp Created, based on Python FastAPI builds that allow users to manage multiple Gemini API keys for polling, authentication, model filtering, and state monitoring.
We're going to do that with a free ClawCloud Container services to deploy gemini-balanceThis allows for the creation of a stable, proxy-free system that integrates multiple Gemini A personal proprietary interface for API keys.
- Project address. https://github.com/snailyp/gemini-balance
- Deployment Documentation. https://gb-docs.snaily.top/guide/setup-clawcloud-sqlite.html
I. Prepare Multiple Gemini API Keys
gain Gemini API keys are a prerequisite for deploying services.
- interviews
Google AI StudioApplication page: https://aistudio.google.com/ - Sign in with your Google account and create an API key.
- Repeat this process for multiple separate API keys if necessary by registering and logging in to multiple different Google accounts.

Register for a ClawCloud account
ClawCloud is a cloud computing platform founded in 2024 and headquartered in Singapore, specializing in high-performance cloud infrastructure services for developers. Its ClawCloud Run is a Platform-as-a-Service (PaaS) offering that greatly simplifies the application deployment process. For users who have been registered on Github for more than 180 days, theClawCloud Offering a monthly gift of $5.00 is sufficient to support the gemini-balance Ongoing operation of the project.
- interviews
ClawCloudofficial website and use yourGitHubAccount Login.
- After logging in, in the user center of the
Account CenterYou can view the monthly gifted amount and the current usage.
Deploying gemini-balance in ClawCloud
Next, we'll use the ClawCloud Run to containerized deployment gemini-balanceThe
- Select server area
existClawCloudmain interface, click on the upper left corner of theRegionRecommended choicesSingapore. After the page refreshes, make sure the area is preceded by a check mark.
- Creating Applications
strike (on the keyboard)App Launchpad, then click on the top right corner of the pageCreate AppGo to the Application Configuration page.
- Configuring Application Parameters
On the configuration page, fill in the parameters as described below:- Image Name:
ghcr.io/snailyp/gemini-balance:latest - Application Name:
geminibalance(or whatever name you prefer) - Image:
Public

- Usage:
Fixed - Replicas:
1 - CPU:
1 - Memory:
512
Note: This configuration applies to the free credit, which provides 10G of free traffic per month. - Network
- Container Port:
8000 - Enable Internet: Tap as
Accessstate of affairs
- Container Port:
- Image Name:
- Configuring Environment Variables
existAdvanced Configura->Environment Variablessection, click on theAdd, add the following variables. whereAPI_KEYScap (a poem)ALLOWED_TOKENSIt needs to be replaced with your own key and access token.DATABASE_TYPE=sqlite SQLITE_DATABASE=default_db API_KEYS=["YOUR_GEMINI_API_KEY_1","YOUR_GEMINI_API_KEY_2"] ALLOWED_TOKENS=["YOUR_ACCESS_TOKEN_1"] AUTH_TOKEN= TZ=Asia/ShanghaiVariable Description.
| variable name | clarification | Format and examples |
|---|---|---|
API_KEYS |
Gemini API Key lists for load balancing | ["key-1","key-2"] |
ALLOWED_TOKENS |
List of authorization tokens allowed to access this service | ["token-1","token-2"] |
AUTH_TOKEN |
(Optional) Super Administrator token with all privileges. If not filled in, the default is to use the ALLOWED_TOKENS The first value of the |
sk-123456 |

- Configuration Storage
strike (on the keyboard)Add Storage, set up as shown in the diagram, the container of the/app/dbpath is mounted to persistently store the data.
- Deploying applications
Return to the top of the page and clickDeploy Application. In the confirmation pop-up window, selectYesThe
- Check deployment status
After waiting for a few seconds, the page will jump to the application status screen. Please make sure the upper left corner showsrunning. Underneath theNetworktab, the public address (Public address) The initial state may bependingPlease wait for 2-5 minutes until it turns into a Please wait for 2-5 minutes until it becomesAvailable. At this point, your service can be accessed at this address.
- (Optional) Setting up a customized domain name
If you wish to access it using your own domain name, you can do so in theCloudflareand other DNS providers to add aCNAMERecords, pointing toClawCloudpublic network address provided. Then add the address of the public network to theClawCloudAdd your customized domain name to the domain settings of the
IV. Managing and monitoring gemini-balance
gemini-balance Provides a convenient administration backend for configuring and monitoring API keys.
- Open your deployed public address in a browser and go to the login screen. Enter the values you have specified in the environment variable
ALLOWED_TOKENSThe access token set in theyour-access-token-1) to log in.
- Once logged in, you can dynamically add or remove
GeminiAPI key without restarting the service.
- The management background also provides monitoring of each key's call status, which is convenient for you to track the usage status.

V. Using Proxy Services in AI Clients
Once the deployment is complete, you can add a new configuration file to any of the supported OpenAI API-formatted clients use this proxy service. Take Cherry Studio As an example, it is a multi-platform support AI desktop client that can easily integrate and switch between different AI Model.
- Add Provider
existCherry StudioIn it, go to Model Provider Settings and add a new provider with a customizable name.
- Configuring Interface Information
- API key: Fill in the information you have in the
gemini-balanceenvironment variableALLOWED_TOKENSThe access token set in the - API Address: Fill in
ClawCloudProvide the public access address, taking care not to end with the/The
- API key: Fill in the information you have in the
- Managing and using models
After saving, click on "Manage" and the client will automatically retrieve the information from yourgemini-balanceThe service pulls and displays a list of available models. You are now ready to select and use the model in the clientGeminimodel, all requests will be distributed through the load balancing service you have built.



































