Gemini-API
Gemini-API is a reverse-engineered Python wrapper for Google's Gemini web interface, offering asynchronous access to text generation, image/video/audio creation, and multi-turn conversations with automatic cookie refresh for persistent authentication.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | HanaokaYuzu/Gemini-API |
| Owner | HanaokaYuzu |
| Primary language | Python |
| License | AGPL-3.0 — OSI-approved |
| Stars | 3.3k |
| Forks | 518 |
| Open issues | 44 |
| Latest release | v2.0.0 (2026-04-06) |
| Last updated | 2026-06-22 |
| Source | https://github.com/HanaokaYuzu/Gemini-API |
What Gemini-API is
Async Python library that mirrors Gemini's web API surface without official SDK, supporting streaming, extensions, deep research workflows, and classified response outputs (text, images, thoughts, videos). Requires credential extraction from authenticated browser sessions and manages session persistence via background cookie refresh.
Get the Gemini-API source
Clone the repository and explore it locally.
git clone https://github.com/HanaokaYuzu/Gemini-API.gitcd Gemini-API# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires manual extraction of `__Secure-1PSID` and `__Secure-1PSIDTS` cookies from authenticated browser sessions; optional browser-cookie3 dependency automates this for supported browsers only.
- Background cookie auto-refresh may trigger re-authentication prompts in the browser; deploy isolated login sessions to avoid disruption.
- No rate limiting or backpressure handling exposed; implement client-side throttling to avoid detection or blocking by Google's anti-bot measures.
- Classified response outputs (thoughts, candidate replies, extended generation metadata) require parsing multiple response attributes; consult ModelOutput schema carefully.
- Deep research and extension features are subject to real-time availability on gemini.google.com; fallback behavior for unsupported regions/accounts is undocumented.
When to avoid it — and what to weigh
- Production systems requiring SLA guarantees — Reverse-engineered API with no official support or service-level agreements; breaking changes risk is material when Google updates the web interface.
- Compliance-critical or regulated environments — No audit trail, official security documentation, or Terms of Service alignment; use of unofficial APIs may violate compliance frameworks or Google's ToS.
- High-volume commercial API usage — Intended for programmatic web scraping; lacks rate limiting controls, usage tiers, and official authentication. Google may block accounts or IP ranges.
- Team development with strict licensing requirements — AGPL-3.0 license requires source code disclosure of derivative works and modifications; commercial/proprietary integration requires legal review.
License & commercial use
AGPL-3.0 (GNU Affero General Public License v3.0). Strong copyleft: any distributed modifications or derivative works must disclose source code to end-users. If integrated into a network service, the modified source must be made available to service users. Commercial use is permitted only if all derived code is also released under AGPL-3.0.
AGPL-3.0 permits commercial use but requires source disclosure of modifications. If deployed as a service (e.g., SaaS), users must receive the modified source code. Proprietary integrations or internal-only deployment may require relicensing or legal review. Additionally, use of an unofficial reverse-engineered API may violate Google's Terms of Service; commercial use requires assessment of ToS compliance independent of open-source licensing.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Possible |
| Assessment confidence | Medium |
No formal security audit or threat model documented. Authentication depends on long-lived browser session cookies; if leaked, no rotation mechanism is built-in (relies on Google's backend). Background cookie refresh mechanism auto-executes without explicit user consent; implications for headless/automated environments require case-by-case assessment. Reverse-engineering nature means no cryptographic transport validation or API versioning; payloads could be subject to MITM if proxy is misused. For regulated or sensitive data, official Gemini API (via Vertex AI) is strongly preferred.
Alternatives to consider
Google Generative AI Python SDK (official)
Official, supported API with stable SDKs, published security policies, SLA guarantees, and clear ToS. No AGPL copyleft or reverse-engineering risks. Preferred for production and commercial use.
OpenAI API + GPT-4
Mature, widely-deployed commercial API with clear pricing, rate limits, audit trails, and compliance features. Different model behavior but lower operational risk for business-critical applications.
Anthropic Claude API
Official SDK with published safety research, transparent pricing, and compliance controls. Suitable for high-assurance use cases where model transparency is valued.
Build on Gemini-API with DEV.co software developers
For commercial or compliance-critical use, consult our team on official Google Cloud APIs and custom AI development services.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
Gemini-API FAQ
Can I use this in a commercial product?
What happens if Google changes the web interface?
How does cookie auto-refresh work?
Is this as reliable as the official Gemini API?
Work with a software development agency
DEV.co helps companies turn open-source tools like Gemini-API into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your ai frameworks stack.
Need a production-ready Gemini integration?
For commercial or compliance-critical use, consult our team on official Google Cloud APIs and custom AI development services.