Gemini Web Connector
Chrome extension · MCP server · one-command setup

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.

Unofficial, personal use only. This automates your browser login, not a Google API. Your account can be flagged, it can break without notice, and there's no support. Building something for other people? Use the official Gemini API.
1command to set up
$0extra per month
~4–15stypical short reply (was ~110s)
127.0.0.1never exposed by default

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.

Sign in

Normal login at gemini.google.com in Chrome.

Extension

Reads cookies and tokens from the live tab.

Sync

Local helper writes them into the proxy config.

Proxy

Turns OpenAI JSON into Gemini's web format on :8081.

Your tools

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.

Extension

Side-panel control centre

Inspect and sync your session, chat, run a health check, benchmark models, copy settings for other tools.

Onboarding

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.

Keys

Your own API key

Random key made locally. Add one per browser or replace them all in one click.

MCP

Works in Claude

gemini_chat, gemini_models, gemini_health tools for Claude Code and other MCP clients.

Proxy patch

~10× faster replies

Non-streaming calls switched to a pooled HTTP client, plus sane timeouts, retries and build-id refresh.

Sharing

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.

  1. Start the proxy: cd ../gemini-web2api && python gemini_web2api.py
  2. Start the helper: npm run ui in the repo folder.
  3. Load the extension: chrome://extensions → Developer mode → Load unpacked → the repo's extension/ folder.
  4. Connect: open the side panel → Session → paste your key → sign in at gemini.google.com → Inspect → Sync to proxy.
  5. 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.

FieldValue
Base URLhttp://127.0.0.1:8081/v1
API keyyour key from setup.py
Modelgemini-3.6-flash, gemini-3.1-pro, …
Thinkingmodel@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 bysetup.py on your computer (16 random bytes), or later in Settings → API key.
Stored inThe proxy's config.json → api_keys (a list). Each browser keeps its own copy.
Your browsersSame key everywhere on your computer: paste once per browser, or add one per browser.
Other peopleTheir 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

open
"Pro" may actually be Flash. Google now ignores the model number unless a model header is sent; see upstream #82. The proxy repeats the requested name, so the label can't prove routing. Fix in progress.
open
Chats don't appear in your Gemini history.
expected
Sessions expire. HTTP 400 / xsrf errors or empty replies mean: refresh the Gemini tab → Sync → restart the proxy.
expected
Speed varies from a few seconds to ~20s for short prompts. Use the benchmark in the extension.

The honest risks

Your account can be flagged.Google's abuse detection expects one person at a human pace. Scripted or shared traffic raises the odds, and this may conflict with Google's terms.
It can break without warning.The proxy chases Google's web app. One change on their side and it stops.
No SLA, no support.If it goes down, the fix is you re-syncing.
Your session file is a live login.gemini-auth.json and the proxy's config.json must never be shared, committed or pasted anywhere.
Fine forNever for
Your own agents, scripts, prototypesProducts other people sign up for
A personal bot or private chat clientAnything monetized or sold as reliable
Testing an idea before paying for an APITraffic you don't personally control
One person, one account, one proxySeveral people on one account