Skip to main content
Only community owners and admins with Manage settings permission can access this tab.
Token Billing lets you sell token packages to members and charge tokens when they use AI-powered or integrated app features. You define how many tokens each action costs, set package prices, and manage API keys for SDK integrations.
Token Billing tab showing packages, triggers, and API keys sections

View usage at a glance

The dashboard shows four stats for the last 30 days:
  • Consumed: total tokens used by members
  • Granted: tokens added through purchases or subscriptions
  • Overage: extra tokens used beyond included balances
  • Active Balances: members with a current token balance

Create a token package

1
Open Settings and select Token Billing.
2
In the Token Packages section, click New Package.
3
Fill in the form:
  • Product: select an existing product from the Products tab (required)
  • Package Name: for example, Starter Pack
  • Billing Model: Prepaid (one-time) or Subscription (recurring)
  • Tokens Included: number of tokens the buyer receives
  • Price: cost in dollars
  • Renewal: for subscriptions, choose Monthly or Yearly
For subscription packages, you can also enable metered overage and set a per-token overage price.
You must create at least one product in the Products tab before you can create a token package.

Define usage triggers

Triggers decide how many tokens an app feature costs each time it runs.
1
In the Usage Triggers section, click New Trigger.
2
Select the App this trigger applies to.
3
Enter a Display Name (for example, AI Generation).
4
Set a Slug (for example, ai_generation).
5
Enter the Token Cost per call.
6
Click Create Trigger.
You must register apps in the Apps tab before you can create triggers.

Manage SDK API keys

API keys let external apps authenticate and consume tokens on behalf of your community.
1
In the SDK API Keys section, click New API Key.
2
Enter a Key Name (for example, Production Key).
3
Optionally restrict the key to a single App scope.
4
Click Create Key.
5
Copy the key immediately. It is shown only once.
Click the trash icon next to a key to revoke it. Revoked keys lose access immediately.

SDK integration quick reference

  • Install: npm install @instapay/sdk
  • Server-side: use an API key (il_live_...) for backend apps
  • Client-side: request a session token via POST /api/v1/auth/session
  • Consume tokens: call POST /api/v1/consume with the trigger slug and app ID

Frequently asked questions

If the member has no remaining balance, the app action is blocked. You can set a purchase or upgrade link on the product so members are redirected to buy more tokens.
Yes. Edit the trigger and update the Token Cost. The new cost applies to future calls immediately. Past consumption is not retroactively adjusted.
Prepaid packages grant tokens once at purchase. Subscription packages grant a fresh batch of tokens on each renewal and can optionally charge overage fees for extra usage beyond the included amount.
No. Each key can either be community-wide or restricted to a single app. If you need access for multiple apps, create one key per app.
No. Archiving a package only prevents new purchases. Members who already bought the package keep their remaining tokens and can continue using them.

Troubleshooting

You need at least one product in the Products tab. Create a product first, then return to Token Billing. The button will become active.
Make sure you copied the full key including the il_live_ prefix. If you lost it, revoke the old key and create a new one. Keys are only displayed once at creation.
Verify the trigger slug matches exactly what your app sends in the consume call. Check that the app is registered and the trigger is tied to the correct app ID. Review the 30-day analytics to see if consumption is being recorded.
Metered overage only works for subscription packages. Make sure overage is enabled on the package and a per-token overage price is set. It may take a billing cycle for Stripe to invoice the overage.