The Gemini subscription you already have, as an API on your own machine.
Sync your signed-in Gemini session from Chrome to a local OpenAI-compatible proxy. Then point any script, agent, chat app or Claude (via MCP) at localhost.
See it in 20 seconds
Setup, connecting the side panel, calling it from Python, and the speed fix.
How it works
Gemini's web app sends a cookie, a session id and a rotating security token with every request. The proxy replays that handshake, so Google sees your own login.
Normal login at gemini.google.com in Chrome.
Reads cookies and tokens from the live tab.
Local helper writes them into the proxy config.
Turns OpenAI JSON into Gemini's web format on :8081.
Call /v1/chat/completions with your API key.
Everything runs on your machine. The only outside traffic is the proxy talking to gemini.google.com as you.
What's in the box
Built on gemini-web2api, with a friendlier front end and fixes.
Side-panel control centre
Inspect and sync your session, chat, run a health check, benchmark models, copy settings for other tools.
Knows if you're new
Tells a fresh computer from a fresh browser, spots rejected keys and a stopped proxy, and says exactly what to do next.
Your own API key
Random key made locally. Add one per browser or replace them all in one click.
Works in Claude
gemini_chat, gemini_models, gemini_health tools for Claude Code and other MCP clients.
~10× faster replies
Non-streaming calls switched to a pooled HTTP client, plus sane timeouts, retries and build-id refresh.
Safe to hand on
pack.py builds a zip from an allowlist and refuses if it finds a key or cookie.
Quick start
Needs Python 3.10+, Node 20+, git, Chrome, and your own Gemini account.
git clone https://github.com/arpanguria68-ui/gemini-web-connector cd gemini-web-connector python setup.py
setup.py downloads the proxy at a pinned version, applies the fixes, installs dependencies, creates your own config and random API key, and prints the key.
- Start the proxy:
cd ../gemini-web2api && python gemini_web2api.py - Start the helper:
npm run uiin the repo folder. - Load the extension:
chrome://extensions→ Developer mode → Load unpacked → the repo'sextension/folder. - Connect: open the side panel → Session → paste your key → sign in at gemini.google.com → Inspect → Sync to proxy.
- Verify: restart the proxy → Settings → Run health check.
Use it anywhere
If a tool has a "custom OpenAI endpoint" field, it works: LangChain, aider-style CLIs, Cherry Studio, ChatBox, LibreChat, Obsidian plugins, bots, cron jobs.
| Field | Value |
|---|---|
| Base URL | http://127.0.0.1:8081/v1 |
| API key | your key from setup.py |
| Model | gemini-3.6-flash, gemini-3.1-pro, … |
| Thinking | model@think=N, N = 0 (deepest) to 4 |
from openai import OpenAI
c = OpenAI(base_url="http://127.0.0.1:8081/v1",
api_key="sk-...", timeout=120)
r = c.chat.completions.create(model="gemini-3.6-flash",
messages=[{"role": "user", "content": "hi"}])
print(r.choices[0].message.content)
claude mcp add gemini-web2api -e GEMINI_API_KEY=sk-... \ -- node "<path-to>/gemini-web-connector/server.mjs"
API keys, explained
The key is a password for your local proxy. Google never sees it.
| Made by | setup.py on your computer (16 random bytes), or later in Settings → API key. |
| Stored in | The proxy's config.json → api_keys (a list). Each browser keeps its own copy. |
| Your browsers | Same key everywhere on your computer: paste once per browser, or add one per browser. |
| Other people | Their own setup, their own key, their own Google account. Never share yours. |
| Leaked? | Replace all keys, restart the proxy, paste the new key where needed. |
Known issues
The honest risks
gemini-auth.json and the proxy's config.json must never be shared, committed or pasted anywhere.| Fine for | Never for |
|---|---|
| Your own agents, scripts, prototypes | Products other people sign up for |
| A personal bot or private chat client | Anything monetized or sold as reliable |
| Testing an idea before paying for an API | Traffic you don't personally control |
| One person, one account, one proxy | Several people on one account |