API gateway, service endpoints, rate limiting, voice (api-stack: Fusio, TTS)
This repository has been archived on 2026-03-22. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2026-03-22 06:17:53 +00:00
.forgejo/workflows ci: add compose-lint workflow from generate-one template 2026-03-04 13:39:01 +00:00
.gitea/issue_template chore: add infrastructure change issue template 2026-03-04 13:47:43 +00:00
compose feat: sync live compose from production (2026-02-27) 2026-02-26 22:09:33 +00:00
config Initialize config directory 2026-02-23 17:56:21 +00:00
docs Initialize docs directory 2026-02-23 17:55:37 +00:00
.env.example feat: sync live compose from production (2026-02-27) 2026-02-26 22:09:34 +00:00
.gitignore Add .gitignore 2026-02-25 15:39:25 +00:00
CLAUDE.md Update CLAUDE.md: API Lead agent naming 2026-02-26 22:12:50 +00:00
LICENSE Add MIT LICENSE 2026-02-25 15:39:49 +00:00
README.md docs: premium README overhaul 2026-03-22 06:17:53 +00:00

g1-api

Unified API gateway — REST endpoints, web search, and GPU-powered speech synthesis.

Status License Platform Fusio GPU OAuth2


Overview

g1-api is the public API surface of Generate One. It bundles three compose stacks: Fusio as the API gateway for building and managing OAuth2-secured REST endpoints, a search stack with SearXNG + Crawl4AI for web intelligence APIs, and Chatterbox TTS for GPU-accelerated text-to-speech synthesis on an RTX 5090. All routes are documented via OpenAPI and accessible through a developer portal.

🏗️ Architecture

graph TD
    subgraph g1-api ["g1-api · api.generate.one"]
        subgraph gateway ["🔐 API Gateway"]
            F[Fusio 5.2<br/>OAuth2 + Scopes<br/>:80]
            MDB[MariaDB 10.11<br/>API Metadata]
        end
        subgraph search ["🔍 Search APIs"]
            SX[SearXNG<br/>Meta Search<br/>:8080]
            C4[Crawl4AI 0.8.0<br/>Web Scraping<br/>:11235]
        end
        subgraph tts ["🗣️ Speech Synthesis"]
            CB[Chatterbox TTS<br/>GPU Accelerated<br/>:8004]
        end
    end

    CLIENT[API Consumers] -->|Bearer Token| T[Traefik]
    T -->|api.generate.one| F
    T -->|search.generate.one| SX
    F --> MDB
    F -->|/v1/chat/completions| LLM[LiteLLM<br/>g1-llm]
    F -->|/v1/search| SX
    F -->|/v1/memory/search| MEM[Graphiti<br/>g1-brain]
    F -->|/v1/knowledge/search| KM[knowledge-mcp<br/>g1-brain]
    CB -.->|🎮 NVIDIA RTX 5090| GPU[GPU]

    style g1-api fill:#1a1a2e,stroke:#e94560,stroke-width:2px,color:#fff
    style F fill:#1976d2,color:#fff
    style CB fill:#76b900,color:#fff
    style SX fill:#3daee9,color:#fff
    style C4 fill:#ff6f00,color:#fff

🚀 Quick Start

# Clone the repository
git clone git@git.generate.one:generate-one/g1-api.git
cd g1-api

# Deploy API gateway
docker compose -f compose/api-gateway.yml up -d

# Deploy search APIs
docker compose -f compose/api-search.yml up -d

# Deploy TTS (requires NVIDIA GPU)
docker compose -f compose/api-tts.yml up -d

🔗 Key Endpoints

Endpoint Purpose
https://api.generate.one API gateway root
https://api.generate.one/system/generator/spec-openapi OpenAPI specification
https://api.generate.one/apps/redoc Interactive API documentation

🛣️ API Routes

Route Method Scope Backend
/v1/chat/completions POST api.chat LiteLLM
/v1/search POST api.search SearXNG
/v1/memory/search POST api.memory Graphiti API
/v1/knowledge/search POST api.knowledge knowledge-mcp
/v1/health GET (public) Composite health check

🔧 Configuration

API Gateway

Variable Description Default
FUSIO_PROJECT_KEY Fusio project encryption key
FUSIO_URL Public API URL https://api.generate.one
FUSIO_DB_PASSWORD MariaDB password
FUSIO_CONNECTION Database connection string pdo-mysql://fusio:…@mariadb/fusio

Search Stack

Variable Description Default
SEARXNG_SECRET SearXNG instance secret
SEARXNG_BASE_URL Public search URL https://search.generate.one
CRAWL4AI_API_TOKEN Crawl4AI auth token
OPENAI_BASE_URL LLM proxy for AI extraction LiteLLM internal

Text-to-Speech

Variable Description Default
HF_TOKEN HuggingFace access token
NVIDIA_VISIBLE_DEVICES GPU device visibility all

📦 Services

Service Image Port Domain Purpose
Fusio fusio/fusio:5.2 80 api.generate.one API gateway with OAuth2, scopes, rate limiting
MariaDB mariadb:10.11 3306 Internal Fusio metadata database
SearXNG searxng/searxng:latest 8080 search.generate.one Privacy-first meta search
Crawl4AI unclecode/crawl4ai:0.8.0 11235 Internal AI-powered web scraping
Chatterbox chatterbox-tts:cu128 (local) 8004 Internal GPU text-to-speech (RTX 5090)

📂 Compose Files

File Stack Description
compose/api-gateway.yml 🔐 Gateway Fusio + MariaDB
compose/api-search.yml 🔍 Search SearXNG + Crawl4AI
compose/api-tts.yml 🗣️ TTS Chatterbox (GPU, locally built)

🔐 Authentication

Fusio uses OAuth2 client credentials flow. Token scopes control access:

┌─────────────────┐     ┌──────────────┐     ┌─────────────┐
│  Client App     │────▶│  Fusio       │────▶│  Backend    │
│  Bearer Token   │     │  Scope Check │     │  Service    │
└─────────────────┘     └──────────────┘     └─────────────┘
Scope Access
api.chat Chat completions (LiteLLM)
api.search Web search (SearXNG)
api.memory Memory/graph search (Graphiti)
api.knowledge RAG knowledge search

🔗 Dependencies

Dependency Project Purpose
LiteLLM g1-llm Chat completion backend
SearXNG g1-web Web search backend
Graphiti g1-brain Memory/knowledge backends
PostgreSQL svc-infra Shared database infrastructure
Valkey svc-infra Crawl4AI task queue
NVIDIA GPU Host Chatterbox TTS inference
Repo Relationship
g1-llm LiteLLM model routing
g1-web SearXNG + Crawl4AI backends
g1-brain Graphiti API + knowledge-mcp
g1-auth Authentik OIDC provider

🛡️ Part of Generate One

Generate One — AI infrastructure that answers to you.

Self-hosted, sovereign AI platform. generate.one