ntthanh2603/gemini-web-to-api
✨Reverse-engineered API for Gemini web app. It can be used as a genuine API key from OpenAI, Gemini, and Claude.
What it solves
Normally, to use Google Gemini's models programmatically you need an official API key and quota. This project removes that barrier by converting Gemini's web interface (the chatbot you use in a browser) into a local API server. You just paste your browser cookies into the configuration, and the server handles authentication and session maintenance so you can call Gemini from your own code without an API key.
How it works
The server runs locally (default port 4981) and talks to Gemini's web backend using the batchexecute request that your browser already makes. It extracts the cookie header from your logged-in browser session and uses it to authenticate requests. The server periodically rotates cookies to keep the session alive and avoid being blocked. It exposes three API styles: OpenAI-compatible (/openai/v1), Claude-compatible (/claude), and Gemini-native (/gemini). Model names are discovered dynamically from your account's Gemini Web model registry, so newly added models become available without code changes. It also supports image generation, image inputs, video generation, canvas documents, and music generation through the same interface.
Who it's for
Developers who want to build applications on Gemini's latest models without an API key, or who want to test Gemini integration locally. It's also useful for prototyping with cookie-based authentication. Because it offers multiple API formats, it works as a drop-in replacement for existing OpenAI, Claude, or Gemini SDKs.
Highlights
- No API key required — just browser cookies
- Supports OpenAI, Claude, and Gemini API protocols from a single server
- Dynamic model discovery from Gemini Web's registry (e.g.,
gemini-auto,gemini-3.6-flash) - Extends beyond chat: image generation, image inputs, video generation, Canvas files, and music generation
- Built with Go and Fiber for high performance, with Docker and Docker Compose support
- Includes rate limiting, cookie rotation, and session management to avoid being blocked
- Interactive API documentation at
/docsvia Scalar UI
Related
- Project
- Project
- Project
- Project
- Project