Skip to main content
RateLimit defines gateway-level rate limiting with configurable identifiers. Frontline executes RateLimit policies and delegates counter state to rate limiting, so policy execution uses the same distributed counters as API and Frontline rate-limit checks.

Fields

limit
int64
Maximum number of requests allowed in the time window.
window_ms
int64
Time window in milliseconds. For example, limit: 100 with window_ms: 60000 means 100 requests per minute.
identifier
RateLimitIdentifier
Determines how requests are bucketed for rate limiting.

Examples

{
  "policies": [
    {
      "id": "global-ratelimit",
      "name": "Rate limit by IP",
      "enabled": true,
      "match": [],
      "ratelimit": {
        "limit": 1000,
        "window_ms": 60000,
        "identifier": { "remote_ip": {} }
      }
    }
  ]
}

Identifier sources

SourceDescription
remote_ipClient IP address. Effective for anonymous traffic, but can over-limit behind shared NATs.
headerValue of a named request header. Only use behind trusted proxies that set the header.
authenticated_subjectPrincipal subject from an upstream auth policy. Most accurate for authenticated APIs.
pathRequest URL path. Creates a separate bucket per endpoint.
principal_fieldValue resolved from a dotted path into the Principal JSON (for example, source.key.meta.org_id for per-organization limits).