whatisgithub

What is gemini-web2api?

one880808/gemini-web2api — explained in plain English

Analysis updated 2026-05-18

49JavaScriptAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A worker script that lets OpenAI-style apps talk to Google Gemini for free by mimicking Gemini's web interface.

Mindmap

mindmap
  root((gemini-web2api))
    What it does
      OpenAI-format proxy for Gemini
      Runs on Cloudflare Workers
      No Gemini API key needed
    Tech stack
      JavaScript
      Cloudflare Workers
    Features
      Streaming responses
      Function calling
      Web search endpoint
    Limitations
      No image uploads
      No real session memory
      Google may rate limit
    Audience
      Developers
      CLI tool builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Connect an existing OpenAI-compatible app to Gemini without paying for a Gemini API subscription.

USE CASE 2

Add streaming chat and function calling powered by Gemini to a tool built for OpenAI's API format.

USE CASE 3

Give a coding CLI like Codex or Gemini CLI access to Gemini models through a compatible endpoint.

USE CASE 4

Add web search answers backed by Gemini's native search feature to an existing chatbot.

What is it built with?

JavaScriptCloudflare Workers

How does it compare?

one880808/gemini-web2apibwilky/ha-spotify-browsernetflix/ember-batch-request
Stars495048
LanguageJavaScriptJavaScriptJavaScript
Last pushed2023-03-24
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity3/52/53/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires deploying to Cloudflare Workers and understanding the reverse-engineered auth flow, no image uploads supported.

So what is it?

gemini-web2api is a Cloudflare Workers adaptation of an existing project that lets you talk to Google Gemini through an API format normally used with OpenAI tools. The idea is to take what Gemini offers through its web interface and make it accessible to software that expects to send requests in the OpenAI style, without paying for a Gemini API subscription. You deploy a single JavaScript file to Cloudflare Workers, which acts as a go-between. When your software sends a request in OpenAI format, the worker translates it into the internal format that Gemini's website uses, sends it to Google, then converts the response back before returning it to your software. The translation works by reverse-engineering the data format that Google's web client uses internally. Several Gemini model variants are supported, including Flash, Flash Thinking (which can produce longer outputs), Pro, Auto, and Lite. The Pro label in this context routes to Flash models unless you have a paid Gemini subscription cookie, so it is a preference label rather than a true model switch. Authentication is optional. If you leave the key list empty, anyone can use your deployed worker without a password. You can add API keys to require a bearer token in the same format OpenAI tools use. The service supports streaming responses, function calling in OpenAI format, and a built-in web search feature that uses Gemini's native search capability. It also exposes a Responses API endpoint for Codex CLI compatibility and a native Gemini API endpoint for the Gemini CLI. Known limitations: image and other multimodal inputs are not supported because uploading files to Gemini requires a proprietary protocol that cannot be replicated through standard HTTP. Each request is also treated as a fresh conversation, multi-turn context is simulated by including prior messages in the prompt rather than maintaining a real session. Google may also rate-limit or block high-volume usage.

Copy-paste prompts

Prompt 1
Help me deploy this Cloudflare Worker and point my OpenAI-compatible chat app at it instead of OpenAI.
Prompt 2
Show me how to add a bearer token so my deployed worker isn't open to anyone.
Prompt 3
Explain how the Pro model label actually routes to Flash unless I have a paid Gemini cookie.
Prompt 4
Walk me through setting up the built-in web search endpoint for my chatbot.

Frequently asked questions

What is gemini-web2api?

A worker script that lets OpenAI-style apps talk to Google Gemini for free by mimicking Gemini's web interface.

What language is gemini-web2api written in?

Mainly JavaScript. The stack also includes JavaScript, Cloudflare Workers.

How hard is gemini-web2api to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is gemini-web2api for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.