Status: [UNTESTED]
Endpoints found:
http://localhost:8081/v1/chat/completions
http://127.0.0.1:8081/v1/chat/completions
Source: https://github.com/Moonzayn/geminiwebapi
# gemini-web2api
[中文文档](README_CN.md)
Convert Google Gemini's web interface into an OpenAI-compatible API. Zero cost, cross-platform, single file.
## 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 (3.6), Extended 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, single optional dependency (`httpx` for streaming)
- **Streaming**: SSE streaming support via `httpx`
- **Multi-Account**: Round-robin rotation across multiple Google accounts (backup / quota sharing), with hot reload
- **gemini-manager CLI**: One command to add/remove accounts and manage the service
- **Codex CLI**: Responses API (`/v1/responses`) for OpenAI Codex integration
- **Gemini CLI**: Google native API (`/v1beta/models`) for Gemini CLI compatibility
## Quick Start
```bash
pip install httpx
python gemini_web2api.py
```
Server starts at `http://localhost:8081/v1`.
## One-Command Setup (install.sh)
On a fresh machine, clone the repo and run the installer. It sets up the
virtualenv, installs dependencies, creates `config.json`, and installs the
global `gemini-manager` CLI:
```bash
git clone https://github.com/Sophomoresty/gemini-web2api.git
cd gemini-web2api
./install.sh
```
Next, export cookies on *this* machine (cookies are device-bound), add your
accounts, and start:
```bash
gemini-manager add-account akun-1 --cookie-file cookie.txt
gemini-manager add-account akun-2 --cookie-file cookie2.txt
gemini-manager start
gemini-manager test --count 4
```
## Client Configuration
### Che