Skip to main content

Who Is This For?

This guide is for developers building AI products, API services, or any usage-based business. Common examples:
Business TypeExamples
AI API ServicesLLM API proxies, image generation, speech recognition
AI SaaSAI writing assistants, AI code completion, AI translation
AI Agent PlatformsAutomated workflows, data analysis agents
API ServicesPayment processing, messaging, data queries

How Billing Works with Waffo Pancake

Waffo Pancake does not provide built-in usage metering, but you can implement flexible AI product billing through these approaches:

Approach 1: Subscription Tiers with Token/Request Quotas

Create subscription products at different tiers, each with a different token or request quota.
Prices below are examples only. Set them based on your actual business and costs.
PlanMonthlyToken QuotaBest For
Starter$9/month100K tokensIndividual developers
Pro$49/month1M tokensSmall teams
Scale$199/month10M tokensEnterprise

Approach 2: Dynamic Pricing via Checkout Session

Pass dynamic pricing through priceSnapshot when creating a checkout session to charge based on actual usage.
const session = await client.checkout.createSession({
  storeId: "store_id",
  productId: "usage-product-id",
  productType: "onetime",
  currency: "USD", // replace with your currency
  priceSnapshot: {
    amount: calculatedAmount, // dynamically calculated based on usage
    taxIncluded: false,
    taxCategory: "saas",
  },
});

Approach 3: External Metering Tools

Use dedicated metering tools to track usage, combined with Waffo Pancake for billing.

LiteLLM

AI model proxy and usage tracking supporting 100+ LLM providers. Unified interface for OpenAI, Anthropic, Gemini, and more with built-in usage analytics.

OpenMeter

Open-source usage metering platform designed for AI and API products. Real-time tracking of token consumption, API calls, and custom metrics.

Business Scenarios

The following are example scenarios. Adjust them to match your actual business.

Scenario 1: AI API Service (Token-Based Billing)

Setup:
  1. Create tiered subscription products (Starter / Pro / Scale)
  2. Each tier includes a token quota
  3. Track token consumption using LiteLLM or your own system
  4. Prompt users to upgrade when approaching their quota
Dashboard workflow:
  • Monitor active subscriptions in the Subscriptions page
  • Track revenue per tier in Analytics
  • View customer details to understand usage patterns

Scenario 2: AI SaaS (Subscription + Token Allowance)

Setup:
  1. Create subscription products with token allowances
  2. Store allowance info in product metadata
  3. When users exceed their allowance, create overage charges via priceSnapshot
  4. Use webhooks to automate renewal and quota resets
Dashboard workflow:
  • Monitor subscriptions and one-time orders
  • Track subscription revenue vs overage revenue in Analytics

Scenario 3: AI Agent Platform (Per-Task/Per-Call Billing)

Setup:
  1. Create a base subscription product with a set number of agent calls
  2. Log each agent execution upon completion
  3. For usage beyond the included calls, create one-time orders with dynamic pricing
  4. Use OpenMeter to track call counts and costs
Dashboard workflow:
  • View per-customer revenue in Payments
  • Track agent call growth trends

Key Webhook Events

EventAction
subscription.activatedSet initial token/request quota
subscription.updatedAdjust quota to match new plan
subscription.canceledRevoke API access or downgrade to free tier
subscription.past_dueReduce quota or throttle API calls
order.completedGrant additional token allowance (overage purchase)
For API details, see the API Reference.

Testing

1

Create Test Products

Set up your tiered subscription products in test mode.
2

Subscribe with Test Card

Use 4242 4242 4242 4242 to subscribe to each tier.
3

Simulate Usage

Test your usage tracking and quota enforcement logic.
4

Test Overage Billing

Verify the dynamic pricing and overage billing flow.

Launch Checklist

  • Subscription products created for each tier
  • Pricing and quotas clearly documented
  • Usage tracking/metering tool integrated
  • Quota enforcement working correctly
  • Upgrade/downgrade flows tested
  • Overage billing flow verified
  • Products published to production

Next Steps

Run SaaS Subscriptions

Learn more about subscription management

Set Up Webhooks

Automate quota management with webhooks