Back to Blog

How to set a hard spending cap for free users in an AI app

Set a daily budget for free users, add a circuit breaker and keep paying customers online. Plus the part of your model bill a cap can't fix.

For four months you've told your investors gross margin is the best news you have, and slide 6 of the update going out Tuesday morning was going to say so again. It's Sunday night when you paste in October's model bill, and the margin cell changes to a number you read twice.

These figures are illustrative, so replace them with yours. Your AI app has 280 customers on a $50 plan.

SeptemberOctober
Revenue$14,000$14,000
Model bill$4,900$11,200
Margin after model costs65%20%

You go looking for the extra $6,300. It's 2,100 free accounts from the last few weeks, each of which spent all 500 of its signup credits and never came back. A credit costs you $0.006, so one account costs $3 (500 × $0.006), and 2,100 × $3 = $6,300.

Your provider charged that to your card on the 1st, and only three of those accounts upgraded. You could zero all 2,100 balances tonight and it wouldn't return a cent. Those requests ran weeks ago, and a farmed credit is cash the moment it's used.

Then you remember the 27th. You'd set a $9,000 monthly limit at your provider, and at 3:52 p.m. it did what it's meant to do, to everyone. Every request from your app failed for 47 minutes, until you raised the limit from your phone in a parked car. Eleven paying customers wrote in. You refunded six of them (6 × $50 = $300), and two have cancelled since.

So October cost you $6,600 ($6,300 + $300). In return you got three upgrades and two cancellations, which nets out to one $50 customer. Earning back $6,600 at $50 a month takes 132 months, or 11 years.

Last quarter's slide said 14 months of runway: $168,000 in the bank and $12,000 a month going out. If October repeats, $18,600 goes out each month ($12,000 + $6,600), and $168,000 ÷ $18,600 is about 9 months. That's nearly five months gone, and you found out from a spreadsheet on a Sunday.

By 10:30 you have a decision to make before Tuesday. You can send the real number to people who've read four months of good ones. Or you can shut down the free plan, which brought in most of those 280 customers. Whichever you pick, November can't look like this, so you open a new tab and type spending cap free users AI.

That scenario is invented. This next part happened:

From our early beta

Fake users drained one team's shared model provider quota. Their paying customers couldn't use the product until the team raised its budget to cover the abuse.

When fake users come in through a free benefit, that's the capacity cost of repeat claims. Everyone draws on one quota, so the people paying you lose the product too.

Why one model provider limit can't protect free and paid at once

A free credit costs nothing to grant and real money to use. Revenue arrives once a month while cost arrives with every request, so someone farming credits can spend your money weeks before anyone pays you.

The obvious fix is the limit you already have at your provider. It covers your whole app and can't tell a free request from a paid one. At $9,000 it saved the bank and took the product down, and if you raise it, the bank's exposed again. You need a limit only free traffic can reach, and you'll have to build that yourself.

How to set a spending cap for free users

Set a daily budget from revenue. Last month's bill is the wrong place to start if last month was the bad one.

daily free budget=monthly revenue×free share30\text{daily free budget} = \frac{\text{monthly revenue} \times \text{free share}}{30}

In the scenario, paying customers cost $3,800 in September and real free users cost $1,100, which is close to 8% of revenue. $14,000 × 8% ÷ 30 is about $37 a day. Over October's 31 days, free spend would stop at $1,147 instead of $7,400. The model bill becomes $4,947 ($3,800 + $1,147) and slide 6 reads about 65% again. Start by working out what a free user costs you and how many credits to give.

Give free traffic its own provider key. Use a separate key or project with its own limit as a backstop. Read what that setting really does, because some budget settings only send an alert and keep charging. If rate limits apply across your whole provider account, keep free traffic well under the ceiling.

Reserve the money before each call. If you read the balance and then call the model, 200 requests landing together all see the same balance and all go through. Set a maximum output on every free call, so you know the most it can cost, and take that amount in one atomic update.

free_budget.sql
-- Before the call. No row back means refuse the request.
update free_budget
set reserved_usd = reserved_usd + :max_cost
where budget_day = :budget_day
  and spent_usd + reserved_usd + :max_cost <= limit_usd
returning budget_day;

-- After the call. Swap the reservation for the real cost.
update free_budget
set reserved_usd = reserved_usd - :max_cost,
    spent_usd = spent_usd + :actual_cost
where budget_day = :budget_day;

If a server dies between the two updates, its reservation stays held, so clear old ones on a schedule.

Here's a free request meeting that cap:

[Budget gone]alt[Budget left]Asks for a generationReserve the maximum costReservedSends the requestResult and real costSettle the real costShows the resultRefusedFree use is back tomorrowFree userYour serverBudget tableModel providerFree userYour serverBudget tableModel provider
[Budget gone]alt[Budget left]Asksfor agenerationReservethemaximumcostReservedSends the requestResult and real costSettlethe realcostShowstheresultRefusedFreeuse isbacktomorrowFreeuserYourserverBudgettableModelproviderFreeuserYourserverBudgettableModelprovider

How to add a budget circuit breaker

A breaker warns you before the money runs out and keeps the failure away from paying customers.

Trip in two stages. In the last 20% of the day's budget, move free requests to a smaller model and alert your phone. At zero, stop free requests.

Release the budget by the hour. $37 ÷ 24 is about $1.54 an hour. Use one row per hour in the same table, and one burst can't take the whole day.

Trip on speed too. If this hour's free spend is three times the same hour last week, open the breaker early and let a person close it.

Put paying customers first. Run paid and free work on separate workers, and give free traffic a fixed share of your provider's rate limit. Then open the breaker on purpose, sign in to a paid account and confirm everything still works.

Write the message people will see. Never show a raw provider error. Try: "Free generations are used up for today. They'll be back at midnight UTC. Upgrade any time to keep going."

More than 20%Last 20%NoneFree request arrivesHow much of today'sfree budget is left?Serve it normallyUse a smaller modeland alert your phoneBreaker opensFree requests waitfor the next resetPaid traffic carries onwith its own key
More than 20%Last 20%NoneFree request arrivesHow much of today'sfree budget is left?Serve it normallyUse a smaller modeland alert your phoneBreaker opensFree requests waitfor the next resetPaid traffic carries onwith its own key

What a spending cap doesn't solve

A cap sets how much you can lose. Who gets the money is still first come, first served.

October's free demand was $7,400 over 31 days, or about $239 a day. If that arrives evenly, $37 covers 15.5% of it (37 ÷ 239), so a budget that resets at midnight is gone by about 3:45 a.m. Farmed accounts made up 85% of that spend ($6,300 of $7,400), so roughly $31.50 of each day's $37 still goes to them. Real free users get about $5.50 a day. In September they got about $37 ($1,100 ÷ 30).

Hourly release changes when the money runs out, and it doesn't change that split. Someone whose friend recommended you opens your product at 9 a.m. and reads "used up for today" on their first visit. Your bank balance is safe and your free plan has stopped doing its job. The reset applies to the farmed accounts too, and you still can't recover what's already been spent.

Basic fixes for credit farming, and how each one breaks

So the next job is keeping farmed accounts away from the budget. Most teams try these, and each one does catch something.

Gmail ignores dots, and mail sent to name+anything@gmail.com reaches name@gmail.com, so one inbox can show up as many addresses. That's how aliases work. A second real mailbox still looks new.

Basic fixCatchesMissesWrongly blocksCost to keep working
Email verificationTypos and dead addressesAny working second inboxPeople whose code goes to spamDeliverability work
Unique emailsOne address used twiceEvery other addressAlmost nobodyVery little
Disposable-domain blocksListed throwaway servicesDomains not listed yetPrivacy forwarding usersEndless list updates
CAPTCHASimple scriptsAnyone signing up by handScreen reader usersFees and lost signups
Phone or card requirementCasual extra accountsAnyone with another number or cardStudents and people without a mobileText charges, fewer signups
One account per IPRepeats on one connectionEvery other networkA 12-person officeExceptions and tickets
VPN blocksListed VPN rangesAnything unlistedStaff on company VPNsAnother list to maintain
Rate limitsBursts from one sourceSlow use across many accountsReal users in a busy hourTuning per endpoint
Per-account usage capsOne account overrunningThe fresh cap on each new accountYour heaviest real usersDeciding when to cut people off
Fewer credits or shorter trialsSome cost per accountMore accounts make up the gapEvery honest userFewer people reach paying
Manual reviewWhat a person can spotCredits already spentWhoever looks odd that dayHours every month

Reviewing October's 2,100 accounts at one minute each takes 35 hours (2,100 ÷ 60), and by the time you open the first one its credits are gone. Stack the whole table and you still haven't answered what that $37 depends on: should this claim get free credits at all?

Deciding who gets your free budget

AbuseZero answers exactly that. A blocklist only knows last week's domains, an IP limit can't tell an office from one person, and an email rule ends at the address. You get multi-layer AI risk analysis that examines 140,000+ signals, detects linked claims and flags abuse that single checks miss, with signals read together, never one at a time. You also get a proprietary algorithm, with AI that checks the claim again. AbuseZero recognizes repeat devices across new accounts, even when email addresses keep changing, so creating a fresh account isn't enough to erase previous activity. Mailbox aliases and disposable domains are checked for you. It sees beyond an IP address with VPN, hosting, network reputation, Tor and proxy intelligence, and it blocks spammy bots, browser automation and malicious scripts while allowing genuine AI agents and assistants. You don't have to build your own abuse prevention system.

You make one API call before free credits go out and get a clear allow or deny, under eligibility rules you control. Your cap and breaker stay where they are, spending the day's budget on the claims you've allowed. Observe mode shows you what would be denied before anyone is blocked, and the quickstart sets up your first benefit.

Frequently asked questions

Should a spending cap block free users or slow them down?

Do both: a smaller model near the limit, then a stop at zero. Keep paid traffic out of both.

Will a spending cap stop credit farming?

No. It limits what farming can cost you each day, while farmed accounts keep sharing the budget. An AbuseZero evaluation happens before credits go out, which is a separate job. It also helps to compare daily credits and signup credits.

Is my model provider's budget limit enough?

Use it as a backstop on a key only free traffic uses. On a shared key, it can take paying customers offline too.

Get ahead of next month's model bill

Keep reading

Copying your prompt…

Copied the to your clipboard. Give it to your coding agent & it will handle the rest.