# exelite-dev/free-gemini-pro-api architecture

> Architecture diagram of the GitHub repository exelite-dev/free-gemini-pro-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/exelite-dev/free-gemini-pro-api
- Repository: https://github.com/exelite-dev/free-gemini-pro-api

## Overview

OmniBridge is a self-hosted proxy that accepts OpenAI- or Anthropic-shaped requests, authenticates API keys, selects a configured model/provider, and streams or returns translated responses. Its core workflow runs through the compatibility route, provider account pool, and provider engine; the admin interface manages accounts, keys, and monitoring. The README documents Gemini, DeepSeek, ChatGPT, streaming, vision, and dashboard capabilities. Some subsystem links are documented by the README or source index; unsampled route behavior is not inferred.

Main entry points: [`app/database.py`](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/database.py) (SQLite state), [`app/routes/openai.py`](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/openai.py) (OpenAI routes), [`app/routes/anthropic.py`](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/anthropic.py) (Anthropic routes), [`app/providers/registry.py`](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/registry.py) (Provider registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and administration"]
  node_openai["OpenAI routes<br/>[openai.py]"]
  node_anthropic["Anthropic routes<br/>[anthropic.py]"]
  node_googleproxy["Google proxy route<br/>[google_proxy.py]"]
  node_admin["Admin dashboard<br/>[admin.py]"]
  node_adminui["Dashboard template<br/>[admin.html]"]
end

subgraph group_core["Shared runtime"]
  node_auth["API key auth<br/>[auth.py]"]
  node_models["Request schemas<br/>[models.py]"]
  node_registry["Provider registry<br/>[registry.py]"]
  node_pool["Account pool<br/>[pool.py]"]
  node_base["Provider interface<br/>[base.py]"]
end

subgraph group_providers["Provider engines"]
  node_gemini["Gemini engine<br/>[engine.py]"]
  node_cookie["Cookie refresh<br/>[cookie_refresh.py]"]
  node_deepseek["DeepSeek engine<br/>[engine.py]"]
  node_pow["PoW solver<br/>[pow_solver.py]"]
  node_chatgpt["ChatGPT engine<br/>[engine.py]"]
end

subgraph group_state["Configuration and state"]
  node_database[("SQLite state<br/>[database.py]")]
  node_config["Runtime config<br/>[config.py]"]
end

node_client(("API client"))
node_provider_services(("AI provider services"))

node_client -->|"submits requests"| node_openai
node_client -->|"submits messages"| node_anthropic
node_openai -->|"authenticates with"| node_auth
node_anthropic -->|"authenticates with"| node_auth
node_auth -->|"validates keys"| node_database
node_openai -->|"converts requests"| node_models
node_anthropic -->|"converts requests"| node_models
node_openai -->|"gets provider pool"| node_registry
node_anthropic -->|"gets provider pool"| node_registry
node_registry -->|"creates pools"| node_pool
node_pool -->|"loads accounts"| node_database
node_pool -->|"dispatches chat"| node_base
node_gemini -->|"implements interface"| node_base
node_deepseek -->|"implements interface"| node_base
node_chatgpt -->|"implements interface"| node_base
node_deepseek -->|"solves challenges"| node_pow
node_provider_services -->|"serves requests"| node_gemini
node_provider_services -->|"serves requests"| node_deepseek
node_provider_services -->|"serves requests"| node_chatgpt
node_admin -->|"manages state"| node_database
node_admin -->|"checks providers"| node_registry
node_adminui -.->|"renders dashboard"| node_admin
node_cookie -->|"updates credentials"| node_database
node_cookie -->|"validates cookies"| node_gemini
node_config -->|"configures storage"| node_database
node_googleproxy -.->|"proxies requests"| node_provider_services

click node_openai "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/openai.py"
click node_anthropic "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/anthropic.py"
click node_googleproxy "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/google_proxy.py"
click node_admin "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/admin.py"
click node_adminui "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/admin/templates/admin.html"
click node_auth "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/auth.py"
click node_models "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/models.py"
click node_registry "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/registry.py"
click node_pool "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/pool.py"
click node_base "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/base.py"
click node_database "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/database.py"
click node_config "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/config.py"
click node_gemini "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/gemini/engine.py"
click node_cookie "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/gemini/cookie_refresh.py"
click node_deepseek "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/deepseek/engine.py"
click node_pow "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/deepseek/pow_solver.py"
click node_chatgpt "https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/chatgpt/engine.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_openai,node_anthropic,node_googleproxy,node_admin,node_adminui,node_client toneBlue
class node_auth,node_models,node_registry,node_pool,node_base toneAmber
class node_gemini,node_cookie,node_deepseek,node_pow,node_chatgpt toneMint
class node_database,node_config toneRose
class node_provider_services toneIndigo
```

## Components

### API and administration

- [OpenAI routes](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/openai.py): `app/routes/openai.py`
- [Anthropic routes](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/anthropic.py): `app/routes/anthropic.py`
- [Google proxy route](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/google_proxy.py): `app/routes/google_proxy.py`
- [Admin dashboard](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/routes/admin.py): `app/routes/admin.py`
- [Dashboard template](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/admin/templates/admin.html): `app/admin/templates/admin.html`

### Shared runtime

- [API key auth](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/auth.py): `app/auth.py`
- [Request schemas](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/models.py): `app/models.py`
- [Provider registry](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/registry.py): `app/providers/registry.py`
- [Account pool](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/pool.py): `app/providers/pool.py`
- [Provider interface](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/base.py): `app/providers/base.py`

### Provider engines

- [Gemini engine](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/gemini/engine.py): `app/providers/gemini/engine.py`
- [Cookie refresh](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/gemini/cookie_refresh.py): `app/providers/gemini/cookie_refresh.py`
- [DeepSeek engine](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/deepseek/engine.py): `app/providers/deepseek/engine.py`
- [PoW solver](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/deepseek/pow_solver.py): `app/providers/deepseek/pow_solver.py`
- [ChatGPT engine](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/providers/chatgpt/engine.py): `app/providers/chatgpt/engine.py`

### Configuration and state

- [SQLite state](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/database.py): `app/database.py`
- [Runtime config](https://github.com/exelite-dev/free-gemini-pro-api/blob/main/app/config.py): `app/config.py`

### Other components

- **API client**
- **AI provider services**

## Connections

- API client → OpenAI routes: submits requests (evidence: `README.md`)
- API client → Anthropic routes: submits messages (evidence: `README.md`)
- OpenAI routes → API key auth: authenticates with (evidence: `app/routes/openai.py`)
- Anthropic routes → API key auth: authenticates with (evidence: `app/routes/anthropic.py`)
- API key auth → SQLite state: validates keys (evidence: `app/auth.py`)
- OpenAI routes → Request schemas: converts requests (evidence: `app/routes/openai.py`)
- Anthropic routes → Request schemas: converts requests (evidence: `app/routes/anthropic.py`)
- OpenAI routes → Provider registry: gets provider pool (evidence: `app/routes/openai.py`)
- Anthropic routes → Provider registry: gets provider pool (evidence: `app/routes/anthropic.py`)
- Provider registry → Account pool: creates pools (evidence: `app/providers/registry.py`)
- Account pool → SQLite state: loads accounts (evidence: `app/providers/pool.py`)
- Account pool → Provider interface: dispatches chat (evidence: `app/providers/pool.py`)
- Gemini engine → Provider interface: implements interface (evidence: `app/providers/gemini/engine.py`)
- DeepSeek engine → Provider interface: implements interface (evidence: `app/providers/deepseek/engine.py`)
- ChatGPT engine → Provider interface: implements interface (evidence: `app/providers/chatgpt/engine.py`)
- DeepSeek engine → PoW solver: solves challenges (evidence: `app/providers/deepseek/engine.py`)
- AI provider services → Gemini engine: serves requests (evidence: `README.md`)
- AI provider services → DeepSeek engine: serves requests (evidence: `README.md`)
- AI provider services → ChatGPT engine: serves requests (evidence: `README.md`)
- Admin dashboard → SQLite state: manages state (evidence: `app/routes/admin.py`)
- Admin dashboard → Provider registry: checks providers (evidence: `app/routes/admin.py`)
- Dashboard template → Admin dashboard: renders dashboard
- Cookie refresh → SQLite state: updates credentials (evidence: `app/providers/gemini/cookie_refresh.py`)
- Cookie refresh → Gemini engine: validates cookies (evidence: `app/providers/gemini/cookie_refresh.py`)
- Runtime config → SQLite state: configures storage (evidence: `app/database.py`)
- Google proxy route → AI provider services: proxies requests
