[UNTESTED] [cheymin/gemini2api] 2 endpoint(s)
ChatGPT
API Proxy/ChatGPT
2,169 characters
Status: [UNTESTED]
Endpoints found:
http://localhost:8081/v1/chat/completions
http://127.0.0.1:8081/v1/chat/completions
Source: https://github.com/cheymin/gemini2api
# 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 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`
- **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`.
## 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
#### bash / macOS / Linux
```bash
curl http://localhost:8081/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-key" \
-d '{"model":"gemini-3.5-flash","messages":[{"role":"user","content":"Hello!"}]}'
```
#### PowerShell (Windows)
```powershell
curl.exe --% http://127.0.0.1:8081/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-your-key" -d "{\"model\":\"gemini-3.5-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello!\"}]}"
```
> Note: On Windows