gemini-web2api is a Python-based API server that exposes Google Gemini's web interface as an OpenAI-compatible endpoint.
The tool solves the problem of integrating Gemini's capabilities into applications built around OpenAI's API contract. It works by running a local server that accepts requests in OpenAI format and translates them to Gemini's web interface, eliminating the need for authentication when used without configured API keys. The server supports optional Bearer token authentication and can route requests to multiple Gemini models including Flash, Extended Thinking, Pro, and Lite variants. It handles function calling in OpenAI format, adjustable thinking depth via model name suffixes, built-in web search, and server-sent event streaming.
Developers should choose this tool if they want to use Gemini models through existing OpenAI-compatible clients without modifying application code. It suits projects that need a drop-in replacement for OpenAI endpoints or want to experiment with Gemini's capabilities like extended thinking and web search. The tool works cross-platform as pure Python with an optional dependency only for streaming support. For the Pro model, users need a Gemini Advanced subscription and can provide authentication via browser cookies; other models work anonymously. The project also supports Google's native Gemini API endpoints for compatibility with the Gemini CLI.
Development activity shows consistent maintenance with regular updates addressing functionality and compatibility. The project maintains documentation in multiple languages and provides clear configuration examples for various client types. Issues and feature requests receive attention, and the codebase remains actively refined to support new Gemini model releases and improve streaming reliability.