AI Dictionary › Fondamenti AI
Rate limiting is the restriction of how many requests a client can make within a time window: a hundred per minute, ten thousand per day. It protects services from overload, abuse and runaway costs, ensuring shared resources remain fairly available to everyone.
Rate limiting is the restriction of how many requests a client can make within a time window: a hundred per minute, ten thousand per day. It protects services from overload, abuse and runaway costs, ensuring shared resources remain fairly available to everyone.
The most common algorithm is the token bucket: a bucket fills with tokens at a constant rate, each request consumes one, and when the bucket is empty requests are rejected with HTTP error 429 (Too Many Requests). Variants like sliding window and leaky bucket trade precision against simplicity differently. Responses often include headers showing remaining quota and reset time.
In AI, rate limiting is a daily experience: model APIs enforce limits on requests per minute and tokens per minute, tiered by subscription level, and application builders must handle them with queues, backoff and load spreading across multiple keys or providers. Beyond AI it governs public APIs, logins (against brute force attacks) and network traffic.
The concept descends from traffic shaping in telecommunication networks: the token bucket and leaky bucket algorithms were developed and analyzed in the 1980s, notably in the community designing ATM networks, to regulate packet flows. With the API economy of the 2000s, rate limiting moved from the network layer to the application layer, becoming a commercial instrument too: paid plans differ precisely in the limits they grant.
Il rate limiting è la limitazione del numero di richieste che un client può effettuare in una finestra di tempo: cento richieste al minuto, diecimila al giorno. Protegge i servizi dal sovraccarico, dagli abusi e dai costi fuori controllo, garantendo che le risorse condivise restino disponibili per tutti in modo equo.
L'algoritmo più diffuso è il token bucket: un secchiello si riempie di gettoni a ritmo costante, ogni richiesta ne consuma uno, e quando il secchiello è vuoto le richieste vengono respinte con l'errore HTTP 429 (Too Many Requests). Varianti come sliding window e leaky bucket offrono compromessi diversi tra precisione e semplicità. Le risposte includono spesso header che indicano quota residua e momento del reset.
Nell'AI il rate limiting è esperienza quotidiana: le API dei modelli impongono limiti su richieste al minuto e token al minuto, distinti per livello di abbonamento, e chi costruisce applicazioni deve gestirli con code, backoff e distribuzione del carico tra più chiavi o provider. Fuori dall'AI regola API pubbliche, login (contro gli attacchi di forza bruta) e traffico di rete.
Il concetto discende dal traffic shaping delle reti di telecomunicazione: gli algoritmi token bucket e leaky bucket furono sviluppati e analizzati negli anni '80, in particolare nella comunità che progettava le reti ATM, per regolare i flussi di pacchetti. Con l'economia delle API degli anni 2000, la limitazione di velocità è passata dal livello di rete a quello applicativo, diventando anche uno strumento commerciale: i piani a pagamento si differenziano proprio per i limiti concessi.
From our network
Kaimaki Web — Websites That Win Customers
Custom websites, web apps and digital marketing for growing businesses.
Visit kaimakiweb.com →From the Agora Intelligence blog
📱 Download the Android app (beta) iOS coming soon
Say what you mean. Get what you need.
Grace Certified — the AI coach that trains and certifies your prompt engineering — by Agora Intelligence.