Event-based billing
Meter AI actions, charge per event
Define event types, assign credit costs, deduct in real time. Chat replies, image generations, agent runs — one abstraction. Map usage to revenue without token counting.
The gap
Usage and revenue are disconnected
AI products generate usage — prompts, completions, images, agent steps. Without event-based metering, you can't charge per action or see which features drive revenue. Flat plans guess. Token-based billing exposes complexity.
Why the old approach breaks
Ad hoc tracking doesn't scale
Logging usage to a database and billing later creates lag and inconsistency. Different features, different models, different cost structures — without a unified event model, you're stitching custom logic. Token-based metering ties you to provider APIs. Event-based charging gives you one abstraction: this action costs X credits.
Example
Image generation event
User requests an image. Your app calls DALL·E or similar. After the image is generated, you meter image.generate — say 12 credits. Wallet deducts 12. The event flows into your dashboard: which users generate most images, what it costs you, how pricing changes affect revenue.
// After image generation completes
meter_event("image.generate", userId) // 12 credits
How it works
Define events, set costs, meter in real time
You define event types and assign credit costs. The SDK meters each call and deducts from the user's wallet. Balances update immediately. Usage flows into the same system whether it comes from your app or an MCP tool.
Try it
See how usage turns into billable events
Trigger common AI actions and see how Chargly meters them into credits, usage totals, and revenue signals in real time.
This is a simplified preview. Chargly handles production metering with your actual app events.
See how Chargly applies this in production0
0 credits
$0.00
—
Metering turns product activity into billable usage without exposing provider complexity.
Click an event above to add it to the stream.
Where it fits in the product
SDK, MCP, Pricing Advisor
Metering is the core of the billing layer. The SDK lets you call meter_event from your app. The MCP server exposes the same capability to agents. Pricing Advisor uses usage data to recommend credit-cost changes. All events flow through one system.