[[ratelimits]] entry in telnyx.toml exposes a rate limiter binding on the handler’s env argument. The binding name is uppercased and hyphens are replaced with underscores, so a limiter named api-limit is available as env.API_LIMIT.
env.NAME.limit({ key })
Checks and increments the counter for key in the current fixed window.
Input
Return value
The method returnsPromise<{ success: boolean }>:
Rate limiting fails closed: treat
success: false as a rejection.
The binding returns only the decision. Your function is responsible for returning an appropriate response, such as HTTP 429 Too Many Requests.
TypeScript type
telnyx-edge types v0.3.0 does not yet generate rate limiter declarations. Define the binding interface in your project: