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

This project allows users to access Google Gemini's latest models via a standardized REST API without needing an official API key. It bypasses the need for keys by using browser cookies to authenticate requests through the Gemini web interface.

How it works

It creates a local API server built with Go and Fiber. The server acts as a bridge, taking requests from the user and forwarding them to Gemini's web interface using provided browser cookies (__Secure-1PSID and __Secure-1PSIDTS). It supports multiple API protocols, allowing it to be used as a drop-in replacement for OpenAI, Claude, and Gemini native SDKs.

Who it’s for

Developers who want to integrate Gemini's capabilities into their own applications or test Gemini locally without relying on official API keys or managing API key quotas.

Highlights

  • Multi-protocol support: Compatible with OpenAI, Claude, and Gemini API formats.
  • Session management: Automatically rotates cookies to maintain active sessions.
  • Easy deployment: Available as a Docker image for quick setup.
  • Interactive documentation: Includes a Scalar UI for testing and documenting the API endpoints.