Skip to content

Releases

Python SDK 0.3.0

Choose a tag to compare

@supertj supertj released this 26 Nov 18:03

Changes how rate-limited 429 responses describe the wait.

  • RateLimit's w is now the whole seconds before a bucket's next token, rounded down, as draft-ietf-httpapi-ratelimit-headers-12 defines it (the time within which the client can use no more than a). It's left out when that wait is under a second.
  • Only buckets with no tokens left carry w. Buckets that still have tokens report only a. In 0.2.0 they also sent w as the time to a full refill, which could be longer than Retry-After.
  • Retry-After is unchanged: the longest wait for a token among the empty buckets, rounded up.

If you use RateLimitPolicy or rate_limit_headers from usagerail.rate_limiter: reset_seconds is replaced by retry_after_seconds (the wait rounded up) and effective_window_seconds (rounded down, None under a second). Both are None for a bucket that still has tokens.

Details: https://usagerail.com/docs/rate-limits

Node SDK 0.3.0

Choose a tag to compare

@supertj supertj released this 26 Nov 18:03

Changes how rate-limited 429 responses describe the wait.

  • RateLimit's w is now the whole seconds before a bucket's next token, rounded down, as draft-ietf-httpapi-ratelimit-headers-12 defines it (the time within which the client can use no more than a). It's left out when that wait is under a second.
  • Only buckets with no tokens left carry w. Buckets that still have tokens report only a. In 0.2.0 they also sent w as the time to a full refill, which could be longer than Retry-After.
  • Retry-After is unchanged: the longest wait for a token among the empty buckets, rounded up.

If you import RateLimitPolicy or call rateLimitHeaders from @usagerail/node/rate-limiter: resetSeconds is replaced by retryAfterSeconds (the wait rounded up) and effectiveWindowSeconds (rounded down, null under a second). Both are null for a bucket that still has tokens.

Details: https://usagerail.com/docs/rate-limits

Node SDK 0.1.2

Choose a tag to compare

@supertj supertj released this 30 Oct 17:52

Published to npm as @usagerail/node@0.1.2: https://www.npmjs.com/package/@usagerail/node/v/0.1.2

Install: npm install @usagerail/node. Setup guides for Express, Hono, Fastify, Next.js and Cloudflare Workers: https://usagerail.com/docs

Python SDK 0.1.1

Choose a tag to compare

@supertj supertj released this 30 Oct 17:52

Published to PyPI as usagerail==0.1.1: https://pypi.org/project/usagerail/0.1.1/

Install: pip install usagerail. Setup guides for FastAPI, Flask and Django: https://usagerail.com/docs