Discover and explore top open-source AI tools and projects—updated daily.
SophomorestyGoogle Gemini as an OpenAI-compatible API
New!
Top 24.6% on SourcePulse
This project provides an OpenAI-compatible API endpoint for Google Gemini, enabling developers to leverage Gemini's capabilities through familiar OpenAI SDKs and tools. It offers a zero-authentication, zero-cost solution, acting as a local proxy to bridge the gap between OpenAI's API format and Gemini's web interface, making advanced AI models accessible without direct integration complexities.
How It Works
The core of this project is a reverse-engineered proxy that intercepts and translates requests between the OpenAI API format and Google Gemini's internal web streaming protocol (StreamGenerateContent). It manipulates specific fields within Gemini's request payload, derived from analyzing the Gemini web application's JavaScript, to control model selection and features. This approach allows it to function as a drop-in replacement for OpenAI API calls, routing them to Gemini's backend.
Quick Start & Requirements
python gemini_web2api.pygemini.google.com (proxy/VPN may be required).Highlighted Details
/v1/chat/completions, /v1/models).@think=N suffix.Maintenance & Community
The project acknowledges contributions from "GenericAgent" and inspiration from the "linux.do community". No specific links to community channels, roadmaps, or active maintainer information are provided in the README.
Licensing & Compatibility
Limitations & Caveats
Image and multimodal input are not supported due to Gemini's reliance on proprietary RPC protocols. The "Pro" model requires a specific cookie for actual routing; otherwise, it defaults to the Flash model. Conversations are single-turn, with multi-turn context simulated by re-sending history. Users may encounter rate limiting from Google for high-frequency requests.
6 days ago
Inactive