How to build Clay-like credit-based billing in <30 mins using Flexprice

2 Koshima 2 6/11/2025, 9:34:58 AM flexprice.io ↗

Comments (2)

Koshima · 1d ago
I am building Flexprice, an open source metering and billing platform for AI and agentic-based companies. I've recently published a guide showing how to replicate Clay's credit-pricing model.

This guide includes: - Configuring recurring credit grants (e.g., 100 credits/month) - Capping rollover at 2× monthly allocation - Real-time metering (e.g., 10 credits to create a table; 1.5 per-row on enrichment) - Monthly vs annual billing models, credit expiry rules

This addresses a challenge many SaaS/AI/API products face: building transparent, usage-aligned pricing that’s easy to iterate on.

Would be grateful for HN feedback especially around edge cases or UI/UX when exposing credit consumption to users.

eightnoteight · 1d ago
credit balance api is pretty cool

always liked the v0 feature where they notify to top up when the balance runs low

when do apps invoke the credit balance api? before sending events or they poll asynchronously and keep a local cache about the credit balance?

i guess caching would be a bad pattern too as the app may not function immediately after the top up of credits