Metered generative AI · built on Creem
Generate images & video. Safely. Metered.
Aperture is a reference app that shows how to charge for AI generation with prepaid credits and screen every prompt for policy violations - using Creem's Customer Credits and Moderation APIs. No wallet tables to design, no race conditions to debug.
- Moderation
- every prompt, pre-generation
- Prepaid
- credits debited per render
- Idempotent
- safe retries, no double-charge
- Auto-refund
- on a failed generation
The whole app is one ordered flow
Reorder these steps and you either charge for content you should have blocked, or leak free compute. Aperture runs them in exactly this order, every time.
- 01
Moderate
Screen the raw prompt through
POST /moderation/prompt. Block on deny and flag. If moderation errors, fail closed - never generate. - 02
Debit
Reserve credits up front with an idempotency key. Insufficient balance stops here with a friendly 402.
- 03
Generate
Only now call the model - a swappable black box behind one interface. Drop in fal, Replicate, or your own weights.
- 04
Return / reverse
Return the asset. If the model fails after the debit, reverse the transaction so the user keeps their credits.
Credit packs
One-time purchases. Credits never expire. An image costs 5 credits; a video costs 40.
no subscription · pay as you render