RepositoryPythonGBUnited Kingdom
Amm1rr

Amm1rr/WebAI-to-API

Webchat to API

1.4kstars
233forks
18issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: google-bard-api

#1 Repository of the week

1
TINIX TRENDING·Topic: webservice

#1 Repository of the week

2
TINIX TRENDING·Topic: bard

#2 Repository of the week

WebAI-to-API

WebAI-to-API Server Dashboard Atlas Cloud

WebAI-to-API is a browser-native AI runtime that exposes browser-based AI services through OpenAI-compatible APIs.

WebAI-to-API combines browser-native automation with WebAPI-based provider integrations to expose AI services through a flexible OpenAI-compatible API layer.


Features

  • OpenAI-compatible /v1/chat/completions API
  • Provider-based architecture with unified routing
  • Streaming response support (SSE)
  • Conversation continuation support
  • Health, readiness, and runtime diagnostics endpoints
  • Docker deployment support
  • Authentication management and browser login workflows

Available Providers

Gemini

Provides access to Google Gemini models through either the WebAPI backend or a browser-native Playwright runtime.

Atlas Cloud

Provides access to cloud-hosted AI models through a native API integration powered by Atlas Cloud.


Quick Start

1. Install Dependencies

poetry install
poetry run playwright install chromium

2. Configuration

cp config.conf.example config.conf

For detailed settings (including logging verbosity and access log configurations), see Configuration Guide.

3. Authenticate

python verify_login.py

4. Start the Server

poetry run python src/run.py

[!TIP] New users can run make setup and make doctor for automated setup and diagnostics. See Convenience Shortcuts below.


Optional: Convenience Shortcuts

WebAI-to-API includes a bootstrap utility and a Makefile for common setup tasks.

CommandDescription
make setupOne-step install, directory creation, and config setup.
make doctorRun environment and dependency diagnostics.

Alternative (no Make): python scripts/bootstrap.py and python scripts/doctor.py


Authentication

Gemini requires an authenticated Google session.

MethodRecommended For
Browser Login (verify_login.py)Recommended. Playwright backend, Docker, and long-term usage.
Manual CookiesQuick testing and WebAPI-only usage.
  1. Run the interactive login helper:
    python verify_login.py
    
  2. Complete the sign-in process in the browser window.
  3. This creates runtime/auth/gemini.json, used by both backends.

2. Manual Cookies

  1. Sign in to Gemini.
  2. Copy __Secure-1PSID and __Secure-1PSIDTS from your browser cookies.
  3. Paste them into the [Gemini] section of config.conf.

Send Your First Request

curl -X POST http://localhost:6969/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3-flash",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'

Dashboard

Open the dashboard at http://localhost:6969/ui.

The dashboard provides a visual interface for runtime status, authentication management, API discovery, and interactive testing.

Available Endpoints

EndpointPurpose
/v1/chat/completionsOpenAI-compatible chat completions
/v1/temporary/chat/completionsGemini WebAPI temporary chat
/v1/modelsList supported models
/v1/auth/statusCheck authentication status
/v1/auth/loginStart authentication flow
/v1/conversationsManage Gemini WebAPI conversation snapshots
/translateLegacy translation compatibility
/ui/*Dashboard and playground

Temporary Gemini Chat

/v1/temporary/chat/completions is Gemini WebAPI-only and uses Gemini temporary requests (temporary=True). Requests are not stored in Gemini history and do not create SQLite conversation snapshots. It supports streaming, non-streaming, multimodal file inputs, and artifact outputs. See docs/api.md for details.

Legacy Translate Endpoint

The /translate endpoint is maintained for compatibility with the Translate It! browser extension.

It uses Gemini temporary requests and a shared in-memory session. See docs/api.md for additional details.

File Support

File input is supported through OpenAI-style content parts on /v1/chat/completions when routed to the Gemini WebAPI backend. The currently verified file formats are documented in docs/api.md.

[!NOTE] File parts are supported only by the Gemini WebAPI backend in the MVP. Gemini Playwright and Atlas reject file parts with a clear capability error. For Gemini WebAPI, text content parts are concatenated into one prompt and file parts are passed as attachments. Exact text/file interleaving order is not preserved. The built-in /ui/playground page uses the same contract for file attachments.


Supported Models

Available models may vary depending on the configured provider and backend.

Use the /v1/models endpoint to retrieve the current list of supported models.


Model Routing

WebAI-to-API uses model prefixes to route requests to specific backends.

ModelBackend
gemini-3-flashGemini (default configured backend)
playwright/gemini-3-flashGemini Playwright
atlas/<model-id>Atlas Cloud via OpenAI-compatible API, with 50 validated chat models exposed in /v1/models

[!TIP] Model prefixes force backend selection and override the default Gemini backend configured in config.conf. Use playwright/... model prefixes to force the Playwright backend explicitly.


Documentation

Interactive API documentation is available through Swagger UI when the server is running.


Star History

Star History Chart


License

WebAI-to-API is licensed under the Apache License 2.0. See LICENSE for the full text.


Similar Projects

Discover other similar projects and AI models.

RepositoryPython
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

188.2k
Nov 29, 2026
RepositoryPython
langgenius/dify

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

162.3k
Dec 2, 2026
RepositoryPython
langchain-ai/langchain

The agent engineering platform.

150.1k
Nov 29, 2026
RepositoryPython
Comfy-Org/ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

149.6k
Dec 2, 2026
RepositoryPython
fastapi/fastapi

FastAPI framework, high performance, easy to learn, fast to code, ready for production

105.1k
Nov 24, 2026
RepositoryPython
public-apis/public-apis

A collective list of free APIs

502.6k
Nov 30, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryTypeScript
openclaw/openclaw

The AI that really does things. Any OS. Any Platform. The lobster way. 🦞

395.6k
Dec 2, 2026
RepositoryShell
obra/superpowers

An agentic skills framework & software development methodology that works.

331.2k
Nov 28, 2026