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.
解决的问题
该项目提供了一种无需官方 API 密钥即可通过标准化 REST API 访问 Google Gemini 最新模型的方法。它通过使用浏览器 Cookie 来认证对 Gemini 网页界面的请求,绕过了官方 API,使用户能够将其集成到自己的应用程序中或在本地进行测试。
工作原理
该工具是一个使用 Go 和 Fiber 构建的本地代理服务器。它接收来自用户的请求(通过 OpenAI、Claude 或 Gemini 兼容端点),并将这些请求转换为 Gemini 网页界面能够理解的格式。它使用用户提供的浏览器 Cookie 和账户槽来维持会话,并自动轮换 Cookie 以保持会话活跃。
适用人群
- 希望在无需 API 密钥的情况下使用 Gemini 模型的开发者。
- 希望在本地测试 Gemini 集成的用户。
- 希望通过基于 Cookie 的认证方式利用最新 Gemini 模型构建应用程序的开发者。
主要亮点
- 多协议支持:提供与 OpenAI、Claude 和 Gemini SDK 兼容的端点。
- 自动会话管理:自动轮换 Cookie 以防止会话过期。
- 动态模型发现:自动从用户账户注册表中检测可用模型。
- 多模态功能:支持聊天请求中的图像生成(文本转图像)和图像输入(URL 或 base64)。
- 生产就绪:包含 Docker 和 Docker Compose 支持、速率限制,以及通过 Scalar UI 提供的交互式 API 文档。
相关
- 项目
- 项目
zexadev/gemini-web2api-goA Go server that reverse‑proxies Google Gemini’s web UI protocol and exposes it as an OpenAI‑compatible API (chat, models, streaming, video, image, music, web‑search). Works anonymously or with Google cookies, includes rate‑limiting, proxy & cookie pools, SQLite/MySQL persistence, and a lightweight admin UI.
- 项目
zhiyu1998/Gemi2Api-ServerGemi2Api‑Server is a FastAPI‑based bridge that lets you call Google Gemini via an OpenAI‑compatible REST API. It authenticates with Gemini using your browser cookies, forwards chat‑completion requests, optionally proxies generated images, and provides a simple admin UI. Deployable locally, via Docker, or on Render/HuggingFace, it’s useful for developers who want Gemini access without a formal public API.
- 项目
Amm1rr/WebAI-to-APIWebAI‑to‑API 是一个自托管网桥,通过 Web API 或 Playwright 驱动的浏览器运行 Google Gemini,并通过 OpenAI 兼容端点暴露,支持本地仪表板和 Docker。
- 项目
Sophomoresty/gemini-web2apigemini‑web2api 是一个 Python 服务器,代理 Google Gemini 的私有网页 API,并将其呈现为 OpenAI 兼容端点(`/v1/chat/completions`、`/v1/models` 等)。它支持可选 API 密钥认证、流式传输、函数调用、图像输入、多个 Gemini 模型别名、可调推理深度,并可直接运行或在 Docker 内运行。