On this page
Getting started
Introduction
RelayRouter is an [OI]-compatible AI gateway. One key reaches every model in the catalog, with one balance and one usage ledger.
RelayRouter sits between your application and the upstream providers. It resolves the model, enforces your limits, reserves credit, proxies the request, and records usage — all behind a single endpoint.
How it works
- One endpoint. Chat, embeddings, images, audio, video, and moderation all use the [OI] request shape.
- One key. Keys look like
sk-or-v1-…and can carry RPM, concurrency, spend caps, and BYOK credentials. - One balance. Prepaid micro-USD. Each request reserves the worst-case cost before proxying, so parallel requests cannot overdraw the account.
- Automatic failover. Retryable upstream failures are retried, then failed over to the model's fallback chain when enabled.
Base URL
All requests use application/json except SSE streams, audio bytes, multipart uploads, and HTML pages. CORS is permissive and no cookies are used.
Two kinds of tokens
There is no refresh endpoint
401. Store the token, catch the error, and send the user back to sign in.Money and pricing
Every internal amount is an integer in micro-USD: 1_000_000 micro = $1.00. Never do float math on balance_micro; display micro / 1e6. Model prices in the catalog are USD per one million tokens.
A request costs the flat network fee plus the serving model's token cost. Failed upstream calls are never billed. See Billing & deposits for the exact formula.
What to read next
- Quickstart — make a request in five steps.
- Authentication — sessions, verification, and reset flows.
- API keys — caps, rotation, and BYOK.
- Free plan — Discord activation and free-tier limits.
- Chat completions — request and response shapes.