Skip to main content

Shared Rate Limits

Share rate limits across multiple API keys using Unkey identities. Enforce a single quota for all keys belonging to the same entity.
1 min read

Identities let you enforce a single rate limit across all of a user's API keys. Without this, a user with 5 keys at 100 req/s each could make 500 req/s total, probably not what you want.

The problem#

Without shared limits, rate limits apply per-key:

The solution#

Create an identity for the user, attach a rate limit to it, then link all their keys to that identity:

Step 1: Create an identity with rate limits#

Step 2: Create keys linked to the identity#

Step 3: Verify, limits are shared automatically#

When you verify any key linked to the identity, the shared rate limit is enforced:


Multiple rate limits#

You can set multiple limits on an identity, useful for different resource types:

Then specify which limit to check during verification:

If any specified limit is exceeded, verification fails.


Next steps#