
The dashboard indicates no tenant exceeded 100 requests per minute, yet the compute bill spiked uncontrollably: the API throttled incoming request counts while completely ignoring resource consumption per operation.
In modern AI platforms, two requests passing identical rate limit checks can represent radically different computational costs: one executes a single-turn classification over a short string, while the other parses massive documents, invokes agentic tools, and generates thousands of tokens.
Rate limiting governs arrival velocity—typically measured per identity or tenant using algorithms like token bucket. Usage quotas govern cumulative consumption over a billing period, measured in tokens, compute credits, weighted units, or monetary budgets.
A third boundary must not be conflated with the previous two: concurrency limits regulate how many executions remain active simultaneously. While rate and quota govern speed and volume, concurrency limits shield downstream thread pools, GPU allocations, and shared resources from sudden saturation.
The primary architectural challenge arises when multiple expensive operations initiate concurrently: simply inspecting account balances prior to execution does not prevent parallel requests from observing the same remaining budget and exceeding allowances.
A robust architecture atomically reserves an estimated upper bound before execution starts, enforces streaming caps during processing, and reconciles exact usage upon task completion—releasing unconsumed allocations back to the user balance or requiring an incremental reservation.
While in-memory stores like Redis provide high-frequency admission gating, financial and quota governance requiring audit trails and crash resilience demands an append-only persistent ledger with operation IDs, explicit adjustments, and reconciliation workflows.
When limits are breached, returning a generic 429 Too Many Requests is insufficient. The HTTP contract must clearly differentiate between transient rate spikes and billing quota exhaustion, communicating reset windows when possible so clients can adapt their retry behaviors.
A mature architecture coordinates three independent dimensions: velocity, concurrency, and volume. Limiting request counts alone may protect network ingress, but it fails to protect platform capacity, downstream dependencies, and operating costs.
AI Disclosure: The ideas and content are my own. I use LLMs to improve clarity and polish my writing.