How do I track image generation usage per user?
Call vevee.reserve(userId, "image.render", 1, { model: "flux-pro" }) before calling the image provider; commit on success, release on error. AIPricingLab counts each render against any matching limit groups (total renders, premium renders, cents budget).
Last updated: 2026-05-10
Same pattern, any provider
AIPricingLab does not care if you call Flux, DALL·E, SDXL, or Midjourney. The event is whatever you decide it is. Tag it with metadata for analytics splits.
const r = await vevee.reserve(userId, "image.render", 1, {
model: "flux-pro",
variant: "4k",
});
if (!r.allowed) return { error: "limit" };
try {
const image = await callFluxPro(prompt);
await vevee.commit(r.reservationId!);
return { image };
} catch (e) {
await vevee.release(r.reservationId!);
throw e;
}Mixed quotas: total + premium
Define total_renders (no metadata filter) and premium_renders (filter: model = flux-pro). One render hits both groups. Free plan: 20 total, 0 premium. Pro plan: 500 total, 50 premium.
Related questions
How do I implement freemium for an AI product?
Define two plans (free, pro) with different limit groups. Assign free on signup. Gate AI calls with reserve / commit / release. On limit_rea…
Q&AHow do I add quotas to my AI app?
Define limit groups in the AIPricingLab dashboard with the unit and quota you want, attach them to a plan, assign the plan to each user. Gat…