Honor Retry-After
A 429 or 503 often carries Retry-After. Sleep exactly that long and retry once. Ignoring it and retrying immediately is what keeps you rate limited. The header is the server's gift, use it.
Back off exponentially
When the server gives no number, double your wait each failure (1, 2, 4, 8 seconds) and add a little randomness so parallel callers do not retry in lockstep. This converts a burst into a gentle stream.