Over the limit you get
429 with the code rate_limited. The retry-after header says how many seconds to wait, and x-ratelimit-remaining shows what is left in the current minute.
Back off before retrying, and prefer webhooks to polling a character’s status in a tight loop.