Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Prompts

Gemini API free credits multiplied: deploy gemini-balance load balancing for free with ClawCloud

2025-07-27 28

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.

  1. interviews Google AI Studio Application page: https://aistudio.google.com/
  2. Sign in with your Google account and create an API key.
  3. Repeat this process for multiple separate API keys if necessary by registering and logging in to multiple different Google accounts.

Apply for a key

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.

  1. interviews ClawCloud official website and use your GitHub Account Login.Select github login
  2. After logging in, in the user center of the Account Center You can view the monthly gifted amount and the current usage.ClawCloud's User Center

Deploying gemini-balance in ClawCloud

Next, we'll use the ClawCloud Run to containerized deployment gemini-balanceThe

  1. Select server area
    exist ClawCloud main interface, click on the upper left corner of the RegionRecommended choices Singapore. After the page refreshes, make sure the area is preceded by a check mark.Select Server Address
  2. Creating Applications
    strike (on the keyboard) App Launchpad, then click on the top right corner of the page Create App Go to the Application Configuration page.Create App
  3. Configuring Application Parameters
    On the configuration page, fill in the parameters as described below:

    • Image Nameghcr.io/snailyp/gemini-balance:latest
    • Application Namegeminibalance (or whatever name you prefer)
    • ImagePublic

    Fill in the mirror information

    • UsageFixed
    • Replicas1
    • CPU1
    • Memory512
      Note: This configuration applies to the free credit, which provides 10G of free traffic per month.
    • Network
      • Container Port8000
      • Enable Internet: Tap as Access state of affairs
  4. Configuring Environment Variables
    exist Advanced Configura -> Environment Variables section, click on the Add, add the following variables. where API_KEYS cap (a poem) ALLOWED_TOKENS It 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/Shanghai
    

    Variable 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

Configuring Environment Variables

  1. Configuration Storage
    strike (on the keyboard) Add Storage, set up as shown in the diagram, the container of the /app/db path is mounted to persistently store the data.Setting up storage
  2. Deploying applications
    Return to the top of the page and click Deploy Application. In the confirmation pop-up window, select YesTheDeploying applications
  3. 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 shows running. Underneath the Network tab, the public address (Public address) The initial state may be pendingPlease wait for 2-5 minutes until it turns into a Please wait for 2-5 minutes until it becomes Available. At this point, your service can be accessed at this address.Checking the operational status
  4. (Optional) Setting up a customized domain name
    If you wish to access it using your own domain name, you can do so in the Cloudflare and other DNS providers to add a CNAME Records, pointing to ClawCloud public network address provided. Then add the address of the public network to the ClawCloud Add your customized domain name to the domain settings of theSetting up a customized domain name

IV. Managing and monitoring gemini-balance

gemini-balance Provides a convenient administration backend for configuring and monitoring API keys.

  1. 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_TOKENS The access token set in the your-access-token-1) to log in.gemini-balance monitor page login
  2. Once logged in, you can dynamically add or remove Gemini API key without restarting the service.Configuration interface
  3. The management background also provides monitoring of each key's call status, which is convenient for you to track the usage status.Monitoring Gemini API Key calls

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.

  1. Add Provider
    exist Cherry Studio In it, go to Model Provider Settings and add a new provider with a customizable name.Add Provider
  2. Configuring Interface Information
    • API key: Fill in the information you have in the gemini-balance environment variable ALLOWED_TOKENS The access token set in the
    • API Address: Fill in ClawCloud Provide the public access address, taking care not to end with the /The
  3. Managing and using models
    After saving, click on "Manage" and the client will automatically retrieve the information from your gemini-balance The service pulls and displays a list of available models. You are now ready to select and use the model in the client Gemini model, all requests will be distributed through the load balancing service you have built.call effect

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

inbox

Contact Us

Top

en_USEnglish