# How do I monetize an AI app when every request costs you money?

> Charge per use: sell credit packs priced above your model cost to users who pay from a funded wallet. List your AI app free in Cherry and charge day one.


The simplest way to monetize AI app usage is to charge per use. Every prompt your app answers costs you model tokens, so sell prepaid credits or a payment per generation, priced above what a request costs you, to people who can pay on their first visit. A flat subscription or ads leave the token cost of your heaviest users on you until revenue catches up.

Charging on the first visit is where [Cherry.fun](https://cherry.fun/learn/features/cherry-wallet/) helps. List your AI app there as a mini-app at [portal.cherry.fun](https://portal.cherry.fun), free and with no review queue, and it opens on iPhone, Android, the Solana Seeker and the web for people already signed in with a wallet on Solana, BNB, Base and Robinhood Chain that they fund inside Cherry. The first prompt can be a paid one, with no checkout or sign-up form to build first.

## Why does per-use pricing fit an AI app?

Your own cost is per use. Model providers charge by the token: [Anthropic's API price list](https://platform.claude.com/docs/en/about-claude/pricing) and [OpenAI's API pricing](https://developers.openai.com/api/docs/pricing) both quote prices per million tokens, with output tokens priced higher than input. Someone who generates long answers all day costs you many times what a casual visitor does. A flat monthly price hides that gap until you see what the month's tokens cost you.

| Pricing route | How it covers token costs | What you build | Who can pay on day one |
|---|---|---|---|
| Flat subscription by card | Heavy users can cost more than they pay | Card checkout, accounts, plan management | Anyone with a card who signs up |
| Metered charges ([Stripe usage-based pricing](https://docs.stripe.com/billing/subscriptions/usage-based)) | Usage you record is charged per customer; Stripe also offers [prepaid usage credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits) | A Stripe integration that records usage | Customers you charge through Stripe |
| Ads | Earnings follow views, not the length of a generation | An ad network integration | Nobody pays; you need traffic first |
| Prepaid credit packs in a Cherry mini-app | Paid before the tokens are spent | A listing in the portal, the Mini App SDK, a credit counter | Cherry users, signed in with a wallet they fund inside Cherry |

You can run more than one of these routes. A mini-app runs inside Cherry, which is on the App Store and Google Play; it gives you no store listing of your own and changes nothing about Apple's or Google's rules for apps you publish there yourself.

## Before you start

- A deployed web app on https that works on a phone-sized screen, whether you built it in Lovable, Google AI Studio, Claude Code or by hand.
- A backend that calls the model API with your key, so the key never ships to the browser.
- A Solana wallet to receive payments: mini-apps ask users to sign Solana transactions today.
- An AI coding agent working in your app's repository, such as Claude Code, Cursor or Codex.

## Step 1: Work out what one request costs you

Take a typical request and count both sides: input tokens (your system prompt, the user's text, any context you attach) and output tokens. Multiply each by your provider's per-million price. Then add anything charged on top of tokens. Anthropic, for example, charges for web search per search.

Cap the output length per request so one prompt cannot cost ten times the average. Finish this step with two numbers in cents: the typical cost of a request and the worst case you allow.

## Step 2: Package credits into packs that fit your trust tier

Turn that cost into a credit price with a margin above it, then group credits into a few packs. Mini-apps refuse recurring subscriptions and token approvals at every tier, so each pack is a one-time purchase.

Size the packs for where you launch. A new listing is Unverified, with [limits of $50 per transaction and $50 per wallet per day](https://portal.cherry.fun/docs/mini-apps/wallet.md). One identity check of the project owner makes every project they own Verified, at $1,000 per transaction and $5,000 per wallet per day. A small starter pack and a larger one under $50 cover day one.

A handful of free requests lets people see the output before they pay. Keep that number small, since each one is tokens you pay for. Every pack then needs a price, a credit count and a label of 80 characters or fewer.

## Step 3: List your AI app in the portal, free and unreviewed

Open the listing wizard at [portal.cherry.fun](https://portal.cherry.fun). You describe the app, who runs it and where it runs, then say how it earns: Sales covers credit packs. You accept the terms with your wallet, deploy, and run the automated checks and the automated test. When they pass, publishing lists the app immediately, with no review queue. The [free listing walkthrough](https://cherry.fun/learn/features/list-a-mini-app-for-free/) covers each screen.

Cherry asks no fee on what your app sells; a voluntary tip is welcome if it does well.

Once listed, your app is in front of Cherry users in ten languages and counting. Cherry passes each person's language to your app, so translated pack labels let the same credits sell well beyond English. The wizard shows the app as listed when this step is complete.

## Step 4: Hand the integration to your AI agent

The wizard writes an [integration brief for your agent](https://portal.cherry.fun/docs/mini-apps/ai-agents.md), filled with your app's facts. Paste it into Claude Code, Cursor or Codex in your repository. It covers installing `@cherrydotfun/miniapp-sdk`, the framing header, signing users in from the launch token, verifying that token on your backend, using the wallet within your trust tier, labelling every transaction, the domain proof file and a self-check list. The whole docs set is also published as plain text at [portal.cherry.fun/llms.txt](https://portal.cherry.fun/llms.txt).

Ask the agent to run the self-check and show you the diff before you deploy. Then open the app in your private test room. It should greet you by name and show no connect-wallet button anywhere, because the automated test fails an app that shows one.

## Step 5: Sell a pack in one transaction the user approves

When someone taps a pack, your app builds a Solana transaction that pays your wallet and asks Cherry to sign it, with a label that names what they are buying. Cherry shows your app's name, the decoded amount and your label, and the user approves or declines. Their keys never leave their device, and neither your app nor Cherry can sign for them.

```ts
await cherry.wallet.signAndSendTransaction(tx, { label: 'Buy 200 image credits' });
```

Users top up inside Cherry with a card, Apple Pay, Google Pay or PayPal, or deposit from another wallet or an exchange. Your app builds no on-ramp and no card form, and the automated test warns on links to external checkouts. Test it by buying a pack from your own wallet in the test room.

## Step 6: Keep a credit balance per user on your backend

Credit the pack only after the transaction is confirmed on-chain, and store the balance against the user ID in the verified launch token. The wallet address can change when someone picks another wallet to pay with.

```ts
import { verifyLaunchToken } from '@cherrydotfun/miniapp-sdk';

const claims = await verifyLaunchToken(token, { appId: APP_ID });
const userId = claims.cherry_id ?? claims.sub; // key credit balances by this
```

Deduct credits before you call the model and return them if the call fails, so a failed request costs the user nothing. The balance should drop by the right amount after each request and survive a page reload.

## Troubleshooting

- **A purchase is refused as too large.** It is above the per-transaction limit of your tier. Offer a smaller pack, or complete the owner's identity check to raise the limit.
- **A user hits the daily limit.** The daily limit resets at 00:00 UTC; show a clear message and stop retrying.
- **The automated test fails at sign-in.** Your app must sign the user in by itself from the launch token. Show no login screen or connect button inside Cherry.
- **You want to improve your model with user prompts.** The [Mini App Policy](https://portal.cherry.fun/docs/mini-apps/policy.md) bars using user data to train or evaluate AI models. Use prompts only to answer the person who sent them.

Get Cherry on [iPhone](https://apps.apple.com/app/cherry-fun-solana-messenger/id6749173799), [Android](https://play.google.com/store/apps/details?id=fun.cherry) or [the web](https://chat.cherry.fun) to try your app the way users see it.

## Related guides

- [How to monetize a web app](https://cherry.fun/learn/guides/how-to-monetize-a-web-app/), for apps without model costs.
- [Accepting USDC payments](https://cherry.fun/learn/guides/accept-usdc-payments/), for pricing in a stablecoin.
- [Build an app with Claude Code](https://cherry.fun/learn/guides/build-app-with-claude-code/), from first prompt to a running app.
- [Selling in-app items for crypto](https://cherry.fun/learn/guides/in-app-purchases-crypto/), item by item.
- [List a mini-app for free](https://cherry.fun/learn/features/list-a-mini-app-for-free/), the full listing flow.

## FAQ

### How do AI apps make money?

Most charge for usage: a subscription with a usage cap, metered usage charges, or prepaid credits. Credits suit a new AI app because each one is paid before the tokens behind it are spent. Ads pay per view, which does not follow what a long generation costs you.

### Can I sell credits instead of a subscription in a Cherry mini-app?

Yes, and that is the model to use: mini-apps refuse recurring subscriptions at every trust tier. Sell one-time credit packs, each paid in a single Solana transaction the user approves in Cherry.

### How big can a credit pack be when I launch?

Up to $50 per transaction and $50 per wallet per day while the listing is Unverified. One identity check of the project owner makes every project they own Verified, with $1,000 per transaction and $5,000 per wallet per day.

### How do I price AI credits above my token cost?

Work out the typical and worst-case cost of one request in cents from your provider's per-million-token prices, plus per-call charges such as web search. Price a credit above the typical cost, cap output length so no request passes the worst case, and group credits into a few one-time packs.

### Can I use what people type into my AI app to train a model?

Not with data you receive through Cherry. The Mini App Policy says user data may only be used to run your app for the person who opened it, and never to train or evaluate AI models.

### What happens to a user's credits if a model call fails?

Your backend decides, so build it to refund. Deduct credits before you call the model and return them when the call fails, so a failed request costs the user nothing. Credit a purchased pack only after its transaction is confirmed on-chain, and key the balance to the user ID in the launch token.

## Sources

- [Anthropic API pricing](https://platform.claude.com/docs/en/about-claude/pricing)
- [OpenAI API pricing](https://developers.openai.com/api/docs/pricing)
- [Stripe usage-based pricing](https://docs.stripe.com/billing/subscriptions/usage-based)
- [Stripe prepaid usage credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)
- [Cherry docs: Wallet and limits](https://portal.cherry.fun/docs/mini-apps/wallet.md)
- [Cherry docs: Quickstart for mini-apps](https://portal.cherry.fun/docs/mini-apps/quickstart.md)
- [Cherry docs: Listing and publishing](https://portal.cherry.fun/docs/mini-apps/listing.md)
- [Cherry docs: Build with an AI agent](https://portal.cherry.fun/docs/mini-apps/ai-agents.md)
- [Cherry docs: Mini App Policy](https://portal.cherry.fun/docs/mini-apps/policy.md)
- [Cherry on the App Store](https://apps.apple.com/app/cherry-fun-solana-messenger/id6749173799)
- [Cherry on Google Play](https://play.google.com/store/apps/details?id=fun.cherry)

