← all repositories
Nativu5/Gemini-FastAPI

Borrowing Gemini’s web brains without a Google API key

It wraps Google’s web-only Gemini interface in an OpenAI-compatible API, letting you call models with browser cookies instead of an official Google API key.

Gemini-FastAPI
Not currently ranked — collecting fresh signals.
star history

What it does

Nativu5/Gemini-FastAPI is a FastAPI layer that sits on top of an unofficial, reverse-engineered client for Google’s web-based Gemini. It translates your requests into the OpenAI API format, so standard chat-completion clients can talk to Gemini without a Google Cloud account or billing setup. The server handles multi-turn conversations via LMDB, supports text, images, and file uploads, and can distribute load across multiple Google accounts with per-account proxies.

The interesting bit

The project treats your browser session cookies—specifically __Secure-1PSID and __Secure-1PSIDTS—as authentication tokens, effectively turning a personal web login into a persistent API credential. It also adds practical engineering touches like conversation compaction and oversized context strategies when Google’s temporary chat mode is enabled.

Key highlights

  • OpenAI-compatible endpoints for chat completions, streaming, tool calling, and structured JSON output
  • Multi-account load balancing with individual proxy settings to work around rate limits
  • LMDB-backed conversation persistence for multi-turn chat reuse
  • Supports custom model definitions via arbitrary HTTP headers, suggesting it can target unreleased or experimental Gemini variants
  • Runs in a container with environment-variable configuration, though it needs mounted volumes to preserve cookies and chat history across restarts

Caveats

  • Relies on reverse-engineered web endpoints that may break without warning and almost certainly violate Google’s Terms of Service
  • Requires manually extracting and periodically refreshing session cookies from a browser’s developer tools
  • The README warns this is strictly for educational and research purposes, not production use

Verdict

Worth a look if you want to experiment with Gemini’s web models from existing OpenAI client code and don’t mind the cookie-jar authentication dance. Avoid it if you need stability, compliance, or anything resembling a supported service-level agreement.

Frequently asked

What is Nativu5/Gemini-FastAPI?
It wraps Google’s web-only Gemini interface in an OpenAI-compatible API, letting you call models with browser cookies instead of an official Google API key.
Is Gemini-FastAPI open source?
Yes — Nativu5/Gemini-FastAPI is open source, released under the MIT license.
What language is Gemini-FastAPI written in?
Nativu5/Gemini-FastAPI is primarily written in Python.
How popular is Gemini-FastAPI?
Nativu5/Gemini-FastAPI has 676 stars on GitHub.
Where can I find Gemini-FastAPI?
Nativu5/Gemini-FastAPI is on GitHub at https://github.com/Nativu5/Gemini-FastAPI.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.