selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
gemini-web2api-go logo

Self-host gemini-web2api-go

v4.26.0

OpenAI-compatible API proxy for Google Gemini web

ReleaseOpen SourceMIT
Updated11 hours ago
LanguageGo
Setup difficultyModerate
Stars
722
Port
8083 (HTTP API and admin dashboard)
Docker
ghcr.io/zexadev/gemini-web2api-go
Install with Docker

What is gemini-web2api-go?

Should you self-host gemini-web2api-go?

gemini-web2api-go scores 56/100 on selfhost.directory (how scoring works) and ranks #14 of 39 in API Gateway. It has 722 GitHub stars.

It shipped 10 stable releases in the past year. The latest, v4.26.0, came out on 26 October 2026. New versions land roughly every 4 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is Kong Gateway (82/100, 44 314 stars). It scores higher overall, so compare the two before you pick. See gemini-web2api-go vs Kong Gateway side by side.

Features

  • Admin Dashboard
  • Canvas generation
  • Chrome TLS fingerprintingProxy connections use Go stdlib TLS fingerprint
  • Cookie pool with auto-renewalFirefox-exported cookies recommended for long-term renewal
  • Function calling (prompt-level)Model may not always return formatted tool calls; reliable for private data queries
  • Image GenerationResolution locked to ~1MP by upstream
  • MCP web_search tool
  • Multiple Database BackendsAuto-migration, shared schema
  • Multi-turn conversation supportDoes not expand model context window
  • Music Generation
  • OpenAI Compatible API
  • Proxy pool with per-IP rate limiting
  • Reasoning contentreasoning_tokens counted separately from completion_tokens
  • Streaming ResponsesTools requests and /v1/responses are buffered
  • Video GenerationFree accounts rejected by upstream content policy

gemini-web2api-go README

How to install gemini-web2api-go

Install gemini-web2api-go with Docker

Docker Engine
Environment variables
ADMIN_TOKEN, API_KEY, TZ, SQL_DSN

docker run -d --name gemini-web2api -p 127.0.0.1:8083:8083 -v "$PWD/data:/data" -e ADMIN_TOKEN=your-admin-token ghcr.io/zexadev/gemini-web2api-go:latest

Uses distroless image, runs as nonroot (uid 65532)

How to configure gemini-web2api-go

  • admin_enabledtrueEnable admin dashboard

    Enable admin dashboard

  • admin_tokenAdmin dashboard login token

    Admin dashboard login token

  • ADMIN_TOKENchange-me-in-productionAdmin dashboard login token (env var)

    Admin dashboard login token (env var)

  • API_KEYLock API key (env var, prevents panel changes)

    Lock API key (env var, prevents panel changes)

  • cookie_fileCookie file to import at startup

    Cookie file to import at startup

  • db_path./data/gemini.dbSQLite database path

    SQLite database path

  • default_modelgemini-3.6-flashDefault model when client doesn't specify

    Default model when client doesn't specify

  • gemini_blboq_gemini-web-uiserver_20261007.01_p0Gemini frontend version (bl)

    Gemini frontend version (bl)

  • host0.0.0.0Bind address

    Bind address

  • impersonatechrome_146TLS fingerprint profile

    TLS fingerprint profile

    values: chrome_146, chrome_144, chrome_133, firefox_147, safari_16_0, safari_ios_17_0

  • log_requeststrueEnable request logging

    Enable request logging

  • per_ip_concurrent5Per-IP concurrent request limit

    Per-IP concurrent request limit

  • per_ip_rph80Per-IP requests per hour limit

    Per-IP requests per hour limit

  • per_ip_rpm30Per-IP requests per minute limit

    Per-IP requests per minute limit

  • port8083Listening port

    Listening port

  • proxyProxy URL to import at startup

    Proxy URL to import at startup

  • request_timeout_sec180Upstream request timeout in seconds

    Upstream request timeout in seconds

    values: 5-600

  • retention_days30Request detail retention days

    Request detail retention days

  • retry_attempts3Number of retry attempts

    Number of retry attempts

    values: 1-10

  • retry_delay_sec2Delay between retries in seconds

    Delay between retries in seconds

  • SQL_DSNDatabase connection string for MySQL/PostgreSQL

    Database connection string for MySQL/PostgreSQL

    values: mysql://..., postgres://...

  • TZUTCTimezone

    Timezone

gemini-web2api-go releases & version history

FAQ

Releases 里挑对应平台的下载,不用 Go、不用 Docker,单个文件就是全部

Pre-built binaries for 6 platforms available on GitHub Releases. No Go or Docker needed — single file is everything.

支持 MySQL / PostgreSQL 吗?

Yes. Set SQL_DSN env var (mysql://... or postgres://...). Defaults to SQLite. Auto-migration, shared schema across all three.

为什么在 Dify / 反向代理后面流式变成了一次性输出?

Regular chat is true streaming. Tools requests and /v1/responses are buffered. Response includes X-Accel-Buffering: no; check your reverse proxy's buffering settings.

生图用的是哪个模型?能出 2K 吗?

Uses whatever image backend the web UI currently uses (e.g., Nano Banana 2). Resolution locked to ~1 megapixel, no 2K output.

能用 Gemini 4 Argon 吗?怎么用?

Yes, model name gemini-4-argon (and -thinking, -thinking-medium). Requires a cookie from an account that has 4 Argon visible in gemini.google.com model selector (Google AI Pro/Ultra).

有 gemini-3.8-flash 吗?

Yes (gemini-3.8-flash and gemini-3.8-flash-thinking), requires paid Gemini account. Free accounts get downgraded to 3.5 Flash-Lite. gemini-3.7-flash kept as alias.

能当 Cursor / Dify / WorkBuddy 这类 agent 工具的后端吗?

Yes, OpenAI-compatible. Works for chat and coding. But context limit is ~130KB (160KB with cookie), so large agent prompts may hit limits. Function calling is prompt-level, not protocol-level.

为什么每发一条消息,gemini.google.com 里就多出一个会话?

Each request is an independent session by default. Enable 'multi_turn' in settings to reuse a conversation_id. Or enable 'temporary_chat' (recommended) to keep sessions out of the web UI entirely.

免费账号和 Pro / 付费账号差在哪?

Anonymous: gemini-3.6-flash, gemini-3.5-flash-lite with web search. Free account cookie adds: gemini-3.1-pro, thinking variants, vision, image/music/canvas. Paid adds: gemini-3.8-flash, gemini-4-argon, video generation.

会被封号吗?封禁是按账号还是按 IP?

Bans are by exit IP + TLS fingerprint, not by account. Burst requests (80-180) trigger blocks; slow pacing (10/min) can run 800+ requests unblocked. Paid accounts don't raise limits.

和 Sophomoresty/gemini-web2api(Python)、其它叫 gemini-web2api 的 Go 项目是什么关系?

Independent Go implementation. Early protocol research referenced the Python version's approach, but it's not a port. Other same-named Go projects are unrelated.

这和 Google 官方 Gemini API 有什么区别?需要 API Key 吗?

No API key needed. This project reverse-proxies the gemini.google.com web interface directly, not the official generativelanguage.googleapis.com API. So there's no API key or paid quota.

More in API Gateway

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…