Stripe Meter Event
Stripe Meter Event sends Stripe a usage record for a customer: how many calls they made, how many units they used, how many minutes they consumed. Stripe adds those records up in a meter and bills them at the usage-based price you have set up.
It is meant for usage-based billing: the customer pays for what they use instead of a fixed fee. The meter and its price are set up in Stripe beforehand; this component only sends the usage.
When to use it
- You charge your customers for each document your flow processes and want to record each one in Stripe.
- You sell an AI assistant and want to bill for the questions each customer asks.
- At the end of each day you want to send Stripe the total units each customer used.
Configuration
You need a Stripe API credential with the secret key of your Stripe account. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Stripe API credential of your account. |
| Event Name (required) | The event name exactly as you set it up in the Stripe meter, for example assistant_queries. Up to 100 characters. |
| Customer ID (required) | The identifier of the Stripe customer (starts with cus_) the usage belongs to. |
| Value (required) | The amount used, a number. For example 1 per question or 250 for 250 units. |
| Identifier | A unique identifier for the record, up to 100 characters. If you send the same one twice, Stripe counts it only once. Left empty, Stripe generates one. |
| Timestamp | When the usage happened, as a Unix timestamp (number of seconds). Left empty, the current time is used. Stripe only accepts usage from the last 35 days. |
Output
The Data output returns the record Stripe accepted, with the event name, the customer, the value and the time of the usage.
You can connect it to your own log or a spreadsheet to keep track of what was sent. The component can also be connected to an Agent as a tool, so the agent decides when to use it. See Tool Mode.
Example
A company sells an invoice data extraction service and charges for each processed document.
- In Stripe, create a meter with the event
documents_processedand a per-unit price. - At the end of the flow that processes each document, add Stripe Meter Event.
- Set Event Name to
documents_processed, pass the customer’s identifier to Customer ID and set Value to1. - In Identifier, pass the document’s identifier, so a document processed again is not billed twice.
Good practices
- Always use Identifier when the same flow can run more than once for the same usage.
- Check that Event Name matches the Stripe meter’s name exactly; otherwise the usage is not added to the meter you expect.
Related components
- Stripe Price: prices of your products.
- Stripe Subscription: your customers’ subscriptions.
- Stripe Customer: create and manage customers.