Rate Limits
How AI Setu enforces per-key, workspace, and connection rate limits.
Rate limits cap request or token frequency — how fast you can call, not how much you spend. They're a separate mechanism from budgets and credit balance, and return a different status code.
There is no platform-wide default
AI Setu does not impose a default requests-per-minute ceiling on new workspaces. A key, workspace, or Connection with no configured rate limit has no cap on request frequency. Limits are opt-in — you set them where you want a ceiling.
Scopes
Up to four scopes can apply to a single request, each checked independently in one atomic step — a request blocked on one scope's limit never consumes budget against another:
| Scope | Applies to |
|---|---|
key | The API key that authenticated the request |
workspace | Every request in the workspace |
slug | One BYOK Connection (@<slug>/<model> requests) |
token | One ephemeral token, by its own configured limit (see Agent Quickstart) |
Each limit has a type — request (count of calls) or token (token
volume, estimated before the call and corrected after) — and an
interval — minute, hour, or day.
Configuring limits
Per-API-key rate limits are configurable today in the console, from the workspace's Settings → Keys tab — add one or more type + interval + limit rows to a key. Workspace- and Connection-level limits exist in the underlying engine but aren't yet exposed in the console UI.
Response headers
Every request that passes through the rate limiter — whether it's allowed or blocked — carries:
| Header | Meaning |
|---|---|
X-AI-Setu-RateLimit-Limit | The tightest configured ceiling among the request's applicable scopes |
X-AI-Setu-RateLimit-Remaining | Remaining count in the current window for that limit |
X-AI-Setu-RateLimit-Reset | Seconds until the current window resets |
These headers are absent when no scope on the request has a configured limit.
On breach
A rate-limited request returns 429 with code wesence.rate_limit, plus a
Retry-After header (seconds to wait before retrying):
{ "error": { "code": "wesence.rate_limit", "message": "rate limit exceeded", "request_id": "..." } }This is distinct from a 402 — being rate-limited says nothing about your
credit balance or budget; you can be well within budget and still be
rate-limited if you're calling too fast.