Unkey comes with per-key fixed-window ratelimiting out of the box.
Field | Type | Required | Description | Example |
---|---|---|---|---|
limit |
int | ✔️ | The total amount of requests in a given interval. | |
async_ |
Optional[bool] | ➖ | Async will return a response immediately, lowering latency at the cost of accuracy. Will be required soon. Learn more |
|
type |
Optional[models.CreateKeyType] | ➖ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. Deprecated, use async . Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.Learn more |
|
duration |
Optional[int] | ➖ | The window duration in milliseconds. Will be required soon. | 60000 |
refill_rate |
Optional[int] | ➖ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. How many tokens to refill during each refillInterval. |
|
refill_interval |
Optional[int] | ➖ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. The refill timeframe, in milliseconds. |