Usage-based billing is becoming the standard for AI products. In this guide, we'll show you how to set it up in under an hour.
Why Usage-Based Billing?
Traditional subscription models don't work well for AI products where costs scale with usage. With usage-based billing, your customers pay for what they use, making your pricing:
- Fair: Customers pay proportionally to value received
- Scalable: Revenue grows with customer success
- Transparent: No hidden fees or surprises
Setting Up with Florentin
Step 1: Create Your Account
First, sign up for a Florentin account at florentin.ai.
Step 2: Configure Your Product
Define your usage metrics. For an AI API, this typically includes:
- Token usage (input + output)
- API calls
- Compute time
Step 3: Integrate the SDK
Install the Florentin SDK:
npm install florentin
Then track usage in your code:
import { Florentin } from 'florentin';
const florentin = new Florentin({ apiKey: 'sk_live_...' });
// After each API call
await florentin.usage.record({
customerId: 'cust_123',
productId: 'prod_gpt4',
quantity: tokenCount,
unit: 'tokens',
});
Conclusion
Usage-based billing doesn't have to be complicated. With Florentin, you can focus on building your AI product while we handle the billing infrastructure.
Ready to get started? Join our waitlist to be among the first to try Florentin.