Security
Unbounded consumption (denial of wallet)
Attackers — or bugs — making you pay for huge or endless model usage.
What it is and why it exists
OWASP LLM10. Giant inputs, prompts that trigger maximal output, agent loops, and scripted abuse of a free endpoint can run up bills or exhaust rate limits for everyone.
Quick prototype
No limits.
In production, at scale
Per-user and per-tenant rate limits and quotas in tokens and dollars, input size caps, max output tokens, agent budgets, anomaly alerts on spend, and auth or CAPTCHA on expensive public endpoints.
Vendors and tools
| API gateways / Upstash rate limiting | Per-key limits |
|---|---|
| LiteLLM budgets | Spend limits per key |
On AWS: API Gateway usage plans and throttling; AWS Budgets and Cost Anomaly Detection; Bedrock quotas.
How it fails
- A public demo endpoint scripted overnight
- One tenant consuming the whole provider rate limit
What the interviewer asks next
How do you rate-limit an LLM API fairly?
Token-based limits (not just requests) per user and tenant, a shared limiter (Redis token bucket), priority tiers, and queuing rather than failing for batch work.