Settings

Theme

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

flexprice.io

2 points by Koshima 6 months ago · 3 comments

Reader

KoshimaOP 6 months 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.

  • RiyaFlex 6 months ago

    This is super helpful!

    Really like the direction Flexprice is going. Excited to see more OSS approaches in the billing space, it’s long overdue.

eightnoteight 6 months 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

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection