MagicAPI /
ai-gateway-ts
Built for demanding AI workflows, this gateway offers low-latency, provider-agnostic access, ensuring your AI applications run smoothly and quickly.
Loading repository data…
boelabs / repository
Provider-agnostic AI gateway with OpenAI- and Anthropic-compatible APIs, model routing, virtual keys, fallbacks, rate limits, and observability.
Unified Gateway is a backend-only, provider-agnostic AI gateway. It exposes stable OpenAI-shaped public endpoints while routing requests to provider-specific upstream APIs through adapters.
Unified Gateway is developed by Boelabs as shared infrastructure for the products and services we run or plan to run.
It is built for teams that want one public model catalog, one auth/rate-limit/logging layer, and one predictable contract across OpenAI, Anthropic, Google, Azure, OpenAI-compatible providers, and custom models.
/v1/messages rendering over the same canonical core.Unified Gateway is pre-1.0. The main contracts are covered by unit and integration tests, but breaking changes are still possible while the adapter surface and admin API settle.
This repository is a Turborepo managed with Bun workspaces.
.
├── apps/
│ ├── gateway/ # the Unified Gateway service (runs on Bun; see apps/gateway)
│ └── docs/ # documentation site (Next.js, Fumadocs, MDX)
├── packages/
│ └── tsconfig/ # shared TypeScript configuration (@boelabs/tsconfig)
├── turbo.json # task pipeline
└── package.json # workspace root (bun workspaces + turbo)
Dependencies, tasks, and the gateway runtime are all Bun (with Turbo orchestrating the workspace); Bun runs TypeScript directly, so there is no build step.
Requirements: Bun 1.3+, Postgres 18+, Redis 8+ (Docker optional, for local dependencies).
bun install
docker compose -f docker-compose.yml -f compose.local.yaml up -d postgres redis
cp apps/gateway/.env.example apps/gateway/.env
bun run --filter @boelabs/unified-gateway db:migrate
bun run --filter @boelabs/unified-gateway dev
In .env, set at least MASTER_KEY (any long secret) and CREDENTIALS_ENCRYPTION_KEY
(openssl rand -hex 32). Everything else ships with production-ready defaults — the full environment
reference lives in Setup.
curl http://localhost:4000/health/live # liveness (no dependencies)
curl http://localhost:4000/health/ready # readiness (Postgres + Redis + extensions)
From here, the Quickstart guide walks from clone to a first
completion: create a deployment through the Admin API, then call /v1/chat/completions with your key.
Common workspace commands, from the repo root:
bun run dev # run all dev tasks via turbo (gateway + docs)
bun run typecheck # typecheck every package
bun run test # unit tests across packages
bun run check # Biome format + lint (whole repo)
To work on a single package, use --filter, e.g. bun run --filter @boelabs/unified-gateway dev.
Both apps ship container images built from the repo root (apps/gateway/Dockerfile,
apps/docs/Dockerfile). docker-compose.yml is the production/PaaS base: Postgres, Redis, a one-off
migration job, the gateway, and the docs site, without publishing host ports — Coolify, Dokploy, and
similar platforms deploy that file directly and expose services through their proxy. For local or
single-host use, merge compose.local.yaml, which publishes ports on loopback and provides
development-only secrets:
MASTER_KEY=$(openssl rand -base64 48) \
CREDENTIALS_ENCRYPTION_KEY=$(openssl rand -hex 32) \
docker compose -f docker-compose.yml -f compose.local.yaml up -d
The production base leaves both secrets empty and the gateway refuses to start until they are configured. Per-platform guides and the compose naming rationale: Deployment.
Everything beyond this page — API contracts, provider setup, admin operations — lives in the docs,
authored in MDX under apps/docs/content/docs and rendered as a Fumadocs
site (bun run --filter @boelabs/docs dev).
The machine-readable API spec is apps/gateway/openapi.yaml — see
the API guide for import instructions.
MASTER_KEY and CREDENTIALS_ENCRYPTION_KEY are set — the
production compose base deliberately ships them empty.Exact symptoms, fixes, and every error code: Troubleshooting.
Contributions are welcome. Please read CONTRIBUTING.md for the development setup, conventions, and the checks CI runs. All code, comments, and documentation are written in English. AI coding agents should start with AGENTS.md.
To report a vulnerability, follow SECURITY.md. Please do not open public issues for security problems.
Released under the MIT License.
Selected from shared topics, language and repository description—not editorial ratings.
MagicAPI /
Built for demanding AI workflows, this gateway offers low-latency, provider-agnostic access, ensuring your AI applications run smoothly and quickly.
MallikarjunSonna /
Enterprise AI Platform built with React, FastAPI, and a provider-agnostic AI Gateway architecture.