Budgets & governance
Per-key and organization-wide spend limits with graduated alerts and a hard cap, so spend stays inside the limits you set.
Governance is what separates Nyuro from a plain proxy. Every request is checked against the budgets you configure before it is allowed to spend, and usage is recorded the moment a response is billed.
Two levels of budget
Per-key budgets
Attach a budget to an individual API key. Useful for capping a single integration, environment, or customer.
Organization budgets
A budget that aggregates spend across all members of an organization. Useful for a team or company-wide ceiling that no single key can exceed.
How enforcement works
Each budget has a limit, an optional alert threshold, and a period
(none, daily, weekly, or monthly). On every request:
- The gateway reads current spend for the budget's period (cached in Redis, seeded from the database on a cold start).
- If spend is already at or above the limit, the request is rejected with HTTP 402 Payment Required — a hard block.
- Otherwise the request proceeds, and its cost is recorded against both the key budget and the owning organization's budget.
Graduated then hard
Budgets alert and block. You get graduated alerts as spend climbs past the threshold, and a hard 402 at 100%. The alert fires once per band (deduped via a Redis high-water mark) so you are not paged repeatedly for the same spend level.
Alerts
When spend crosses the configured threshold, Nyuro emits a budget alert. Alerts are fail-soft and fire-and-forget — a delivery problem never blocks or slows a request. External delivery channels are off by default and opt-in per deployment.
Alert payloads are deliberately minimal: they carry the key prefix or organization id and the spend figures — never a raw API key.
Configuring an organization budget
Organization budgets are managed from Dashboard → Settings → Organization. Set the limit, an optional alert threshold (a fraction of the limit), and the period. Spend is keyed on the organization, so every member's usage counts toward the same ceiling.
Organization budgets are scoped to the org and require no per-user configuration — any request made by a member of the org is automatically counted.
What you get
- A predictable spend ceiling at both the key and the organization level.
- Early warning before you hit the cap, without alert fatigue.
- A hard stop that prevents runaway cost from a misbehaving integration.
Pair budgets with Observability to see exactly where the spend is going.