A telemetry measures one thing your customers use, such as tokens or API calls. Your systems send telemetry events under its event_name; it adds them up per customer each month, and each customer is invoiced an hour after the month closes (UTC). Its event name, how usage is read and its currency are fixed once created.
Attributes
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier, starting tlm_. |
object | string | Always telemetry. |
livemode | boolean | true in live mode. |
name | string | Shown on your customers' invoices. |
description | string or null | For your team. |
event_name | string | What your systems send usage under: lowercase letters, digits and underscores. |
aggregation | enum | sum of values, count of events, or the last value in the month. |
window | enum | Which events count: none (every event), hour (the latest per hour) or day (the latest per day). |
customer_key | string | The payload key holding your customer's ID. |
value_key | string | The payload key holding the amount. |
unit_singular | string | What one unit is called. |
unit_plural | string | What several are called. |
currency | string | usd. |
pricing | object | What a month of a customer's usage costs. per_unit: unit_amount cents per per units. package: unit_amount per package_size units, with rounding up or down for a part package. graduated or volume: per and tiers, each up_to and unit_amount. |
status | enum | active or inactive. An inactive telemetry refuses the usage sent to it. |
created | timestamp | When it was created. |
Example
Endpoints
| Endpoint | What it does |
|---|---|
POST /v1/telemetries | Start measuring and billing something your customers use. |
GET /v1/telemetries/{id} | Get a telemetry by its ID. |
POST /v1/telemetries/{id} | Change its name, description or price. |
POST /v1/telemetries/{id}/deactivate | Refuse new usage. Usage already counted is still billed. |
POST /v1/telemetries/{id}/reactivate | Count usage again. |
GET /v1/telemetries | List your telemetries. |