← all repositories
Amm1rr/WebAI-to-API

Your browser's AI, now pretending to be an API

Wraps browser-based LLMs in an OpenAI-compatible server so your existing tools can talk to Gemini without knowing it's really just scraping the web UI.

WebAI-to-API
Not currently ranked — collecting fresh signals.
star history

What it does

WebAI-to-API is a FastAPI server that sits between your code and browser-native AI services, primarily Google Gemini. It exposes an OpenAI-compatible /v1/chat/completions endpoint, plus a few native ones like /gemini-chat for persistent sessions. The project also bundles a secondary gpt4free-powered server as fallback, and offers a direct Atlas Cloud integration for when you want actual API reliability instead of browser puppetry.

The interesting bit

The architecture is deliberately thin: a single chat.py orchestrator delegates to provider-specific modules that each handle their own “transformation and streaming quirks.” For Gemini specifically, it can operate in two modes — a lightweight WebAPI backend using your browser cookies, or a full Playwright browser automation runtime. The cookie-based path is the clever hack: it piggybacks on your existing browser session to avoid API keys entirely, with automatic cookie retrieval via browser_cookies3 if you leave the config blank.

Key highlights

  • OpenAI-compatible streaming and chat completions, including system prompts and conversation history
  • Three operational modes: cookie-based Gemini WebAPI, Playwright browser runtime, Atlas Cloud direct API, plus gpt4free fallback
  • Atomic, non-blocking config persistence for rotated cookies and runtime state changes
  • SQLite-backed conversation snapshots for the WebAPI backend, with list/delete endpoints
  • Dual licensing: AGPLv3 from v0.5.0 onward, MIT for earlier versions, with commercial licensing available

Caveats

  • The README’s “research and educational purposes only” disclaimer and anti-commercial warning sits awkwardly next to the project’s own commercial licensing offer and Atlas Cloud sponsorship
  • Conversation management endpoints (list, delete) only work for Gemini WebAPI SQLite snapshots; Playwright and Atlas conversations are explicitly unsupported
  • Token counts in responses are hardcoded to zero, so any usage tracking or billing logic you layer on top will need its own accounting

Verdict

Worth a look if you need a quick, keyless way to pipe Gemini into OpenAI-shaped tools for personal prototyping. Skip it if you need production reliability, actual usage metrics, or a licensing story that doesn’t require reading two contradictory paragraphs.

Frequently asked

What is Amm1rr/WebAI-to-API?
Wraps browser-based LLMs in an OpenAI-compatible server so your existing tools can talk to Gemini without knowing it's really just scraping the web UI.
Is WebAI-to-API open source?
Yes — Amm1rr/WebAI-to-API is open source, released under the Apache-2.0 license.
What language is WebAI-to-API written in?
Amm1rr/WebAI-to-API is primarily written in Python.
How popular is WebAI-to-API?
Amm1rr/WebAI-to-API has 1.3k stars on GitHub.
Where can I find WebAI-to-API?
Amm1rr/WebAI-to-API is on GitHub at https://github.com/Amm1rr/WebAI-to-API.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.