Free tier
Grant a small monthly budget so free users can try the AI features without an open tap into your provider bill.
The cleanest per-user cap is credits. Each AI tool has a credit price, each customer holds a balance, and a call is refused when they cannot cover it. So a per-user credit budget is your rate limit. Access gates decide who can call at all, and built-in safe limits stop abuse across the whole app.
Instead of counting requests per minute, cap the resource itself. Price each AI tool in credits, and every call spends that many from the caller's balance. When the balance runs out, the next call is refused until they top up. There is no per-user counter for you to build or store: the balance is the limit.
const { balance, reserved, expiring } = await g.credits.balance();
// A tool call is refused when the balance cannot cover its price:
// "Deep Research costs 20 credits. You have 7."A per-user limit is just how many credits that user holds. Grant a starting balance on sign-up, top users up on a subscription cycle, or sell packs for pay-as-you-go. Mixing them gives you a free tier with a small monthly budget and paid tiers with more.
Grant a small monthly budget so free users can try the AI features without an open tap into your provider bill.
A subscription tops the user up each cycle; packs add more on demand. Packs never expire, so unused credits carry over unless you design otherwise.
Credits cap how much; access gates decide who. Require an entitlement on a tool and only customers who hold it can run it, regardless of balance. That keeps an expensive model behind a paid plan while a cheaper one stays open to everyone.
Separate from your pricing, Gemmein applies safe limits for abuse prevention. They scale with the app's active people, they are never billed, and every app starts with enough headroom that a small app is never refused. You do not set them up; they are there to stop floods, not to shape your product.
Building with Cursor, Claude, Bolt, or Lovable? Paste this so your agent caps usage with credits instead of hand-rolling counters.
Read https://docs.gemmein.com/llms.txt and https://docs.gemmein.com/ai. I want to rate-limit AI usage per user. Show me how to price an AI tool in credits so each call spends from the caller's balance, grant each user a per-plan credit budget, gate an expensive tool behind an entitlement, and read the caller's balance. Explain how the built-in safe limits handle abuse.
npx gemmein devRead the getting-started guide Price the AI tool in credits and give each user a fixed balance. A call is refused when the caller cannot cover its price, so no single user can spend past the credits they hold.
Yes. Grant credits on a plan or a pack. A subscription can top a user up each cycle, and packs never expire, so unused credits carry over unless you design otherwise.
Gemmein has built-in safe limits for abuse prevention. They scale with the app's active people, are never billed, and every app starts with enough headroom that a small app is never refused.
Yes. Spend credits from your own server for any action you want to meter, not just AI tool calls.
How to charge credits for AI features · Store your OpenAI key server-side · AI tools on the product page · AI docs
Point your coding agent at docs.gemmein.com/llms.txt and ask it to confirm the fit before it builds.