Practical Rate Limiting for Free Public AI Endpoints Without Annoying Real Users A developer outlined a lightweight rate-limiting pattern for free, no-signup AI endpoints that combines a 5-request burst limit per 30 seconds with a 25,000-character hourly budget tracked in Redis, rather than counting requests alone. The approach normalizes IPv6 addresses to /64 prefixes to avoid false positives from rotating host addresses, adds anonymous HttpOnly session tokens, deduplicates identical prompts for 60 seconds via a hash cache, and returns structured 429 responses with a Retry-After header and a frontend countdown. The developer argues these measures curb accidental and automated token waste while keeping the first-visit experience smooth for genuine users. If you ship a free, no-signup AI web tool, a naive rate limit like "10 requests per minute per IP" almost always fails in both directions. Real users on shared mobile carrier NATs or office Wi-Fi hit false-positive blocks after two clicks, while simple rotating-IP scripts burn through your token budget in minutes. Here is a lightweight, practical rate-limiting pattern that protects LLM endpoints without ruining the first-time experience for genuine visitors. Counting only requests treats a 40-character prompt the same as a 4,000-character prompt. Instead, enforce two lightweight checks in Redis or an in-memory store for single-instance apps : type LimitCheck = { allowed: boolean; retryAfterSec: number; }; type RedisCounter = { incr: k: string = Promise