WebAI-to-API is a browser-native API runtime that exposes browser-based AI services through OpenAI-compatible APIs.
The project is built around registered logical providers, provider-specific adapters, and shared browser runtime ownership boundaries.
Request execution is coordinated through BrowserRequestExecutor, which owns the shared browser-native request lifecycle while delegating provider-specific behavior to adapters and auth strategies.
Examples:
-
Gemini (logical provider)
- WebAPI backend
- Playwright backend
This separation allows multiple execution strategies to share common provider logic while maintaining a consistent API surface.
A provider represents an AI vendor or service.
Examples:
- Gemini
- Atlas
Providers are responsible for:
- Request transformation
- Response normalization
- Provider-specific functionality
- Conversation handling
Logical providers own model behavior, prompt transformation, and conversation semantics.
Auth policy and browser-native execution are delegated to provider auth strategies and adapters.
A backend adapter is the technical execution layer used by a provider.
For Gemini:
- WebAPI adapter
- Playwright adapter
Adapters are responsible for:
- Backend-specific execution behavior
- Backend-specific validation
- Backend-specific continuity behavior
Shared request execution flows through BrowserRequestExecutor.
Auth policy is owned by provider auth strategies.
Streaming ownership lives in shared runtime infrastructure.
Requests are routed through /v1/chat/completions.
Examples:
gemini-3-flash
playwright/gemini/gemini-3.1-pro
atlas/MiniMax-M2
The routing layer resolves the appropriate provider and execution backend before processing the request.
Browser-native providers generally use playwright/<provider>/<model>.
Legacy Gemini browser routing remains supported with playwright/<gemini-model>.
FastAPI endpoints expose the public API surface.
Responsibilities:
- Request validation
- Request routing
- Response serialization
Providers implement business logic and model-specific behavior.
Responsibilities:
- Prompt transformation
- Tool-call processing
- Response normalization
- Conversation management
The browser runtime manages browser-backed execution.
Responsibilities:
BrowserEngine: browser process lifecycle, generation invalidation, terminal shutdownProviderSession: browser context lifecycle, keepalive page ownership, provider-scoped recoveryBrowserRequestExecutor: request-scoped execution, bridge lifecycle, streaming integration, cleanupAuthManager: status caching and orchestration
src/
└── app/
├── endpoints/
├── services/
│ ├── providers/
│ └── browser/
├── utils/
└── main.py
Public API routers.
Examples:
- chat
- auth
- models
- system
Provider implementations.
Examples:
- Gemini
- Atlas
Browser runtime infrastructure.
Examples:
- Browser engine
- Sessions
- Tabs
- Authentication
- Recovery
Shared utility functions and helpers.
Conversation continuity depends on the selected provider and backend.
Examples:
- Gemini WebAPI uses snapshot-backed continuity from local conversation persistence.
- Browser-native providers use URL-backed continuity and may reuse existing browser-native conversation state when available.
- Stateless providers do not persist
conversation_idstate locally.
Authentication is separated into distinct responsibilities:
AuthLoader- Provider auth strategies
AuthManager
AuthLoader discovers available auth material.
Provider auth strategies own selection and fallback policy.
AuthManager owns cached status and login/recovery orchestration.
Detailed runtime guarantees are documented separately:
- Runtime Architecture Overview
- Provider Contract
- Concurrency Model
- Streaming Pipeline
- Lifecycle and Recovery
- Error Policy
- API Contract
- Docker Deployment Model
These documents are authoritative for runtime behavior and implementation invariants.