Keep your AI bill predictable
Give every user a budget. Charge for more.
Your users pay you a subscription. Your provider charges you per token. Nothing in between stops one person — or one script — from spending more than the whole app makes. Gate/AI puts a budget on every device, lets paying tiers have more, and shows you where the money went.
GamePlan AI
Coach
Resets Sep 1
The problem
A mobile AI bill doesn't grow. It spikes.
Most days look the same. Then one device — a power user with a shortcut on a loop, a bot farm on rooted phones, a build that leaked — does a month of traffic before lunch. Provider dashboards tell you afterwards. A budget in front of the key stops it at request 201.
AI Token Cost
Estimated spend based on list prices
Top spenders
Cost by user, last 14 days
- user_a8f2…$11.20
- user_c31d…$2.90
- user_9e07…$2.40
- user_b4c9…$1.80
Budgets
Four numbers, not a spreadsheet.
A device budget is one reset period, a request cap, a token cap, and an optional daily burst limit. Pick the period that matches how you sell — calendar month, rolling 30 days, or each user's own billing cycle — set the numbers, and the panel restates the policy in English before you save.
- Requests cap how often; tokens cap how much. Use either or both.
- The daily cap stops one device spending a month's allowance in an afternoon.
- Limits apply on the next request. Rejected requests don't consume budget and don't reach the provider.
Quotas
Per-device limits
1Reset period
Calendar month
Resets on the 1st
Rolling 30 days
Last 30 days
Billing cycle
Their renewal day
2Budget per device
3Tier overrides
This policy, in English
Each device gets 200 requests and 100,000 tokens per calendar month; pro users get 5,000 requests, unlimited tokens.
GamePlan AI
Coach
Resets Sep 1
You've used this month's 200 free messages
Pro gets 5,000 a month, and resets on your billing day.
or wait until Sep 1
Tiers
The cap is your paywall.
Set a modest default, then tell the gate which users have paid. A free user who hits the line gets a 429 that says exactly which window closed and when it reopens — which is the best moment you'll ever get to show the upgrade screen. A pro user never sees it.
| Policy | Requests / month | Tokens / month |
|---|---|---|
| Default | 200 | 100,000 |
| pro | 5,000 | Unlimited |
| team | Same as default | 2,000,000 |
// after a purchase client.userTier = "pro" client.quotaAnchorDay = renewalDay // budgets reset on their billing day // when a budget is hit if let limit = error.rateLimitInfo { showUpgrade(resetsAt: limit.resetsAt) }
The tempting shortcut
BYOK controls your costs by killing your conversion.
"Bring your own key" looks free: users pay the provider directly, and your bill problem disappears. But it disappears because the users do. You're asking someone to create a developer account, enable billing, and paste a credential into your app before they've seen the feature work once.
- It moves the paywall to the wrong side. Your best upgrade moment is a user hitting a generous free cap. BYOK users already pay someone — the provider — so there's nothing left to sell them.
- Their problems become your reviews. A rate-limited key, an expired card, a deprecated model — it all reads as "app is broken," and you can't see any of it to help.
- You've made users into API administrators. Quotas, models, key rotation — infrastructure decisions, handed to the least equipped person in the loop.
Per-device budgets get you the same cost ceiling with the opposite funnel: users see the feature in the first minute, and the cap — not a key form — is where they meet your pricing.
More on this: BYOK is user-hostile and the hidden costs of BYOK.
First-run funnel
With BYOK
- Download the app
- Create a provider account
- Add a payment card
- Generate & paste an API key
- First AI result
Every step before value sheds users. Illustrative, but you've felt this funnel yourself.
With a device budget
- Download the app
- First AI result
- Hit the free cap → see pricing
The only people who meet your pricing are the ones already getting value.
Two more ceilings
Budgets for people. Ceilings for everything else.
Per-device budgets handle users. Two gate-wide limits handle the cases a budget can't: a scripted client creating devices, or a bug in your own app.
Gate rate limit
A hard cap on requests per minute across every device. Whatever goes wrong, your bill can't exceed the number you chose.
Monthly devices
Your plan's device allowance is itself a ceiling: a bot farm minting installs runs into it long before it runs into your provider.
Questions developers ask first
- What counts as a "device"?
- An install of your app that has attested. Budgets are enforced per device, which is the closest thing to a user you can trust without a login. If your app does have accounts, send an opaque user identifier and you'll see spend per user in analytics too.
- What happens at the limit?
- The request that crosses the line still goes through; the next one gets a 429 with a body that says which window closed and when it reopens. The SDK hands you that as a typed value, so showing an upgrade sheet is a few lines.
- Can paying users get more?
- Yes. Your app sends the user's tier after a purchase, and the gate applies that tier's overrides: a bigger budget, or none at all. Tiers can also reset on each user's own renewal day instead of the 1st.
- Is cost exact?
- It's derived from token counts and public list prices shortly after each request, so treat it as a budgeting number. Caching and context-size features on the provider side mean it can't be to the cent.
Know the most any user can cost you. Before you ship.
Budgets and tiers are on the Pro plan. Start free and add them when you have users to protect.