Skip to main content
PATCH
Update

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

id
string
required

Unique identifier for a billable metric

Pattern: ^bm_[a-zA-Z0-9]+$

Body

application/json
description
string

Revised explanation of what the metric represents. Sample values: 'Language model token consumption', 'Database storage capacity used', 'Machine learning prediction API calls', 'AI-generated content items'

name
string

Updated label for the metric. Sample values: 'LLM Tokens', 'Database Storage', 'Prediction Requests', 'Content Generations'

unit
string

Updated measurement unit. Common examples: 'tokens', 'GB', 'requests', 'items', 'hours'

eventType
string | null

CloudEvents type for meter routing.

valueProperty
string | null

JSONPath to extract a numeric value from event data. Must start with $. (example: $.amount or $.payload.bytes).

Pattern: ^\$\.[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*$
groupBy
object | null

Map of dimension name to JSONPath for group-by queries. Each value must start with $. (example: $.region).

eventFrom
string<date-time> | null

Only count events after this timestamp.

Response

Billable metric updated successfully

id
string
required

Unique identifier for a billable metric

Pattern: ^bm_[a-zA-Z0-9]+$
object
enum<string>
default:billableMetric
required
Available options:
billableMetric
aggregation
enum<string>
required
Available options:
SUM,
COUNT,
AVG,
MIN,
MAX,
UNIQUE_COUNT,
LATEST
createdAt
string<date-time>
required
description
string
required
merchantId
string
required

Unique identifier for an organization

Pattern: ^org_[a-zA-Z0-9]+$
name
string
required
productId
string
required

Unique identifier for a product

Pattern: ^prod_[a-zA-Z0-9]+$
unit
string
required
updatedAt
string<date-time>
required
eventType
string | null
valueProperty
string | null
groupBy
object | null
eventFrom
string<date-time> | null