Dev.to AI 🤖 Ai 👁 0 📖 2 min read

HTTP 429 Too Many Requests Explained (and Why It Is Everywhere in the Age of AI Agents)

Some error codes are boring. 500 means something broke. 404 means it is not there. But 429 is different. 429 is the internet politely telling you to calm down. What is HTTP 429? HTTP 429 Too Many Requests is

Some error codes are boring. 500 means something broke. 404 means it is not there. But 429 is different. 429 is the internet politely telling you to calm down.

What is HTTP 429?

HTTP 429 Too Many Requests is the status code a server returns when you send more requests than it allows in a given period of time. This is called rate limiting. APIs use it to protect themselves from overload, abuse and runaway scripts, and to share capacity fairly between users.

A well behaved server often includes a Retry-After header telling you how long to wait before trying again. In other words: be right back.

Why you see it more than ever

In the age of AI agents, 429 became part of daily life. Agents call APIs in loops, read documentation, run tests and hit model endpoints over and over. One enthusiastic agent can trigger a rate limit faster than a whole team of humans. Model providers also return 429 when you exceed your usage tier, so even your AI assistant can get rate limited mid sentence.

How to handle a 429 like a pro

  • Respect Retry-After. If the server tells you when to come back, listen.
  • Use exponential backoff with jitter. Wait a little, then longer, then longer still, with some randomness so clients do not retry in sync.
  • Batch and cache. The cheapest request is the one you never send.
  • Put limits on your agents. Cap loops and retries so one bug does not hammer an API all night.
async function withBackoff(fn, retries = 5) {
  for (let i = 0; i < retries; i++) {
    const res = await fn();
    if (res.status !== 429) return res;
    const wait = Number(res.headers.get('retry-after')) * 1000 || (2 ** i) * 500 + Math.random() * 250;
    await new Promise(r => setTimeout(r, wait));
  }
  throw new Error('Still rate limited');
}

What is the worst 429 story you have? Mine involves an agent, a for loop and a very long night.

We love this error so much we made it a laptop sticker: 429 Rate Limited, be right back. More dev stickers at StackForge.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.