Limit my ai feature: Free AI Prompt | SheCodes

Free AI prompt · The Optimize Book

Limit my ai feature

A ready-to-use prompt from the chapter Rate Limiting. Paste it into Claude, ChatGPT, Lovable, Bolt or any AI coding tool.

The prompt

“My app has an AI chat that calls OpenAI. Add a rate limit so each user can only send 20 messages per hour. If they hit the limit, show a friendly message and offer them an upgrade link. Skip the limit on localhost. Use whatever free tool you recommend.”

How to use it

  1. Copy the prompt and paste it into your AI coding tool.
  2. Check the result in the preview, then ask for changes one at a time: "make the buttons bigger", "use my brand colours".
  3. Read the chapter to understand why it works and what to do next.

More prompts like this

All prompts

The starter prompt

“Add rate limiting to my app. I want to limit my AI chat feature so each user can only send 20 messages per hour. If they hit the limit, show a friendly message: "You've hit your hourly limit, try again in [X minutes]." Use the simplest setup that works on Vercel: pick whatever free tool you recommend. Walk me through where to get any keys I need.”

Make limit messages friendly

“When my app hits a rate limit, show a friendly toast notification instead of a scary error. The message should explain what happened in plain English ("You've used your hourly limit") and tell the user when they can try again. If the user is on a free plan, also offer them an "Upgrade for higher limits" link.”

Limit my external api

“My app calls the [API name] API to fetch [data type]. Their free tier allows 1000 requests per day. Add caching so I don't call the API more than necessary, and a rate limit so my app never goes over their daily cap even if traffic spikes.”

Limit login attempts

“On my login page, add a rate limit: 5 attempts per minute per IP. After 5 failed attempts, show a friendly message saying "Too many tries. Wait a minute and try again." This protects against people guessing passwords.”

Pre-deploy checklist

“Review my project and tell me if it's ready to go live. Check for: any leftover test URLs that point to my computer instead of the real site, any missing API keys or settings, any large unoptimized images, any debug messages left behind, any missing error pages, and any missing SEO tags. List everything I need to fix before I publish.”

Improve my ai prompts

“I want to improve how I prompt AI coding tools. Review my project and suggest 5 specific things I could have described better in my prompts to get better results. Focus on: layout specifics, color choices, component behavior, responsive design, and edge cases.”