Convert Google Gemini's web interface into a free, self-hosted, OpenAI-compatible API for development and experimentation.
gemini-web2api is an open-source Python tool that converts Google Gemini's web interface into an OpenAI-compatible API. Created by GitHub user Sophomoresty, it allows developers to access Gemini models like Flash and Pro without official API keys or costs by reverse-engineering the web application's internal communication protocol. This provides a free, self-hosted alternative for integrating Gemini's capabilities into other applications.
The user runs a Python script from the command line, which starts a local web server. This server acts as a proxy, accepting standard OpenAI API requests and translating them into the internal format used by the Gemini web app. It sends these requests to Google's endpoints and converts the responses back to the OpenAI format. The tool is open-source, requires no external dependencies, and can be configured to use Google account cookies for full model access.
Developers who want to use Google's Gemini models through a standard OpenAI API client without needing to pay for or manage official API keys.
The tool does not support image or multimodal inputs. Accessing the true Pro model may require a valid cookie from a paid Google account. Each API call is a single-turn conversation, and high-frequency use may be rate-limited by Google.