Identities can be used to share ratelimits across multiple keys
100 RPS
then the user can make 100 * number of keys
requests per second, which probably isn’t what you want. Of course you could limit the number of keys a user can have or do some math to divide 100 by the number of keys they have, but that’s not fixing the actual problem, it’s just a workaround.
Instead, you should create an identity for the user, set the ratelimit on the identity to 100 RPS
and then associate all keys of the user with the identity. This way, the user can only make 100 RPS
across all of their keys.
{name: "requests", limit: 500, duration: 3600000}
-> 500 requests per hour{name: "tokens", limit: 20000, duration: 86400000}
-> 20k tokens per day