DocumentationAI tokens (optional)
AI tokens (optional)
Monthly grants, one-time token packs, and consumption on /ai endpoints.
How tokens work
| Source | Behavior |
|---|---|
| Monthly subscription grant | Included per plan (see Plans). Reset each billing cycle after Stripe invoice.paid. Use it or lose it — monthly tokens do not roll over. |
| Token packs (one-time) | Purchased add-ons. Do not expire and stack on top of monthly balance. |
| Consumption | Each AI call debits AiTokenLedger based on model usage. |
Token packs
| Pack | Tokens | Price |
|---|---|---|
| Starter | 10,000 | €5 |
| Growth | 50,000 | €20 |
| Scale | 200,000 | €70 |
Purchase flows through Stripe Checkout (same billing infrastructure as plan upgrades). Exact checkout payload may vary by deployment — use the dashboard Billing section when available.
API endpoints that consume tokens
POST /ai/generate
POST /ai/improve
Authorization: Bearer <jwt or api key>
X-Tenant-Id: clxxxxxxxx
If the tenant balance is insufficient, the API returns an error before running the model. Monitor usage alongside email quota in GET /billing/subscription and dashboard widgets.
Monthly vs pack tokens
Billing cycle start → invoice.paid → grant plan.tokensIncludedMonth
AI editor usage → debit ledger
Pack purchase → credit ledger (persistent)