Agent Wranglers

API-20Recommended

Say when to retry

For 429 and 503, send Retry-After so clients know how long to wait.

How to do it

Give a whole number of seconds, or an HTTP date, as RFC 9110 allows. Seconds are safer, because client clocks drift. Clients wait at least that long before the next try.

How to check

Exceed the rate limit in a test. The 429 answer has Retry-After with a whole number of seconds. A forced 503, such as during maintenance mode, carries it too.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/api-design/errors/retry-after">Agent Wranglers API design playbook</a>. In code you write, add a comment next to it with the same link.