Skip to main content

Policies

A Policy defines rate limits and long-term quotas for a Client. Attach a policy to prevent abuse, enforce fair use, and meet SLA requirements.

Rate limit vs Quota

Zerq supports two tiers of limiting:

TypePurposeExample
Rate limitShort-term throttling — prevent bursts100 requests per minute
QuotaLong-term cap — enforce monthly billing limits50,000 requests per month

Both can be configured independently. A client hitting either limit receives:

HTTP/1.1 429 Too Many Requests
Content-Type: application/json

{
"error": "rate_limit_exceeded",
"message": "You have exceeded your request rate limit. Please try again later."
}

Creating a Policy

  1. Go to Policies in the sidebar
  2. Click New Policy
  3. Fill in:
FieldDescription
NameDescriptive label (e.g., "Free Tier", "Enterprise Plan")
DescriptionOptional notes
Rate limit — Max requestsMaximum requests per interval
Rate limit — Interval1m, 5m, or 1h
Quota — Max requestsMaximum requests per quota period
Quota — Interval1d, 7d, or 30d
  1. Click Create

Interval options

Rate limit intervals

IntervalWindow
1m1-minute sliding window
5m5-minute sliding window
1h1-hour sliding window

Quota intervals

IntervalReset behavior
1dResets at midnight UTC daily
7dResets every Monday at 00:00 UTC
30dResets on the 1st of each month at 00:00 UTC

Attaching a policy to a client

  1. Open the Client
  2. Click Edit
  3. Select a Policy from the dropdown
  4. Save

The policy applies to all the client's active profiles combined — not per profile.

Disabling a policy

Toggle a policy to inactive to stop enforcing it without deleting it. This is useful for temporarily lifting limits during an incident or migration.

Designing policies for tiers

Common patterns:

Free tier:       100 req/min, 10,000 req/month
Starter tier: 500 req/min, 100,000 req/month
Business tier: 2,000 req/min, 1,000,000 req/month
Enterprise: Unlimited (no policy attached)

Monitoring usage

View a client's current quota usage on the Client detail page. The Metrics dashboard also shows request volumes per client filtered by time range.

→ See Observability