Summary
Since the application connects to paid LLM endpoints (OpenRouter/Groq), unprotected API routes (/api/chat, etc.) are vulnerable to abuse or scraping, which can quickly drain API credits.
Proposed Changes
- Since the project already uses Upstash Redis (per the .env.example), I will implement @upstash/ratelimit.
- Add rate limiting middleware to the API routes, restricting users to a sensible quota (e.g., 10 requests per minute per IP or authenticated User ID).
I'm highly interested in building out this backend security layer. Could you assign me?
Summary
Since the application connects to paid LLM endpoints (OpenRouter/Groq), unprotected API routes (/api/chat, etc.) are vulnerable to abuse or scraping, which can quickly drain API credits.
Proposed Changes
I'm highly interested in building out this backend security layer. Could you assign me?