Rate limiter: token bucket
TemplatesFlowchart
The decision each request goes through in a token-bucket limiter: build the key, refill, then take a token or answer 429.
What is inside
- Refill before checking
- One decision, two outcomes
Use this template
Opens in the playground, no account needed. Sign up to save it.
Show the Inkline text
diagram flow "Rate limiter — token bucket" start req "Request arrives" step key "Build key (user + route)" step refill "Refill tokens since last call" decision left "Tokens left?" step take "Take one token" end allow "Forward to the API" end deny "429 Too Many Requests" req -> key -> refill -> left left -> take : yes take -> allow left -> deny : no