Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 11.7 KB

createkeyratelimit.md

File metadata and controls

15 lines (11 loc) · 11.7 KB

CreateKeyRatelimit

Unkey comes with per-key fixed-window ratelimiting out of the box.

Fields

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.