A used-up API allowance now returns 429
What's new
When a token uses its monthly allowance, the API now answers HTTP 429 instead of 401. The body is unchanged: the same error text, with code: quota_exceeded, limit and resets_at beside it.
The 429 carries four new headers:
Retry-After: whole seconds until the count resets.X-RateLimit-Limit: the monthly allowance of the token.X-RateLimit-Remaining: always0on this response.X-RateLimit-Reset: the moment the count resets, as Unix seconds.
The count resets on the first day of each month at 00:00 UTC. A successful response carries none of these headers.
A 401 no longer means a used-up allowance. It points to the token, or to something the account may not use. A 429 with no code is the short request-rate limit, not the monthly allowance, so branch on code when you tell them apart.