Meter
POST/api/v1/meter/events
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/meter/events" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "idempotency_key": "string", "metric": "string", "value": 0.1 } ] }'{ "accepted": 0, "duplicates": 0, "rejected": 0, "results": [ { "bucket": "string", "idempotency_key": "string", "status": "accepted" } ]}GET/api/v1/meter/metrics
Authorization
bearer_token In: header
Query Parameters
Full-text search query applied to metric name
1-indexed page number
int640 <= valuePage size
int640 <= valueSort field
Sort order (asc or desc)
Value in
- "asc"
- "desc"
Additional filter expressions in the form field:operator:value
Response Body
application/json
curl -X GET "https://example.com/api/v1/meter/metrics"{ "metrics": [ { "aggregation": { "bucket": "minute", "kind": "sum", "rollups": [ "minute" ] }, "created_at": "2019-08-24T14:15:22Z", "dimensions": [ { "cardinality": "low", "name": "string", "required": true } ], "metric_id": "string", "name": "string", "pricing": { "currency": "string", "tiers": [ { "unit_price": 0.1, "up_to": 0 } ] }, "quota": { "enabled": true, "hard_limit": 0, "period": "day", "soft_limit": 0 }, "retention": { "hot_bucket_days": 0, "report_days": 0 }, "unit": "string", "updated_at": "2019-08-24T14:15:22Z", "version": 0 } ], "pagination": { "has_more": true, "page": 0, "page_size": 0, "total": 0 }}POST/api/v1/meter/metrics
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/meter/metrics" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "unit": "string" }'{ "aggregation": { "bucket": "minute", "kind": "sum", "rollups": [ "minute" ] }, "created_at": "2019-08-24T14:15:22Z", "dimensions": [ { "cardinality": "low", "name": "string", "required": true } ], "metric_id": "string", "name": "string", "pricing": { "currency": "string", "tiers": [ { "unit_price": 0.1, "up_to": 0 } ] }, "quota": { "enabled": true, "hard_limit": 0, "period": "day", "soft_limit": 0 }, "retention": { "hot_bucket_days": 0, "report_days": 0 }, "unit": "string", "updated_at": "2019-08-24T14:15:22Z", "version": 0}GET/api/v1/meter/metrics/{metric}
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X GET "https://example.com/api/v1/meter/metrics/string"{ "aggregation": { "bucket": "minute", "kind": "sum", "rollups": [ "minute" ] }, "created_at": "2019-08-24T14:15:22Z", "dimensions": [ { "cardinality": "low", "name": "string", "required": true } ], "metric_id": "string", "name": "string", "pricing": { "currency": "string", "tiers": [ { "unit_price": 0.1, "up_to": 0 } ] }, "quota": { "enabled": true, "hard_limit": 0, "period": "day", "soft_limit": 0 }, "retention": { "hot_bucket_days": 0, "report_days": 0 }, "unit": "string", "updated_at": "2019-08-24T14:15:22Z", "version": 0}GET/api/v1/meter/{metric}/alarms
Authorization
bearer_token In: header
Path Parameters
Response Body
application/json
curl -X GET "https://example.com/api/v1/meter/string/alarms"{ "alarms": [ { "alarm_id": "string", "limit": 0.1, "metric": "string", "scope": "string", "status": "triggered", "threshold": "soft_limit", "triggered_at": "2019-08-24T14:15:22Z", "usage": 0.1 } ], "count": 0}POST/api/v1/meter/{metric}/check
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/meter/string/check" \ -H "Content-Type: application/json" \ -d '{ "planned_units": 0.1 }'{ "allowed": true, "current_usage": 0.1, "hard_limit": 0, "hard_limit_exceeded": true, "planned_units": 0.1, "reserved_units": 0.1, "soft_limit": 0, "soft_limit_exceeded": true}POST/api/v1/meter/{metric}/commit
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/meter/string/commit" \ -H "Content-Type: application/json" \ -d '{ "actual_units": 0.1, "reservation_id": "string" }'{ "committed_units": 0.1, "released_units": 0.1, "reservation_id": "string", "status": "reserved"}POST/api/v1/meter/{metric}/estimate
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/meter/string/estimate" \ -H "Content-Type: application/json" \ -d '{ "units": 0.1 }'{ "currency": "string", "estimated_cost": 0.1, "metric": "string", "units": 0.1}GET/api/v1/meter/{metric}/forecast
Authorization
bearer_token In: header
Path Parameters
Query Parameters
User to forecast usage for (defaults to the caller)
Reset period to forecast against
Value in
- "day"
- "month"
- "billing_cycle"
- "prepaid"
Response Body
application/json
curl -X GET "https://example.com/api/v1/meter/string/forecast"{ "confidence": 0.1, "current_usage": 0.1, "metric": "string", "period_fraction_elapsed": 0.1, "projected_usage": 0.1, "user_id": "string"}GET/api/v1/meter/{metric}/reports
Authorization
bearer_token In: header
Path Parameters
Query Parameters
1-indexed page number
int640 <= valuePage size
int640 <= valueResponse Body
application/json
curl -X GET "https://example.com/api/v1/meter/string/reports"{ "pagination": { "has_more": true, "page": 0, "page_size": 0, "total": 0 }, "reports": [ { "estimated_cost": 0.1, "generated_at": "2019-08-24T14:15:22Z", "metric": "string", "quota": { "hard_limit_exceeded": true, "soft_limit_exceeded": true }, "report_id": "string", "top_consumers": [ { "dimension": "string", "usage": 0.1, "value": "string" } ], "total": 0.1, "unique_count": 0 } ]}POST/api/v1/meter/{metric}/reports/generate
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/meter/string/reports/generate" \ -H "Content-Type: application/json" \ -d '{}'{ "estimated_cost": 0.1, "generated_at": "2019-08-24T14:15:22Z", "metric": "string", "quota": { "hard_limit_exceeded": true, "soft_limit_exceeded": true }, "report_id": "string", "top_consumers": [ { "dimension": "string", "usage": 0.1, "value": "string" } ], "total": 0.1, "unique_count": 0}POST/api/v1/meter/{metric}/reserve
Authorization
bearer_token In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/v1/meter/string/reserve" \ -H "Content-Type: application/json" \ -d '{ "units": 0.1 }'{ "expires_at": "2019-08-24T14:15:22Z", "reservation_id": "string", "reserved_units": 0.1, "status": "reserved"}GET/api/v1/meter/{metric}/top
Authorization
bearer_token In: header
Path Parameters
Query Parameters
Dimension to rank consumers by
Bucket resolution to read top consumers from
Maximum consumers to return
int640 <= valueResponse Body
application/json
curl -X GET "https://example.com/api/v1/meter/string/top"{ "consumers": [ { "dimension": "string", "usage": 0.1, "value": "string" } ], "dimension": "string", "metric": "string", "period": "string"}GET/api/v1/meter/{metric}/usage
Authorization
bearer_token In: header
Path Parameters
Query Parameters
User to query usage for (defaults to the caller)
Bucket resolution (minute, hour, day, billing_cycle)
Response Body
application/json
curl -X GET "https://example.com/api/v1/meter/string/usage"{ "buckets": [ { "bucket": "string", "value": 0.1 } ], "metric": "string", "period": "string", "total": 0.1, "user_id": "string"}