AI Setu Docs
Operations

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:

ScopeApplies to
keyThe API key that authenticated the request
workspaceEvery request in the workspace
slugOne BYOK Connection (@<slug>/<model> requests)
tokenOne ephemeral token, by its own configured limit (see Agent Quickstart)

Each limit has a typerequest (count of calls) or token (token volume, estimated before the call and corrected after) — and an intervalminute, 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:

HeaderMeaning
X-AI-Setu-RateLimit-LimitThe tightest configured ceiling among the request's applicable scopes
X-AI-Setu-RateLimit-RemainingRemaining count in the current window for that limit
X-AI-Setu-RateLimit-ResetSeconds 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.

On this page