usage-based-billing

Implement usage-based billing and metered pricing with Dodo Payments.

11|3|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/dodopayments/skills --skill usage-based-billing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: usage-based-billing
Source: https://github.com/dodopayments/skills/tree/main/dodo-payments/usage-based-billing
Command: npx skills add https://github.com/dodopayments/skills --skill usage-based-billing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Usage-based billing lets teams bill customers precisely for the actual usage of services, eliminating guesswork and disputes from flat-rate models.

Core Features & Use Cases

  • Metered pricing: Define meters (counts, sums, max, or last) and attach them to products to bill per unit of usage.
  • Event ingestion: Ingest usage events with event_name and metadata to drive billing, in real time or batched.
  • Flexible pricing & subscriptions: Apply free thresholds, overages, and hybrid models that combine with subscriptions for predictable revenue.

Quick Start

  • Create a meter named "API Requests" with Event Name "api.call", Aggregation Count, Unit "calls".
  • Create a Usage-Based Product and connect the meter; set Price Per Unit and Free Threshold.
  • Ingest events using the client library, for example: client.usageEvents.ingest({ events: [{ event_id: "evt_...", customer_id: "...", event_name: "...", timestamp: "2025-01-01T00:00:00Z", metadata: { ... } }] });

Frequently Asked Questions about usage-based-billing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement usage-based billing for an API or SaaS product?

You can implement usage-based billing by defining meters with aggregations like Count or Sum, creating a usage-based product with a price per unit, and ingesting usage events via a client library to drive automated customer invoicing.

What aggregation types can I use for metered pricing?

Metered pricing supports four aggregation types: Count, Sum, Max, and Last. These allow you to calculate usage totals based on event metadata, accommodating various billing models for APIs and AI services.

Does usage-based billing work with recurring subscriptions?

Yes, usage-based billing combines with recurring subscriptions to create hybrid models. This allows you to charge predictable flat-rate subscription fees alongside variable metered usage and apply free thresholds.

How do I ingest usage events for real-time or batched metering?

You ingest usage events by sending event data through the client library, providing an event name, customer ID, timestamp, and metadata. This data flows into your defined meters to calculate billing.

Can I set a free usage threshold before charging customers per unit?

Yes, you can define a free threshold when setting up your usage-based product. Customers are only billed for usage that exceeds this specified limit, calculated using your configured price per unit.