Getting started · § 1.1
1.1Introduction
What Relay is, what it is for, and how the pieces fit together.
Relay is an API toolkit for small teams. You write route handlers as plain functions, and Relay handles hosting, environments, secrets, logs, and webhooks. There is no server to manage and no YAML to learn.
The mental model
A Relay project is a folder of routes plus one config file:
my-api/
├── relay.toml
└── routes/
├── users.ts → /users
├── users/[id].ts → /users/:id
└── health.ts → /healthEach file exports a handler. Deploying uploads the folder, builds it, and atomically swaps traffic to the new build:
// routes/health.ts
export default function handler() {
return Response.json({ ok: true });
}What Relay gives you
| Piece | What it does |
|---|---|
| Routes | File-based HTTP endpoints with zero boilerplate |
| Environments | staging and production targets with instant promotion |
| Secrets | Encrypted per-environment values, injected at runtime |
| Logs and metrics | Structured logs, p50/p95/p99 latency, error rates |
| Webhooks | Signed events pushed to your own endpoints |
Where to go next
- Installation gets the CLI on your machine.
- Quickstart deploys your first route in about a minute.
- The changelog tracks everything that ships.