x-ratelimit-reset is always 0
Hi, shouldn't the rate limit be per minute? Currently the reset is always 0 so the rate limit does not work
The rate limit is per minute - 60-second window, 90 requests by default per token (configurable up to 300 in your account settings). When allowance hits 0 you get a 429 Too Many Requests response, so the limit itself is enforced.
X-RateLimit-Reset here is seconds until the next allowance slot regenerates
, not seconds until the bucket is full
. Because that interval is 60 / rate_limit seconds (~0.66s for the default rate), the integer cast in the response header rounds it down to 0 when the bucket is mostly full. The closer you get to your limit, the larger the value gets.
The most reliable signal for clients is X-RateLimit-Remaining - back off as it approaches 0, and retry after the Retry-After value sent on the 429. I'll log a fix to either round up or expose this in milliseconds; thanks for flagging.