RELAY · RLAB.WORKS

Relay

B2B AI API relay & billing platform for teams.

Relay is a self-operated B2B AI API relay. It fronts OpenAI, Anthropic, and Gemini behind one compatible gateway — companies sign up, invite teammates, share a prepaid balance, and get per-member keys with per-token metering and transparent invoices.

Relay dashboard
30B+
Tokens routed (first month)
400+
Seed users
9
Upstream endpoints
CORE CAPABILITIES

A turnkey AI gateway for your customers

From signup to teammate invites to first API call, Relay productizes the entire B2B AI onboarding path — operators only configure models and pricing.

Unified Gateway

One OpenAI / Anthropic / Gemini compatible endpoint, so customers stop juggling provider keys and SDK adapters.

Organizations & Teams

Owner / Admin / Member roles with a shared prepaid balance across the org and an independent gateway key per member.

Prepaid Balance & Billing

Real-time per-token deduction with traceable invoices for every call; platform admins top up customer balances manually.

Model Routing

Battle-tested routing and credential-pool modules selected from SiftGate OSS, with multi-provider load balancing and failover.

Platform Admin

Admins configure available models, pricing, and customer credits; debug data is encrypted at rest and every op is auditable.

Production-Ready

One Docker Compose stack with Caddy-managed TLS — the entire platform runs on a single VPS.

INFRASTRUCTURE

An engineering foundation built for production traffic

Every layer — from service isolation to data consistency to deployment — is designed for high-throughput token metering and org-level collaboration. No over-engineering, no shortcuts.

Services

NestJS 11 双服务

admin-api and gateway run as isolated services — independently scaled, independently deployed, fault-contained.

Data & Metering

PostgreSQL 16 + Redis 7

PostgreSQL handles strongly-consistent writes for orgs, balances, and invoices; Redis meters tokens with millisecond precision.

Console

React 19 + Vite 6 + Tailwind 4

Customer console and platform admin share one modern frontend — instant builds, immediate feedback, zero operational friction.

Infrastructure

Docker Compose + Caddy

The entire production system is orchestrated in a single compose file, with Caddy managing TLS end-to-end — infrastructure complexity kept to a minimum.