Skip to main content
With Traffic Policy, you can rate limit requests to your endpoints based on a variety of criteria. This page demonstrates a few example rules that do so. See the rate-limit Traffic Policy action docs for more information.

By endpoint

This rule applies rate limiting of 30 requests per minute to the endpoint /api/videos.

Based on authentication status

This rule creates a lower rate limit for unauthenticated (likely free) users, while allowing authenticated users a higher level of capacity. The check only looks for an Authorization header; it doesn’t validate the credential.

Based on pricing tiers

Using a naming scheme in your upstream servers with API calls using a tier header, you can quickly customize access to your API based on any number of pricing tiers. This rule checks for a Tier header in the request and applies rate limiting based on the value of that header. Requests with a missing or unrecognized tier get the free limit.
Clients can set any header they like, so only use this pattern when a trusted upstream service or proxy sets the Tier header and strips any value the client sent.