Update a feature by ID
curl --request PUT \
--url https://api.cloud.flexprice.io/v1/features/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"alert_settings": {
"alert_enabled": true,
"critical": {
"condition": "above",
"threshold": 123
},
"info": {
"condition": "above",
"threshold": 123
},
"warning": {
"condition": "above",
"threshold": 123
}
},
"description": "<string>",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"metadata": {},
"name": "<string>",
"unit_plural": "<string>",
"unit_singular": "<string>"
}
'{
"alert_settings": {
"alert_enabled": true,
"critical": {
"condition": "above",
"threshold": 123
},
"info": {
"condition": "above",
"threshold": 123
},
"warning": {
"condition": "above",
"threshold": 123
}
},
"created_at": "<string>",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"field": "<string>",
"multiplier": 123,
"type": "COUNT"
},
"created_at": "2024-03-20T15:04:05Z",
"event_name": "api_request",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "API Usage Meter",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "tenant123",
"updated_at": "2024-03-20T15:04:05Z"
},
"meter_id": "<string>",
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"type": "metered",
"unit_plural": "<string>",
"unit_singular": "<string>",
"updated_at": "<string>",
"updated_by": "<string>"
}Enter your API key in the format x-api-key <api-key>*
Feature ID
Feature update data
Show child attributes
Show child attributes
Key is the key for the filter from $event.properties Currently we support only first level keys in the properties and not nested keys
Values are the possible values for the filter to be considered for the meter For ex "model_name" could have values "o1-mini", "gpt-4o" etc
OK
Show child attributes
Show child attributes
Show child attributes
MINUTE, 15MIN, 30MIN, HOUR, 3HOUR, 6HOUR, 12HOUR, DAY, WEEK, MONTH Field is the key in $event.properties on which the aggregation is to be applied For ex if the aggregation type is sum for API usage, the field could be "duration_ms"
Multiplier is the multiplier for the aggregation For ex if the aggregation type is sum_with_multiplier for API usage, the multiplier could be 1000 to scale up by a factor of 1000. If not provided, it will be null.
COUNT, SUM, AVG, COUNT_UNIQUE, LATEST, SUM_WITH_MULTIPLIER, MAX, WEIGHTED_SUM "2024-03-20T15:04:05Z"
"api_request"
Show child attributes
Key is the key for the filter from $event.properties Currently we support only first level keys in the properties and not nested keys
Values are the possible values for the filter to be considered for the meter For ex "model_name" could have values "o1-mini", "gpt-4o" etc
"550e8400-e29b-41d4-a716-446655440000"
"API Usage Meter"
BILLING_PERIOD, NEVER "published"
"tenant123"
"2024-03-20T15:04:05Z"
published, deleted, archived metered, boolean, static curl --request PUT \
--url https://api.cloud.flexprice.io/v1/features/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"alert_settings": {
"alert_enabled": true,
"critical": {
"condition": "above",
"threshold": 123
},
"info": {
"condition": "above",
"threshold": 123
},
"warning": {
"condition": "above",
"threshold": 123
}
},
"description": "<string>",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"metadata": {},
"name": "<string>",
"unit_plural": "<string>",
"unit_singular": "<string>"
}
'{
"alert_settings": {
"alert_enabled": true,
"critical": {
"condition": "above",
"threshold": 123
},
"info": {
"condition": "above",
"threshold": 123
},
"warning": {
"condition": "above",
"threshold": 123
}
},
"created_at": "<string>",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"field": "<string>",
"multiplier": 123,
"type": "COUNT"
},
"created_at": "2024-03-20T15:04:05Z",
"event_name": "api_request",
"filters": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "API Usage Meter",
"reset_usage": "BILLING_PERIOD",
"status": "published",
"tenant_id": "tenant123",
"updated_at": "2024-03-20T15:04:05Z"
},
"meter_id": "<string>",
"name": "<string>",
"status": "published",
"tenant_id": "<string>",
"type": "metered",
"unit_plural": "<string>",
"unit_singular": "<string>",
"updated_at": "<string>",
"updated_by": "<string>"
}