Skip to content
masterclass Buddy

Upstash · Method

Ratelimit.tokenBucket

Token bucket rate limiting refills tokens over time. Each request uses one token, and requests are rejected when the bucket is empty.

Last updated

Syntax

Ratelimit.tokenBucket(refillRate, interval, maxTokens)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Ratelimit
  • Ratelimit.tokenBucket
  • MultiRegionRatelimit

Source: Ratelimit TypeScript SDK Algorithms - Upstash Documentation. Checked 2026-11-03.