Gemini load balancer that speaks fluent OpenAI
It round-robins Gemini API keys behind an OpenAI-compatible gateway, adding image generation, web search, and key health monitoring without touching your client code.

What it does
Gemini Balance is a FastAPI-based proxy that sits between your applications and Google’s Gemini API. It manages a pool of API keys, distributing requests sequentially while translating incoming calls into either native Gemini or OpenAI-compatible formats. The app also provides a web dashboard for real-time key monitoring and visual configuration changes that apply without restarting the server.
The interesting bit
The project doesn’t just forward traffic; it adapts Gemini’s native capabilities—like imagen-3.0-generate-002 image generation and web search—into OpenAI-style endpoints, even offering “fake streaming” through its Hugging Face-compatible route. It also auto-disables exhausted or failing keys and periodically resurrects them, effectively treating API keys like cattle rather than pets.
Key highlights
- Sequential polling across multiple Gemini API keys with automatic retry and failure-based disabling.
- Dual-protocol support: exposes both native Gemini (
/gemini/v1beta) and OpenAI-compatible (/hf/v1,/openai/v1) endpoints for chat, embeddings, and image generation. - Visual admin panel for key management, model filtering, and live configuration updates without restarts.
- Integrated image hosting uploads to SM.MS, PicGo, Cloudflare ImgBed, or Aliyun OSS for generated images.
- Optional web search and image-editing capabilities invoked by suffixing model names with
-searchor-image.
Caveats
- Licensed under CC BY-NC 4.0: commercial resale is explicitly prohibited, and the author warns against third-party resellers.
- The “advanced features” route advertises “fake streaming,” which may or may not match your expectations for real-time token delivery.
- The extensive configuration surface—multiple upload providers, thinking budgets, URL context—means setup can get dense before the first request goes through.
Verdict
Ideal for developers running multiple Gemini free-tier or paid keys who want to unify them behind a single OpenAI-compatible URL. Less useful if you already have a single, high-rate-limit enterprise key and no need for protocol translation.
Frequently asked
- What is snailyp/gemini-balance?
- It round-robins Gemini API keys behind an OpenAI-compatible gateway, adding image generation, web search, and key health monitoring without touching your client code.
- Is gemini-balance open source?
- Yes — snailyp/gemini-balance is an open-source project tracked on heatdrop.
- What language is gemini-balance written in?
- snailyp/gemini-balance is primarily written in Python.
- How popular is gemini-balance?
- snailyp/gemini-balance has 5.8k stars on GitHub.
- Where can I find gemini-balance?
- snailyp/gemini-balance is on GitHub at https://github.com/snailyp/gemini-balance.