Skip to main content
This walkthrough configures a function to allow two requests per authenticated user during each 10-second window.
Use telnyx-edge v0.3.0 or later. Earlier CLI versions may upload an invalid [[ratelimits]] block instead of rejecting it locally.

1. Declare a rate limiter

Add a [[ratelimits]] block to telnyx.toml:
This configuration allows two successful checks per key in each 10-second window.

2. Check the limit in your handler

The binding returns a decision; it does not send a 429 response automatically.
telnyx-edge types v0.3.0 does not yet generate rate limiter declarations. Define the small RateLimiter interface in your project, as shown above.

3. Ship and test

For the configuration above, three requests with the same trusted user ID during one window produce two 200 responses followed by a 429:
The CLI validates each declared limiter before upload and prints its name, limit, and period. See the API Reference for the binding’s method contract and return values.