Quickstart
Switch two lines, make your first governed request, and watch a budget block spend
before it happens.
Installation
Run Spillway locally: Postgres, migrations, the seed script, and the dev server.
API reference
Every data-plane and control-plane endpoint, generated from the request/response
schemas the server actually validates against.
Architecture
The two-plane design: one Fastify process, one Postgres database, hard governance
checks before any provider call.
The two planes
Local dev serves both planes from
http://localhost:3000.
What governance actually means here
Most gateways log spend after the fact. Spillway’s guarantees are enforced before the request leaves the building:- Budgets that block. A budget in
enforcemode returns402before the provider is called once a scope’s spend for the period would exceed its limit — no upstream call, no charge, no surprise invoice. - Guardrail policies. Match on virtual key, team, model, or metadata; deny, flag, or require approval. Evaluated on every request, not sampled.
- Approval workflows. A policy can gate a request behind a multi-step, tiered approval chain instead of an outright deny.
- Cost-aware routing. Routing rules rewrite a model to a cheaper equivalent or a fallback chain, evaluated per request before dispatch.
- A ledger, not a log. Every request — including every block — is written as a row with its cost, scope, and outcome, so budgets, alerts, and chargeback reports are always reconciled against what actually happened.
Where next
1
Read the Quickstart
Switch your SDK’s base URL and key, make one request, then watch a budget block the
next one. Five minutes.
2
Run it locally
Follow Installation if you want to run the gateway and dashboard
yourself rather than against a hosted instance.
3
Configure governance
Configuration covers budgets, guardrail policies, routing
rules, approvals, and teams — the resources you’ll actually create.