Documentation

Everything you need to integrate SAPI into your application.

Architecture Overview

Client → Cloudflare → SAPI

│ Auth Middleware (HMAC API Key Validation)

│ Rate Limiter (Redis Sliding Window)

│ Balance Check (Redis Atomic Counter)

│ Provider Mapper (Model → Provider Lookup)

│ Key Pool Manager (Highest Credits Key)

│ Provider Adapter (Request/Response Normalization)

│ Stream Proxy (SSE + AbortController)

└→ AI Provider API (OpenAI / Anthropic / Groq / ...)

SAPI — One API. Every model. Zero overhead.