Skip to main content

Rate limits

API Gateway rate limiting caps the request volume a single caller can send to an endpoint within a specified time window. Throttling prevents traffic surges and manages backend compute costs.

Configuring rate limits

Rate limits are configured using the format <requests>/<unit> (for example, 100/minute).

PropertyValuesDescription
requestsPositive integerMaximum allowed requests per time window.
unitsecond, minute, hour, dayTime window duration.
keyclient_ip or api_keyCounter bucket key. Defaults to client_ip.

1. Apply a rate limit

platformctl gateway endpoint update support-api --rate-limit 100/minute --rate-limit-by client_ip

To remove a rate limit:

platformctl gateway endpoint update support-api --clear-rate-limit

2. Counter keys (client_ip vs api_key)

  • client_ip: Tracks request counts by the caller's origin IP address. Works across all authentication modes.
  • api_key: Tracks request counts per API key. Requires apikey authentication mode.

3. Rate limit HTTP headers

When a rate limit is active, the Gateway includes rate limit status headers in every response:

Response HeaderDescription
X-RateLimit-LimitMaximum request capacity for the configured window.
X-RateLimit-RemainingRemaining request capacity in the current window.
X-RateLimit-ResetTime remaining (in seconds) until the window resets.

If a caller exceeds the ceiling, the Gateway returns HTTP 429 Too Many Requests.


High availability behavior

API Gateway distributes rate limit counters across edge nodes. High-availability distributed counters guarantee consistent enforcement across edge regions without imposing latency penalties.