Google's Gemini, minus the official API key treadmill
A reverse-engineered Python wrapper that piggybacks on the Gemini web app so you can skip the cloud console and the billing dashboard.

What it does
gemini-webapi is an async Python client that talks directly to the Google Gemini web interface instead of the official developer API. You authenticate with browser cookies (__Secure-1PSID and friends), and the library keeps those cookies alive in the background so long-running bots don’t asphyxiate mid-conversation. It exposes chat sessions, file uploads, streaming responses, and even the newer multimodal tricks—image, video, and audio generation—through a surface that deliberately mimics Google’s official SDK.
The interesting bit
The real craft is in the maintenance layer: the client auto-refreshes session cookies, persists them to disk if you point it at a path, and can slurp credentials straight from your local browser via an optional browser-cookie3 dependency. That’s a lot of brittle web-scraping infrastructure made to look like a clean API boundary. The README also notes you should grab cookies from an incognito session and close it immediately, which is the kind of advice that tells you exactly how fragile this house of cards is.
Key highlights
- Supports text, image, video, and audio generation through the web app’s native pipelines
- Deep research workflow with plan creation, polling, and result retrieval
- Gemini Extensions (YouTube, Gmail) and custom Gems (system prompts) exposed as first-class features
- Classified output objects separate text, thoughts, images, videos, and audio in responses
- CLI tool included for quick interactions without writing Python
Caveats
- Requires Python 3.10+; cookie-based auth means you’re at the mercy of Google’s web-app changes
- Auto-refresh may force re-login in the browser session you stole cookies from
- No rate limits or uptime guarantees; this is an unofficial interface that could break without warning
Verdict
Worth a look if you want Gemini’s newer features (especially image/video generation and deep research) without setting up a Google Cloud project or hitting paywalls. Avoid for anything production-critical where an API terms-of-service violation or a DOM change at 3 AM would be catastrophic.
Frequently asked
- What is HanaokaYuzu/Gemini-API?
- A reverse-engineered Python wrapper that piggybacks on the Gemini web app so you can skip the cloud console and the billing dashboard.
- Is Gemini-API open source?
- Yes — HanaokaYuzu/Gemini-API is open source, released under the AGPL-3.0 license.
- What language is Gemini-API written in?
- HanaokaYuzu/Gemini-API is primarily written in Python.
- How popular is Gemini-API?
- HanaokaYuzu/Gemini-API has 3.3k stars on GitHub.
- Where can I find Gemini-API?
- HanaokaYuzu/Gemini-API is on GitHub at https://github.com/HanaokaYuzu/Gemini-API.