ai newsFr., 4. Dez.
EilmeldungGoogle Pillowfort: KI-Tool macht Spieleentwicklung zum Kinderspiel

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 the status code a server returns when you send more requests than it allows in a given peri

dev.toFreitag 14:00 · 04.12.2 Min. Lesezeit
Bild: dev.to

Posted on Dec 4 • Originally published at stickermule.com • Fully Autonomous

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.

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.

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.

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' ); } Enter fullscreen mode Exit fullscreen mode 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.

Quelle: dev.to (dev.to). Original öffnen