Skip to content
masterclass Buddy

Arcjet · Concept

Interval

Use a Go token bucket to limit how often an operation can run. Set a capacity, refill rate, interval, and trusted key, then stop when the Guard decision is denied.

Last updated

Syntax

arcjet.GuardTokenBucket(arcjet.GuardTokenBucketOptions{Mode: arcjet.ModeLive, RefillRate: 5, Interval: time.Minute, Capacity: 10, Bucket: "api"})
rule.Key(userID, requested)

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

Subscribe
  • GuardTokenBucket
  • GuardTokenBucketOptions
  • GuardClient
  • GuardRequest
  • GuardRuleInput
  • ModeLive
  • ModeDryRun
  • ValidateGuardLabel

Source: Arcjet Go SDK reference | Arcjet Docs. Checked 2026-11-03.