Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
GlossaryNovember 22, 20263 min read

What is rate limiting?

One script hammering your login form or your AI endpoint can cost money or lock out real users. Rate limits stop that, and the right numbers depend on what each action costs.

Startbase Team
Editorial ink illustration of a subway turnstile with an hourglass on top, the hourglass sand in ember orange

Key takeaways

  • A rate limit caps requests per user, IP or key within a window, and answers the excess with HTTP 429 Too Many Requests.
  • Set limits by the cost of the action: tight on logins, password resets and AI calls; generous on ordinary reads.
  • Enforce limits on the server or in the backend function, where they cannot be skipped, and also cap spending at the provider.

Servers use rate limiting to cap how many requests one user, IP address or API key can make in a set time, such as 5 login attempts per 15 minutes or 60 requests per minute. Requests over the cap are refused, usually with HTTP status 429 Too Many Requests, until the window resets. It protects your app from abuse, runaway bugs and surprise bills.

An everyday example: the ATM PIN

Enter the wrong PIN three times and the ATM keeps your card. Without that rule, a thief could try all 10,000 four-digit PINs in an afternoon. A login form without a rate limit is that ATM: a script can try thousands of common passwords against an email address in minutes. The same logic applies to anything that costs you per use. An AI feature with no cap is one forum post away from a bill you did not plan for.

Sensible starting limits

There is no universal number; match the limit to what the action costs you and how often a real person does it. These are reasonable starting values to tune from real usage:

  • Login attempts: 5 per 15 minutes per account, plus a looser cap per IP.
  • Password reset and magic link emails: 3 per hour per address. Each one costs money and can be used to spam someone.
  • AI generation: 10 to 30 per hour per user on a free tier, higher for paying users.
  • Contact or feedback forms: 5 per hour per IP.
  • Ordinary reads (feeds, lists): 60 to 120 per minute per user. Real people rarely come close.
  • Game score submissions: one per finished round, with a minimum round length, so a script cannot post 10,000 scores.

Two common ways to count: a fixed window (reset at the top of each minute; simple but allows bursts at the boundary) and a sliding window or token bucket (smoother, allows short bursts within an average). For most apps either is fine.

Why it matters when building with Startbase

A limit only works where the user cannot skip it. Disabling a button for ten seconds is good feedback, but anyone can call your backend directly. In a Startbase app, the place to enforce limits is the edge function that does the expensive work, the same server-side boundary the security practices page recommends for payments, approvals and third-party API calls. Ask for the limit in the same prompt as the feature, so the counter and the friendly error arrive together.

Add rate limits to the AI recipe generator. Free users get 15 generations per rolling hour, paid users 100. Count them in the database per user, enforce it in the edge function before calling the AI service, return a 429 with the minutes until reset, and show a friendly message with that time in the app.

Pair app limits with a spending cap or budget alert in each paid provider's dashboard as a backstop. For the cost side, see how to add AI features to your app; for related protections, the app security checklist.

Common confusions

  • Rate limiting is not authentication. It slows attackers down; it does not decide who is allowed in.
  • Hitting a provider's limit is different from setting your own. When an external API returns 429, your app should wait and retry with growing delays, not retry instantly in a loop.
  • IP limits can catch innocent users. A school or office can share one IP, so combine IP and account limits for signed-in actions.

Frequently asked questions

What does a 429 error mean?

Too Many Requests: the server is limiting you. Well-behaved servers include a Retry-After header saying how many seconds to wait before trying again.

Will rate limiting stop a DDoS attack?

Application limits help with small floods and scripted abuse. Large distributed attacks are absorbed further out, at the hosting network or CDN, before requests reach your app.

On this page

  • An everyday example: the ATM PIN
  • Sensible starting limits
  • Why it matters when building with Startbase
  • Common confusions

Keep reading

More in Glossary
Editorial ink illustration of a hand-cranked music box drum plucking a metal comb, the crank handle in ember orange
GlossaryNovember 22, 2026

What is a game loop?

Every real-time game runs one repeating cycle: read input, update the world, draw it. Here is what that cycle looks like and why it decides how your game feels.

3 min read
Editorial ink illustration of a brass stopwatch beside a small wind-up toy car, the second hand in ember orange
GlossaryNovember 22, 2026

What is delta time?

Delta time is the number that keeps your game the same speed on every screen. Here is how to use it, where it breaks, and how to spot a game that forgot it.

3 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.