Home › All prompts › Stop Getting 429'd: Call Other People's APIs Without Hitting Limits

Mini pack

Free

Stop Getting 429'd: Call Other People's APIs Without Hitting Limits

Your app calls someone else's API, it works in testing, then real users show up and the logs say 429 Too Many Requests. These 9 free prompts help you find every outside call, read what the 429 actually says, send fewer requests, wait and retry the polite way, show a friendly message, and get a warning before you reach the limit.

Find every outside API call your app makes, read what the 429 is telling you, send fewer requests, wait and retry the polite way, and see the limit coming before your users do.

9 prompts in 4 sections. Replace everything in [BRACKETS IN CAPS], then copy and paste into your AI tool.

Download the free PDF

PDF, 16 pages

Written for use with

  • Claude Code, Cursor's Agent, Lovable and Bolt: all 9 prompts are pasted into any of the four, opened in the reader's project. Prompts 1.1, 1.2 and 4.1 only read and report (1.2 offers one log line and waits for an OK; 4.1 writes only API-LIMITS.md); 2.1, 2.2, 2.3, 3.1, 3.2 and 4.2 show a plan and wait for a "go". The core rule: the cheapest request is the one you never send, and when the provider says wait, you wait.
  • HTTP standards: 429 meaning and optional Retry-After (MDN, RFC 6585), Retry-After as seconds or an HTTP date (RFC 9110), and "429 responses must not be stored by a cache" (RFC 6585) were checked against MDN and the RFC Editor pages.
  • Providers: OpenAI's rate-limit guide (Retry-After as a minimum, backoff with jitter, limits on tries and total time, SDKs auto-retrying eligible 429s, quota and billing errors not fixed by retrying, slow_down on sharp traffic increases, x-ratelimit-* headers) and Anthropic's rate-limit docs (spend-cap 429 with no retry-after, ramp limits, limits shown in the Claude Console, anthropic-ratelimit-* headers) were checked on Nov 20, 2026. Lovable's AI docs (429 over the allowed rate, 402 out of credits) and React's Strict Mode page (Effects run twice in development) were checked too. No provider limit numbers are printed.
  • Not repeated here: timeouts and safe retries for every outside call point to Survive Your First Traffic Spike 4.2; caching your own pages to its 4.1; rate limits on your own routes and AI spend caps to Ship It Safe 5.1 and 5.2; moving API calls to the server to Ship It Safe 1.2; clear error messages to It Broke in Production 3.1; Lovable's built-in AI failing to Add AI Features in Lovable 4.2; the bill itself to What Will My App Cost to Run?.
  • No stats or X claims: no numbers, no X posts quoted, and no affiliate or sponsor copy.

Written for use with Claude Code, Cursor's Agent, Lovable or Bolt. Not yet tested against them.

All 9 prompts

  1. 1.1 Find Every Outside API Call
  2. 1.2 Read the 429 Before You Fix It
  3. 2.1 Save Answers I Already Have
  4. 2.2 Stop Calls That Fire for No Reason
  5. 2.3 Spread Out Big Batches
  6. 3.1 Wait and Retry the Polite Way
  7. 3.2 Show a Friendly "Try Again in a Moment"
  8. 4.1 Look Up My Real Limits
  9. 4.2 Warn Me Before I Hit the Wall

Section 1: Find What's Hitting the Limit

1.1 Find Every Outside API Call

Untested: not yet run against a model.

Use this when you're getting 429 errors and want a list of every outside API your app calls, what triggers each call, and how often it runs. It's a read-only map, so nothing changes yet.

Fill in: [WHERE I SEE THE ERRORS] (e.g. "the AI chat box on the home page", "server logs", "not sure"), [HOW MANY USERS] (e.g. "about 50 a day").

Don't change any files. I'm getting "429 Too Many Requests" errors and I want to find out why. I'm a beginner, so explain simply.

Where I see the errors: [WHERE I SEE THE ERRORS]
How many users I have: [HOW MANY USERS]

Please:
1. List every call my app makes to an outside API or service, in code and through official libraries. For each one, give the file path, which service it calls, and whether it runs in the browser or on the server.
2. For each call, tell me what triggers it: a page load, a click, typing, a timer, a background job, or a loop.
3. Estimate how many times each call runs for one visitor on one visit, and per day for the number of users above. Show your working.
4. Flag anything that looks wasteful: calls inside a loop, calls that run on every render or every keystroke, the same request sent twice, timers that poll every few seconds, or a page that calls the API once per item in a list.
5. Rank the calls from most to least likely to cause my 429s, with one plain sentence on why.
Then stop. I'll pick what to fix.

Tips to customize: For extra safety, use a mode that can't edit code: Ask mode in Cursor, plan mode in Claude Code (Shift+Tab), or Chat mode in Lovable. If the estimates look too low, open your browser's developer tools, go to the Network tab, and use the app for a minute. Count how many requests go to the outside service. The real number beats the guess.

1.2 Read the 429 Before You Fix It

Untested: not yet run against a model.

Use this when you want to know exactly which limit you hit and whether waiting will fix it. It's for reading the error message and headers, so you know whether to slow down or to fix a billing or quota problem.

Fill in: [THE SERVICE] (e.g. "OpenAI", "Claude API", "Google Maps", "Lovable's built-in AI"), [THE ERROR I SEE] (paste the full error message or log line, with any API keys removed).

Don't change any files yet. Help me understand this 429 error before we fix anything.

The service: [THE SERVICE]
The error I see:
[THE ERROR I SEE]

What I know:
- A 429 means the app sent too many requests in a given amount of time. Some services limit requests, some limit how much text (tokens) is sent, and some limit both.
- A 429 may come with a Retry-After header, which is either a number of seconds or a date and time.
- Not every 429 goes away by waiting. Some services also send a 429 when you've run out of credit, quota, or a spending limit, and retrying won't help until that's fixed.

Please:
1. Explain in plain English what this error says: which limit was hit (requests, tokens, a daily quota, a spending limit, or something else), if the error says.
2. Tell me whether waiting and retrying could fix it, or whether I need to change something in my account or billing first.
3. Find where my code handles errors from this service, and tell me whether it saves the status code, the error message and the Retry-After header anywhere I can see them later.
4. If it doesn't, suggest one small log line that records them (never the API key or a user's private data). Show it to me and wait for my OK before adding it.
5. Tell me which page of this service's own docs explains its rate limits and errors, so I can check it myself.

Tips to customize: OpenAI's rate-limit guide says quota, billing and other errors that need you to act can't be fixed by retrying, and its code examples don't retry the error code insufficient_quota. Anthropic's rate-limit docs say that when an account reaches its monthly spend cap, requests return 429 with no retry-after header, and retrying fails until access resumes. Both say a sudden jump in traffic can cause 429s even while you're under your per-minute limits. Lovable's docs say its built-in AI returns 429 when requests go over the allowed rate, and 402 when the workspace runs out of credits.

Section 2: Send Fewer Requests

2.1 Save Answers I Already Have

In testing: automated checks only, see results below.

Automated test pass rate, 1 run on gemini-3.5-flash-lite, 2026-11-24
This prompt100%
Plain prompt90%

Use this when your app asks an outside API for the same thing again and again, like the same weather, the same price or the same AI summary. It's for saving answers on your server for a sensible time, without ever showing one user another user's data.

Fill in: [WHAT I ASK FOR REPEATEDLY] (e.g. "weather for the user's city", "the same product descriptions"), [HOW FRESH IT MUST BE] (e.g. "within 10 minutes", "once a day is fine").

I want my app to stop asking an outside API for answers it already has. Make a plan first and wait for my "go" before you change anything.

What I ask for repeatedly: [WHAT I ASK FOR REPEATEDLY]
How fresh it must be: [HOW FRESH IT MUST BE]

Please:
1. Find the calls that send the same request more than once, using the list from before if we made one.
2. For each one, suggest saving (caching) the answer on the server and reusing it, with how long to keep it based on how fresh it must be. Explain what the "key" for each saved answer is (what makes two requests "the same"). If many requests for the same thing can arrive at the same moment, before the first answer is saved (a rush of visitors, or two parts of one page), make them wait for the one request that's already running instead of each sending their own.
3. Never cache anything that's private to one user unless that user's ID is part of the key, so no one ever sees someone else's data. If you're not sure whether something is private, ask me.
4. Never save an error as an answer. Don't cache 429s, 5xx errors, timeouts or empty results, so a short failure doesn't get stuck. Check each answer before saving it: save it only if the call succeeded and the data you need is really there. A failure can come back wrapped in something that isn't empty (like an object holding an error status), so "not empty" isn't the same as "worked".
5. Tell me where you'd keep the saved answers (in memory, in my database, or in a key-value store) and the trade-offs for my host. If memory might not last between requests or be shared between copies of my server, say so.
6. After I say "go", make one change at a time and tell me how to check that the saved answer is being reused.

Tips to customize: The standard that defines 429 (RFC 6585) says responses with a 429 status must not be stored by a cache, which is why step 4 matters. Read the outside service's terms too: some say how long you may keep their data. Caching AI answers only makes sense when the same input should give the same answer for everyone, like a summary of a public page. For caching your own pages, our Survive Your First Traffic Spike pack (Prompt 4.1) covers doing it without leaking data.

2.2 Stop Calls That Fire for No Reason

Untested: not yet run against a model.

Use this when your app calls an API on every page load, every click, or every key someone types. It's for making calls happen only when they're really needed.

Fill in: [THE CALL] (e.g. "address search as you type", "the AI tip that loads on the dashboard"), [WHEN IT SHOULD RUN] (e.g. "only after the user stops typing", "only when they press Generate").

One of my outside API calls runs far more often than it needs to. Show me a plan first and wait for my "go".

The call: [THE CALL]
When it should run: [WHEN IT SHOULD RUN]

Please check for these and tell me which ones apply:
1. It runs on every key someone types. If so, wait until they stop typing for a short moment (debounce) and skip very short searches.
2. It runs on every page load or every time the screen redraws. If so, explain why, and move it behind a button or run it once and reuse the result.
3. The same request can be sent twice at the same time (a double click, two parts of the page asking for the same thing, or code that runs twice). If so, send one request and share the result.
4. It runs on a timer every few seconds. If so, suggest a longer gap or stopping the timer when the tab is hidden.
5. It runs once per item in a list. If so, check whether the service lets me ask for several items in one request, and point me to that part of its docs.
6. It's called straight from the browser. If so, tell me whether my API key is exposed and whether the call should move to my server.
After I say "go", fix one thing at a time and tell me how to count the requests before and after, using the browser's Network tab.

Tips to customize: While you're developing, some frameworks deliberately run certain code twice to catch bugs, so you may see double calls that won't happen on the live site. For example, React's Strict Mode runs Effects an extra time, in development only. Ask the agent whether that applies to your setup before you "fix" it. If a key turns up in the browser, our Ship It Safe pack (Prompt 1.2) covers moving API calls to the server.

2.3 Spread Out Big Batches

In testing: automated checks only, see results below.

Automated test pass rate, 1 run on gemini-3.5-flash-lite, 2026-11-26
This prompt100%
Plain prompt80%

Use this when your app sends lots of requests at once, like summarizing 200 rows, importing a list, or a scheduled job that processes everything. It's for sending them at a steady pace instead of all in the same second.

Fill in: [THE BATCH JOB] (e.g. "the button that writes AI descriptions for every product"), [HOW MANY ITEMS] (e.g. "about 300"), [HOW LONG IT CAN TAKE] (e.g. "a few minutes is fine", "overnight is fine").

My app sends a big batch of requests to an outside API all at once and gets 429 errors. Help me spread them out. Show me a plan first and wait for my "go".

The batch job: [THE BATCH JOB]
How many items: [HOW MANY ITEMS]
How long it can take: [HOW LONG IT CAN TAKE]

Please:
1. Show me how the batch runs now: does it fire every request at the same moment, or one after another?
2. Limit how many requests run at the same time to a small number, and add a short pause between them, so the pace stays steady.
3. Remember which items are done, so if the job stops halfway it can carry on from where it stopped instead of starting over and repeating requests.
4. If a 429 comes back, slow the whole batch down, not just that one item.
5. If it can take longer than a user will wait on the page, suggest moving it to a background job or a scheduled job that my stack supports, and show progress in the app.
6. Check whether the service offers a batch or bulk option for jobs like this, and point me to the docs page. Don't use it until I've read it.

Tips to customize: Start with a low number of requests at a time and raise it slowly while you watch for 429s. OpenAI's and Anthropic's rate-limit docs both warn that a sharp jump in traffic can trigger 429s even under your normal limits, so a steady pace helps. If your batch writes or charges anything, make sure a retry can't do it twice.

Section 3: When a 429 Happens Anyway

3.1 Wait and Retry the Polite Way

In testing: automated checks only, see results below.

Automated test pass rate, 1 run on gemini-3.5-flash-lite, 2026-11-30
This prompt100%
Plain prompt90%

Use this when your code retries instantly after a 429, or never retries at all. It's for waiting as long as the provider asks, backing off a bit more each time, and giving up after a few tries.

Fill in: [THE SERVICE] (e.g. "OpenAI", "a weather API"), [HOW I CALL IT] (e.g. "the official library", "plain fetch", "not sure").

When my app gets a 429 from an outside API, I want it to wait and retry politely instead of hammering the service. Show me the plan first and wait for my "go".

The service: [THE SERVICE]
How I call it: [HOW I CALL IT]

What I know:
- Retry-After can be a number of seconds or a date and time. Treat it as the minimum wait.
- Failed requests can still count toward the limit, so retrying instantly makes things worse.
- Some official libraries already retry 429s on their own.

Please:
1. Check whether the library I use already retries, and how many times. If it does, don't add a second layer of retries on top. Adjust its settings instead, or turn it off and use one retry setup only.
2. On a 429, read Retry-After if it's there (both the seconds form and the date form) and wait at least that long.
3. If there's no Retry-After, wait a short time, then double the wait after each try, and add a small random extra delay (jitter) so many users don't all retry at the same moment.
4. Stop after a few tries. Also set a total time limit for the whole thing, counted from the first try, so a user is never left waiting for minutes: if the next wait would go past it (even a long Retry-After), stop right away and show a clear message instead of waiting. Never try again earlier than Retry-After says.
5. Don't retry a 429 that says I'm out of credit, quota or spending limit. Show a clear error and log it instead.
6. Only retry requests that are safe to repeat. Never retry anything that charges money, sends a message or creates something, unless the service supports a way to make repeats safe, like an idempotency key. If it does, make the key once for that action (for example from the order or item ID) and send the same key on every try. A new key on each try doesn't protect anything.
7. Keep the code simple and the edits small. Before you answer, re-read every file you changed from top to bottom for stray characters or syntax slips (extra brackets, missing commas, half-finished lines), and check that each file still loads without errors.
8. Show me the finished code and explain each part in one plain sentence.

Tips to customize: OpenAI's rate-limit guide recommends following Retry-After when it's present, adding a small random delay, and falling back to exponential backoff with jitter when it's missing, with a limit on both the number of tries and the total time. It also says each official OpenAI library retries some 429s automatically, so check your installed version's settings. For timeouts and safe retries on every outside call, not just 429s, use our Survive Your First Traffic Spike pack (Prompt 4.2).

3.2 Show a Friendly "Try Again in a Moment"

In testing: automated checks only, see results below.

Automated test pass rate, 1 run on gemini-3.5-flash-lite, 2026-11-27
This prompt100%
Plain prompt100%

Use this when your users see a crash, a blank screen or a raw error code when the API limit hits. It's for a calm, clear message that keeps what they typed and tells them when to try again.

Fill in: [THE FEATURE] (e.g. "the AI writing helper", "the map on the store page"), [WHAT USERS SEE NOW] (e.g. "a white screen", "Error 429", "a spinner that never stops").

When an outside API returns a 429, my users see something broken. Replace it with a friendly message. Show me the plan first and wait for my "go".

The feature: [THE FEATURE]
What users see now: [WHAT USERS SEE NOW]

Please:
1. Make my server sort the outside service's failures into three kinds and tell the page which one: "too many requests" (a short wait), "out of credit or quota" (won't fix itself), and anything else (another error, a timeout, a dropped connection). Every kind gets a plain message instead of a crash, and none passes on the raw error, status codes or any API details.
2. Show a short, friendly message, like "This is busy right now. Please try again in a moment."
3. If we know how long to wait (from Retry-After), show it. While we're waiting, don't send more requests to the service from anyone (the limit is usually shared by the whole app, and refused requests still count): show the message again instead, and turn the button back on once the wait is over. If we don't know how long, take a short break anyway so people clicking again and again don't keep hitting it.
4. Keep anything the user typed or chose, so they don't lose their work.
5. If the problem is that we're out of credit or quota (not a short wait), show a different message, like "This feature is unavailable right now", and log it so I find out.
6. If the rest of the page doesn't need this service, make sure it still loads and works.
7. Tell me how to test the message without actually hitting the limit, for example with a temporary switch that only works on my computer, never in production.

Tips to customize: Keep the message honest and short. Don't promise "it'll be back in 1 minute" unless your code really knows. If you show saved (cached) answers from Prompt 2.1, you can show the last saved answer with a small "updated a few minutes ago" note instead of an error. For error messages across your whole app, our It Broke in Production pack (Prompt 3.1) replaces silent failures with clear ones.

Section 4: Stay Under the Limit

4.1 Look Up My Real Limits

Untested: not yet run against a model.

Use this when you don't know what your rate limits actually are, or you're guessing from an old blog post. It's for writing down your real limits from the provider's own docs and account page, with the date you checked.

Fill in: [MY SERVICES] (e.g. "OpenAI, Google Maps, a weather API"), [MY PLAN OR TIER] (e.g. "free plan", "not sure").

Don't change any app code. Help me write down the real rate limits for the outside services my app uses.

My services: [MY SERVICES]
My plan or tier: [MY PLAN OR TIER]

Please:
1. For each service, find the official docs page about rate limits, and tell me where in my account dashboard I can see my own current limits. If you can't open the page, tell me so, and give me the link to check myself. Don't guess any numbers.
2. Explain what each service limits (requests, tokens or text, per minute, per day, per month, per API key, per project or per account) and whether limits change with my plan or usage.
3. Tell me which headers, if any, each service sends back to show how much I have left and when it resets.
4. Compare the limits with how often my app calls each service (from my list of calls, if we made one), and tell me which one I'm closest to hitting.
5. Create a file called API-LIMITS.md with a short table: service, what's limited, my limit, where I found it, and the date checked. Leave a blank for any number I need to fill in from my dashboard.

Tips to customize: Limits change, so check the provider's docs and your dashboard again before a launch, and update the date in API-LIMITS.md. Some providers show your exact limits only in your account, not in public docs. For example, Anthropic's docs say your current limits are on the Rate limits page in the Claude Console. If your limit is genuinely too low after you've cut wasted calls, that dashboard is usually where you ask for more.

4.2 Warn Me Before I Hit the Wall

Untested: not yet run against a model.

Use this when you want to find out you're getting close to a limit before your users start seeing errors. It's for logging how much of each limit is left, counting 429s, and making sure one heavy user can't use up everyone's share.

Fill in: [THE SERVICE] (e.g. "OpenAI"), [HOW I WANT TO BE TOLD] (e.g. "a line in my logs I can search", "an email", "a note on my admin page").

I want a warning before my app hits an outside API's rate limit. Show me the plan first and wait for my "go".

The service: [THE SERVICE]
How I want to be told: [HOW I WANT TO BE TOLD]

Please:
1. Check which rate-limit headers this service sends back (for example, how many requests or tokens are left and when the limit resets), using its official docs. If it doesn't send any, tell me.
2. Log those numbers in a simple way when they get low, without logging API keys or users' private data.
3. Count how many 429s happen each day, and warn me in the way I chose when it goes above a small number.
4. Check whether one user can use up the whole limit for everyone (for example, by clicking Generate over and over). If so, add a small per-user limit on my side for that feature, with a friendly message.
5. Keep it simple. Don't add a paid monitoring service unless I ask.
6. Tell me how to test the warning without actually going over the limit.

Tips to customize: Header names differ by provider. OpenAI's docs list headers like x-ratelimit-remaining-requests and x-ratelimit-remaining-tokens, and Anthropic's list headers like anthropic-ratelimit-requests-remaining. For other services, check their docs. For a full per-user rate limit on your own routes, use our Ship It Safe pack (Prompt 5.1), and for spending caps, Prompt 5.2.

Get new free packs in your inbox

Optional. Every prompt here is free, and you don't need to sign up to use any of them. We email when we add new free packs. Unsubscribe anytime.

More free packs: Vibe Code Starter Pack Ship It Safe Fix My Bugs Ship It Live Make It Pretty Get Paid Signup Emails That Actually Arrive Lovable Credit Saver One Rules File for Every AI Tool Make Your Claude Code Limit Last Graduate From Lovable First App Store Submission Survive Your First Traffic Spike Get Found on Google First 100 Users Two AIs, One Project It Broke in Production Hit the Slop Wall? Refactor Without Breaking Everything Vibe Code From Your Phone AI Reverse Engineering Run Several AI Agents at Once Claude Code Guardrails Let AI Review Your AI's Code Make Your Cursor Usage Last Privacy Policy and Terms That Match Your App Install Skills, Plugins and MCP Servers Without Getting Burned Say What You Mean Prompt Injection: Don't Let a Web Page or a Strange File Hijack Your Agent Hit Your Limit Mid-Task? Switch AI Tools Without Losing Your Place Don't Let the AI Delete Your Data: Safe Database Changes Make the AI Teach You While It Builds Bolt Token Saver v0 to Production Claude Code Subagents and Skills for Beginners Logins, Tokens and JWTs in Plain English Put Your Web App on Their Phone Add AI Features in Lovable Is Anyone Using It? Simple Analytics for Vibe Coders Use the Cheap Model for the Easy Stuff: Claude Code Model Mixing Ship Updates Without Breaking the Live App: Preview Links, Checks and One-Click Rollback Try to Break It: Stress-Test Your App Before Strangers Do Claude Code Memory: Stop It Forgetting Your Decisions Fix Your Lovable Security Warnings Without Breaking the Live App What Will My App Cost to Run? A Monthly Bill You Can Predict Leave Claude Code Running Without It Getting Stuck Put Your Lovable App on Autopilot: Automations That Check and Report for You Spec and Tests First: Tell the Agent When It's Done Only Change What I Asked: Stop the AI Rewriting Code You Didn't Mention Use the Current Version: Stop the AI Writing Outdated Library Code What Did My Agent Actually Do? Read Your Claude Code Session History Your First Google Play Launch: Get Through the 12-Tester, 14-Day Closed Test Will Anyone Want It? Check Your App Idea Before You Build Claude Code Code Mode: Try It Without Breaking Your Safety Checks Coding With Gemini 4 Neon: Make It Double-Check Its Own Work Understand the App You Already Built: A Guided Tour of Your Own Code Your Guess Might Be Wrong: Make the AI Find the Real Cause Before It Fixes Replit Missions: Give Agents a Goal, a Budget and Approval Rules Make Your Antigravity Quota Last: Pick the Right Gemini Model and Check /usage Turn a Claude Artifact Into a Desktop App, Without Giving It Too Much Access Built It for Work? Make Sure Only Your Team Can Open It Plan Before It Builds: Use GitHub Spec Kit So the Agent Builds the Right Thing Saves That Stick: Fix Data That Disappears Rebuilt Your Site With AI? Make Sure Google Can Still See Every Page Subscriptions and Paywalls: Gate Features by Plan Your AI App Builder Is Shutting Down: Get Your Code, Data and Domain Out Your Own Android App From a Prompt: Build It in Google AI Studio and Put It on Your Phone Backups You Can Actually Restore: Check, Copy and Test Your Supabase Data Accessibility Pass Before You Ship: Make Your App Work With a Keyboard, a Screen Reader and Zoom Update Your Dependencies Without Breaking the App: npm Updates, Audits, Major Upgrades and Dependabot