Product Catalog
Create feature
Features are either metered or static. A feature is metered if meterSlug is provided at creation. For metered features you can pass additional filters that will be applied when calculating feature usage, based on the meter's groupBy fields. Meters with SUM, COUNT, UNIQUE_COUNT and LATEST aggregations are supported for features.
post/api/v1/features
Request body
Example request
{
"metadata": {
"externalId": "019142cc-a016-796a-8113-1a942fecd26d"
},
"meterSlug": "tokens_total",
"meterGroupByFilters": {
"model": "gpt-4",
"type": "input"
},
"advancedMeterGroupByFilters": {
"model": {
"$in": [
"gpt-4",
"gpt-4o"
]
},
"type": {
"$eq": "input"
}
}
}Response
The request has succeeded and a new resource has been created as a result.
Example response
{
"createdAt": "2024-01-01T01:01:01.001Z",
"updatedAt": "2024-01-01T01:01:01.001Z",
"deletedAt": "2024-01-01T01:01:01.001Z",
"archivedAt": "2023-01-01T01:01:01.001Z",
"metadata": {
"externalId": "019142cc-a016-796a-8113-1a942fecd26d"
},
"meterSlug": "tokens_total",
"meterGroupByFilters": {
"model": "gpt-4",
"type": "input"
},
"advancedMeterGroupByFilters": {
"model": {
"$in": [
"gpt-4",
"gpt-4o"
]
},
"type": {
"$eq": "input"
}
},
"id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
}