Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3W3uHbHAmM3orhn7b
18 lines
680 B
Plaintext
18 lines
680 B
Plaintext
# 5 tokens per 10 seconds per X-Api-Key, Caffeine store
|
|
alice #1 HTTP/1.1 200 X-RateLimit-Remaining: 4
|
|
alice #2 HTTP/1.1 200 X-RateLimit-Remaining: 3
|
|
alice #3 HTTP/1.1 200 X-RateLimit-Remaining: 2
|
|
alice #4 HTTP/1.1 200 X-RateLimit-Remaining: 1
|
|
alice #5 HTTP/1.1 200 X-RateLimit-Remaining: 0
|
|
alice #6 HTTP/1.1 429 X-RateLimit-Remaining: 0
|
|
alice #7 HTTP/1.1 429 X-RateLimit-Remaining: 0
|
|
# a different key has its own bucket
|
|
bob #1 HTTP/1.1 200 X-RateLimit-Remaining: 4
|
|
# no X-Api-Key: the key resolver returns null
|
|
$ curl -i localhost:8080/api/limited
|
|
HTTP/1.1 403
|
|
|
|
|
|
# wait 11 seconds: the bucket refills
|
|
alice #8 HTTP/1.1 200 X-RateLimit-Remaining: 4
|