Getting Started
Create a project, mint an API key, and make your first rate-limit check.
Create a project, mint an API key, and make your first rate-limit check.
Brume is a hosted rate-limiting gateway built in Rust. You define rules, evaluate requests against them with one HTTP call, and read standard X-RateLimit-* headers. This guide walks you through your first check.
Install the TypeScript SDK:
Or with Bun:
The SDK is a thin typed client over the HTTP API — you can also call the API directly with curl or any HTTP client.
Sign in at app.brume.run, create a project, and mint an API key with the rate_limit scope. The key is shown exactly once — store it in your secret manager.
A rule binds a namespace to an algorithm, a limit, and a window. Create one with the dashboard or the API:
This rule allows each user 100 requests per minute against the api namespace.
limit() consumes one unit of capacity. check() is read-only — it reports the current state without consuming. Both return the same typed result: success, limit, remaining, reset, retry_after, and degraded.
Every evaluation also sets standard response headers you can forward to your callers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | The rule's configured limit |
X-RateLimit-Remaining | Capacity left in the current window |
X-RateLimit-Reset | Unix timestamp (ms) when the window resets |
Retry-After | Seconds to wait (only when denied) |
X-Brume-RateLimit-Degraded | true when the check failed open |