# sophomoresty/gemini-web2api

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/sophomoresty-gemini-web2api).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

3,571 stars · 784 forks · Python · MIT

## Links

- GitHub: https://github.com/Sophomoresty/gemini-web2api
- awesome-repositories: https://awesome-repositories.com/repository/sophomoresty-gemini-web2api.md

## Description

gemini-web2api is a self-hosted reverse proxy that puts an OpenAI-compatible API in front of the Gemini web interface. Instead of an official API key, it authenticates upstream requests with the cookies, account index, and page token from a signed-in browser session. Existing OpenAI-style clients, libraries, and agents can then use Gemini as their model backend without code changes.

The proxy translates OpenAI-style chat, model-listing, tool-calling, and Responses requests into Gemini web requests. Replies stream back incrementally over server-sent events. Function definitions are converted into the upstream prompt format, and model output is parsed back into structured tool calls. Model variant and reasoning depth are chosen through a suffix on the model name, with fast, extended-thinking, pro, auto, and lite options. A Responses-style endpoint and native model endpoints let command-line coding assistants use the local proxy as their backend.

Chat messages can include images as HTTP links or base64 data URLs, which are uploaded for the model to interpret. Access to the API can be restricted with bearer or key-header authentication, and it stays open when no keys are configured. Upstream traffic can go through an HTTP proxy set by command-line argument, config file, or environment variable. The service can run in Docker or Compose with a mounted config and cookie file.

## Tags

### Artificial Intelligence & ML

- [OpenAI-Compatible APIs](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/model-integration-serving/model-integration-interfaces/ai-integration-apis/openai-compatible-apis.md) — Exposes OpenAI-style chat, model-listing, tool-calling and Responses endpoints in front of a web chat service so existing clients work without code changes.
- [OpenAI-Compatible Model Servers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-serving-apis/openai-compatible-model-servers.md) — Exposes an OpenAI-compatible API for chat, model listing, tool calling, and Responses requests so existing clients work against Gemini unchanged.
- [Gemini Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/gemini-integrations.md) — Provides access to Google's Gemini models from scripts and applications through a signed-in browser session, with selectable model tier and reasoning depth.
- [OpenAI Chat Request Proxies](https://awesome-repositories.com/f/artificial-intelligence-ml/openai-chat-request-proxies.md) — Accepts OpenAI-style chat and model-listing requests and relays them to Gemini web requests so existing OpenAI clients work without code changes. ([source](https://github.com/sophomoresty/gemini-web2api#readme))
- [Streaming Chat Responses](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-chat-clients/streaming-chat-responses.md) — Streams generated replies incrementally over server-sent events so clients show text as the model writes it. ([source](https://github.com/sophomoresty/gemini-web2api#readme))
- [AI Coding Assistant Proxies](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-coding-assistant-proxies.md) — Serves a Responses-style endpoint and native model routes so command-line coding assistants can use the local proxy as their model backend.
- [Coding Agent CLI Bot Backends](https://awesome-repositories.com/f/artificial-intelligence-ml/coding-agent-cli-bot-backends.md) — Serves a Responses-style endpoint and native model endpoints so command-line coding assistants can use the local proxy as their backend. ([source](https://github.com/sophomoresty/gemini-web2api#readme))
- [Function Calling Interfaces](https://awesome-repositories.com/f/artificial-intelligence-ml/local-model-structured-outputs/function-calling-interfaces.md) — Converts OpenAI-style function definitions into the upstream prompt format and parses model output back into structured tool call objects.
- [Tool Calling](https://awesome-repositories.com/f/artificial-intelligence-ml/pure-function-model-execution/tool-calling.md) — Accepts function definitions in the chat-API format and returns structured tool calls parsed from model output so agents can trigger actions. ([source](https://github.com/sophomoresty/gemini-web2api#readme))
- [AI Gateways](https://awesome-repositories.com/f/artificial-intelligence-ml/self-hosted-ai-models/ai-gateways.md) — Runs as a private self-hosted gateway in Docker or Compose, with API key access control and optional upstream HTTP proxy routing.

### Security & Cryptography

- [Browser Session Authentication](https://awesome-repositories.com/f/security-cryptography/identity-access-management/authentication-strategies/session-and-credential-handling/session-credential-management/browser-session-authentication.md) — Authenticates upstream requests with cookies, account index, and page token taken from a signed-in browser session instead of an official API key.

### DevOps & Infrastructure

- [LLM API Servers](https://awesome-repositories.com/f/devops-infrastructure/self-hosted-api-deployments/llm-api-servers.md) — Runs as a locally hosted, Docker-deployable server that exposes a language model over a REST API with key-based access control and upstream proxy support.

### Networking & Communication

- [API Proxy Gateways](https://awesome-repositories.com/f/networking-communication/api-proxy-gateways.md) — Acts as a local intermediary that receives standard API calls and forwards them to the upstream Gemini web interface as web requests.
