Deploy Gemini Balance
Gemini API Proxy and Load Balancer
snailyp/gemini-balance:latest
Just deployed
/data
Deploy and Host Gemini Balance on Railway
Gemini Balance is an open-source proxy and load balancer for the Google Gemini API. It lets you manage multiple Gemini API keys with automatic rotation, authentication, request retries, model filtering, monitoring, image generation, and OpenAI-compatible API endpoints—all through a simple web interface.
About Hosting Gemini Balance
Deploying Gemini Balance on Railway provides a fast and reliable way to host your own Gemini API gateway without managing infrastructure. Railway automatically handles networking, HTTPS, and persistent storage, while Gemini Balance manages API key rotation, authentication, usage monitoring, retries, and model synchronization. The included web dashboard allows you to manage keys, monitor their health, and update settings without restarting the application. Once deployed, simply configure your Gemini API key(s) and authentication token to start using OpenAI-compatible and Gemini-compatible endpoints for AI applications.
Common Use Cases
- Create an OpenAI-compatible endpoint backed by Google Gemini.
- Load balance and rotate multiple Gemini API keys automatically.
- Host a private Gemini gateway for AI apps, agents, and automation tools.
- Generate images, embeddings, and chat completions through a single API.
- Monitor API key status and usage from a built-in admin dashboard.
Dependencies for Gemini Balance Hosting
The Railway template includes everything needed to run Gemini Balance.
You'll only need to provide:
- Gemini API Key(s) (
API_KEYS) - Authentication Token (
AUTH_TOKEN) used to access the admin dashboard and API
No database configuration is required. The template uses SQLite with persistent storage by default.
Deployment Dependencies
- GitHub Repository: https://github.com/snailyp/gemini-balance
- Google AI Studio: https://aistudio.google.com/app/apikey
- Gemini API Documentation: https://ai.google.dev/
Configuration
After deployment:
- Open your Railway deployment URL.
- Log in using your configured AUTH_TOKEN.
- Add or update your Gemini API keys from the admin dashboard if needed.
- Start using the available Gemini and OpenAI-compatible API endpoints.
Only two environment variables are required before deployment:
AUTH_TOKEN— Any secure password or token used for authentication.API_KEYS— One or more Gemini API keys.
All other settings use sensible defaults and can be modified later from the web management interface.
API Endpoints
Gemini Balance exposes multiple compatible APIs:
- Gemini API (
/gemini/v1beta) - OpenAI Compatible API (
/openai/v1) - Hugging Face Compatible API (
/hf/v1) - Image Generation API
- Embeddings API
Why Deploy Gemini Balance on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Gemini Balance on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
snailyp/gemini-balance:latest
ghcr.io/snailyp/gemini-balance:latest