How I split a free AI writing quota so one tool couldn't eat the budget
A free AI writing tool has a simple-looking promise: let people try it without a credit card. The hard part is not the copy on the pricing page. It is making sure a generous free tier cannot be farmed into an unbounded m
A free AI writing tool has a simple-looking promise: let people try it without a credit card. The hard part is not the copy on the pricing page. It is making sure a generous free tier cannot be farmed into an unbounded model bill, and that trying a second tool does not feel like a punishment.
I shipped an AI fanfic generator with a free short scene and credit-paid full chapters. The first version of the free allowance was one shared daily counter. It looked clean. It broke as soon as the product had more than one tool.
One bucket is easy to explain and easy to regret
The live free rules are still simple at the edge:
- Guests get 1 short scene a day, no sign-up and no card.
- A free account gets 3 scenes a day.
- Credits buy a full chapter on a stronger model, and those chapters can continue a story.
That is what a visitor needs to know. Behind it, the first implementation used one shared daily counter across every story tool. Failed requests did not count. Soft validation errors did not count. The counter reset on a clear day boundary.
That rule is learnable. It also has a product cost: someone who tries the quote generator, then the prompt generator, then the main scene tool can burn the whole daily allowance before they write a scene. Separate counters for every surface have the opposite problem. A script can farm each tool in turn and the model budget still walks out the door.
I needed both: room to explore, and a hard ceiling.
Four pools, plus a site-wide cap
The fix was to split free usage into four pools β scenes, reader-insert stories, quote sets, and writing prompts β and to keep a second, site-wide cap on top of them.
Using one pool does not spend another. A guest still gets 1 use a day in each pool. A free account gets 3 to 5, depending on the tool. People who have already bought credits get a much higher daily allowance on the cheap quote and prompt tools (50 sets a day), which are short and inexpensive compared with a full scene.
Each pool also has a site-wide daily cap. When one pool is full, the product points the visitor at a tool that still has room instead of failing closed across the whole site. The model budget is bounded even if one surface is being hammered. Explorers are not locked out of every other tool because they already used today's scene.
The admin view tracks today's spend against the cap, and every generation gets a plain-English reason when it failed or was blocked. That matters more than a clever algorithm: when a limit fires, you can see which pool, which rule, and whether it was a real generation or a blocked request.
Counting guests without trusting the client
Signed-in usage is counted on the account. Guests are harder, because there is no account and the browser is not a source of truth.
Guests are counted by a salted hash of the IP plus a random cookie. The IP is read only from the trusted proxy, so a client-supplied header cannot spoof it. Cloudflare Turnstile sits in front of the generate action, which cuts a lot of trivial scripted traffic before a model is called at all. Failed requests still do not increment the counter: a moderation block or a provider error should not spend someone's only free try.
None of this is perfect. A motivated person with many residential IPs can still get more than one guest try. The point of the guest limit is not to win against a determined attacker. It is to make casual farming expensive enough that the cheaper model, the per-pool cap, and the site-wide daily cap can do the rest.
What I would keep next time
If I were starting again, I would split the pools on day one, the moment a second tool was more than a sketch. A single shared counter is fine for a one-page demo. It becomes a product bug the day you add an adjacent generator and still share a budget.
I would also keep the two-layer limit: a per-person (or per-guest) allowance that feels fair, and a site-wide cap that protects the bill. The first layer is UX. The second layer is how you sleep at night when the tool is free and the model is not.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.