gemini-web2api: Convert Google Gemini web into OpenAI-compatible API. Zero auth, cross-platform, single file.
本周 GitHub 最热门开源项目深度解析 项目地址: Sophomoresty/gemini-web2api 生成时间: 2026-05-31 12:08:09
项目概览
Sophomoresty/gemini-web2api 是本周 GitHub 上最受关注的开源项目之一,在短时间内积累了大量关注。
基本信息
| 指标 | 数据 |
|---|---|
| 作者 | @Sophomoresty |
| 编程语言 | Python |
| Star 数 | 577 ⭐ |
| Fork 数 | 191 |
| 创建时间 | 2026-05-28 |
| 最后更新 | 2026-05-31 |
项目简介
Convert Google Gemini web into OpenAI-compatible API. Zero auth, cross-platform, single file.
Python 是一门简洁优雅的编程语言,广泛应用于数据科学、人工智能、Web 开发等领域。
核心特性
根据项目 README 分析,gemini-web2api 的主要特点包括:
- 高关注度:577 个 Star,说明开发者社区对此项目高度认可
- 活跃开发:191 个 Fork,社区参与度高
- 快速成长:自 2026-05-28 创建以来持续获得关注
- 开源免费:完全开源,可自由使用和二次开发
技术架构
gemini-web2api 基于 Python 技术栈构建:
- 编程语言:Python
- 项目规模:577 个 Star,获得广泛认可
- 社区活跃度:191 个 Fork,开发者积极参与
README 原文摘要
# gemini-web2api
<p align="center">
<img src="logo.png" width="200" alt="gemini-web2api logo">
</p>
[中文文档](README_CN.md)
Convert Google Gemini's web interface into an OpenAI-compatible API. Zero authentication, zero cost, cross-platform.
## Features
- **Optional API Keys**: no auth when `api_keys` is empty, OpenAI-style Bearer auth when configured
- **OpenAI Compatible**: Drop-in replacement for `/v1/chat/completions` and `/v1/models`
- **Tool Calling**: Full function calling support (OpenAI format)
- **Multiple Models**: Flash, Flash Thinking (20k+ char output), Pro, Auto, Lite
- **Thinking Depth**: Adjustable via `@think=N` suffix (0=deepest, 4=shallowest)
- **Web Search**: Built-in internet access (Gemini's native search)
- **Cross-Platform**: Pure Python, no dependencies beyond stdlib
- **Streaming**: SSE streaming support
- **Codex CLI**: Responses API (`/v1/responses`) for OpenAI Codex integration
- **Gemini CLI**: Google native API (`/v1beta/models`) for Gemini CLI compatibility
## Quick Start
````bash
python gemini_web2api.py
Server starts at http://localhost:8081/v1.
Client Configuration
Cherry Studio / ChatBox / any OpenAI client
| Field | Value |
|---|---|
| Base URL | http://localhost:8081/v1 |
| API Key | any api_keys value from config.json; anything if not configured |
| Model | gemini-3.5-flash-thinking |
curl
| |
OpenAI Python SDK
| |
Gemini CLI
| |