Practical overview
When it fits
Use it when you need a self-hosted REST gateway to Gemini’s web interface and can configure and protect the required browser-session cookies.
Who it is for
- Developers who want to route application prompts to Gemini through a REST interface.
- Teams or individual builders working with clients that expect OpenAI-, Claude- or Gemini-compatible API formats.
- Developers exploring a self-hosted Gemini integration without using a Gemini API key.
Documented uses
- Send prompts to Gemini through a local or self-hosted API server.
- Connect API clients to Gemini using a supported compatibility format.
- List model IDs discovered from the signed-in Gemini account’s web model registry.
Requirements & limits
The service requires a complete Cookie request header from a signed-in Gemini web session. Docker and Docker Compose are documented options; direct execution requires Go 1.21 or later. The project is MIT-licensed.
- Authentication depends on Gemini web-session cookies rather than a Gemini API key.
- The project is reverse-engineered, is not affiliated with Google, and cautions that its method may not comply with Google’s terms.
- The README describes the project as intended for research and education and discourages commercial use.
- Model IDs are discovered from the account’s current Gemini web model registry and may change.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run the service with Docker and a Gemini session
Start the documented Docker container with cookies from a signed-in Gemini web session.
Before you start
- Docker
- A signed-in Gemini web session
- The complete Cookie request header from a batchexecute?rpcids=otAQ7b network request
Steps
Sign in to Gemini, open browser developer tools to Network, reload Gemini, and select a batchexecute?rpcids=otAQ7b request.
Copy its complete Cookie request header; if its URL includes an account slot such as /u/2/, note the matching slot value.
Run the documented Docker command, setting GEMINI_COOKIES to the cookie header and GEMINI_AUTH_USER to the matching slot when applicable.
Expected outcome
The documented container starts the API server on port 4981.
Guide limitations
- Cookies provide access to the associated Google account and must be kept private.
- The project uses reverse-engineered web cookies, is not affiliated with Google, and notes that this approach may not comply with Google’s terms.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- ntthanh2603/gemini-web-to-api · Official homepage title · retained in its source language

