Check if a request is allowed without consuming tokens
Unique identifier for the rate limit (e.g., user ID, agent ID)
Rate limit result
Consume tokens from the rate limit
Unique identifier for the rate limit
Optionaltokens: numberNumber of tokens to consume (default: 1)
Rate limit result after consumption
Reset the rate limit for a specific key
Unique identifier for the rate limit
Get current state for a key without modifying it
Unique identifier for the rate limit
Current rate limit state, or null if no state exists
Block a key from making requests for a duration
Unique identifier to block
Duration to block in milliseconds
Unblock a previously blocked key
Unique identifier to unblock
Check if a key is currently blocked
Unique identifier to check
true if blocked
Rate limiter interface for controlling request rates.
Implements token bucket or similar algorithms to prevent abuse and ensure fair resource usage across agents and operations.
Example