Google gives you roughly 500 free requests per day on Gemini 3.1 Flash Lite per project. Most developers accept that ceiling and move on. The smarter play: create a second Google account, spin up a lightweight proxy that rotates between both keys, and double your throughput to around 1,000 daily requests without spending a cent. This is not a hack or a terms-of-service gray area. You are simply using two separate free-tier projects the way Google designed them: rate limits apply per project, not per person.

What Gemini 3.1 Flash Lite actually is

Google released Gemini 3.1 Flash Lite in March 2026 as their fastest and cheapest model. It handles text, images, video, audio, and PDFs with a 1-million-token context window. At 313 tokens per second output speed, it ranks in the top 5 fastest models available today according to Artificial Analysis benchmarks.

The tradeoff is intelligence. This is not a model for complex reasoning or agentic coding. It scores 25 on the Artificial Analysis Intelligence Index, landing at rank 46 out of 162 models. Where it shines is high-volume, lightweight work: translation, classification, data extraction, transcription, summarization, and routing queries to heavier models. Think of it as the conveyor belt in your pipeline, not the brain.

On the free tier, you get approximately 15 requests per minute and 1,000 to 1,500 requests per day, depending on current Gemini free tier limits. The RPD quota resets at midnight Pacific time. Critically, these limits are per Google Cloud project, not per API key. Creating extra keys in the same project does nothing. Creating a separate project with its own key gives you an entirely separate quota pool.

The proxy that makes rotation invisible

LLM-API-Key-Proxy is an open-source, self-hosted FastAPI server that sits between your tools and any LLM provider. It exposes a single OpenAI-compatible endpoint at http://127.0.0.1:8000/v1 and handles all the key management behind the scenes.

You give it multiple API keys for the same provider (in this case, two Gemini keys from two different Google accounts). When you send a request, the proxy picks a key, forwards the request, and if that key hits a rate limit (HTTP 429), it automatically retries with the next key. The rotation mode for Gemini defaults to sequential: it uses one key until that key is exhausted, then switches to the next. When the first key's quota resets, it cycles back.

The project supports much more than simple Gemini rotation: OpenAI, Anthropic, OpenRouter, Mistral, and even Gemini CLI OAuth. But for our use case, two plain Gemini API keys are enough.

The exact setup

Here is what you need and nothing more.

Step 1: Create two Google Cloud projects.

Go to Google AI Studio, create two separate projects. Generate an API key in each. Do not enable billing on either project: the moment you enable billing, the free tier disappears entirely and every token becomes billable. This is a known trap that catches developers regularly.

Step 2: Clone and configure the proxy.

git clone https://github.com/Mirrowel/LLM-API-Key-Proxy.git
cd LLM-API-Key-Proxy
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Copy the example environment file and add your keys:

cp .env.example .env

In .env, set these values:

PROXY_API_KEY="any-secret-string-you-want"
GEMINI_API_KEY_1="your-first-google-api-key"
GEMINI_API_KEY_2="your-second-google-api-key"
ROTATION_MODE_GEMINI=sequential

That is it. The proxy auto-discovers keys from environment variables. The _1 and _2 suffixes tell it you have two keys for the gemini provider.

Step 3: Start the proxy.

./runme.sh

Or directly: python src/proxy_app/main.py. The proxy starts on 127.0.0.1:8000 and presents a TUI launcher. You can bypass the TUI with --host 127.0.0.1 --port 8000 flags.

Step 4: Point OpenCode at the proxy.

In ~/.config/opencode/opencode.json, add a provider section:

{
  "provider": {
    "llm-proxy": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "http://localhost:8000/v1",
        "apiKey": "your-proxy-api-key"
      },
      "models": {
        "gemini/gemini-3.1-flash-lite": {
          "name": "Gemini 3.1 Flash Lite"
        }
      }
    }
  }
}

The gemini/ prefix in the model name is important: it tells the proxy which provider backend to route to. Without it, the proxy does not know where to send the request.

You can also add other Gemini models the same way. Flash, Flash Lite, 2.5 Flash Lite, 3.5 Flash: they all work through the same proxy with the same rotation logic.

If you already use OpenCode Go with other providers like Claude, the proxy config sits alongside your existing setup without conflict. We covered the permanent OpenCode Go configuration for Claude Code in a previous post: the same principles apply here, just with a different provider block.

What the rotation looks like in practice

When your first key hits the daily quota (around 500 requests for Flash Lite), the proxy logs a Gemini API rate limit error (HTTP 429), puts that key on cooldown until midnight Pacific, and seamlessly switches to the second key. Your tool never sees the error. From OpenCode's perspective, it is just talking to one API endpoint.

The proxy tracks usage per key per model in JSON files under the usage/ directory. You can check at any time how close each key is to exhaustion. The sequential rotation mode is the right choice here: for daily quotas, you want to drain one key completely before touching the next, rather than spreading requests thin and potentially hitting limits on both keys simultaneously.

Where this setup breaks down

Gemini 3.1 Flash Lite is not a drop-in replacement for Claude or GPT-4 for complex tasks. The benchmark data is clear: it ranks near the bottom on agentic coding (31% on Terminal-Bench v2.1), physics reasoning, and advanced tool use. If you need a model to architect a system, debug a complex race condition, or write production-quality code with nuanced tradeoffs, this is not it.

Where it works: bulk translation, content classification, simple data extraction from structured inputs, transcription, and acting as a cheap router that decides which expensive model should handle a given query. For those tasks, 1,000 free requests per day is generous.

Another limitation: the free tier quotas are not guaranteed. Google has cut them before (50 to 80% reduction in December 2025 with no notice). Treat this as a development and prototyping setup, not a production infrastructure decision. For production, you want paid keys with explicit SLAs.

The math

Two Google accounts, each with a free-tier Gemini project: $0/month. The proxy runs on your local machine or a $5/month VPS. For lightweight API tasks like translation, classification, and data extraction, that gives you roughly 1,000 requests per day against a model that processes at 313 tokens per second with a 1-million-token context window.

Compare that to paying for the same throughput on a paid provider. Even at Gemini 3.1 Flash Lite's cheap pricing ($0.25 per 1M input tokens), 1,000 requests averaging 2,000 input tokens each would cost around $0.50/day or $15/month. Not expensive, but not free either. And the gap widens the more you use it.

The real value is not the $15 saved. It is the friction removed. You can iterate freely on prompts, test pipelines, and experiment with model routing without watching a billing dashboard. That freedom compounds.

Frequently asked questions

Is rotating API keys to bypass Gemini free tier limits against Google's terms of service?

No. Each Google Cloud project has its own independent quota. Creating two projects with separate API keys is the intended usage model. Google explicitly structures rate limits per project, not per person or per account. You are not circumventing anything: you are using two separate free tiers the same way you would use two separate AWS accounts.

Will this API key rotation setup work with tools other than OpenCode?

Yes. The LLM-API-Key-Proxy exposes a standard OpenAI-compatible endpoint. Any tool that supports a custom OpenAI base URL works: Continue, Cursor, JanitorAI, SillyTavern, Claude Code (via the Anthropic-compatible endpoint), or any Python script using the OpenAI SDK. You just change the base URL and API key in your tool's config.

What happens if Google changes the Gemini free tier rate limits?

Google has reduced free tier quotas before (the December 2025 cut was 50 to 80% with no notice). If quotas drop, your per-project request count drops proportionally, but the rotation still works: two projects still give you double whatever one project gets. The proxy itself is provider-agnostic, so if Gemini free tier becomes unusable, you can swap in OpenRouter, Mistral, or any other supported provider with minimal config changes.

Can I add more than two API keys for higher throughput?

Absolutely. The proxy supports unlimited keys per provider. Add GEMINI_API_KEY_3, GEMINI_API_KEY_4, and so on in your .env file. Each key needs to come from a separate Google Cloud project to get its own quota pool. Three projects means roughly 1,500 free requests per day; five projects means roughly 2,500.