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
Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.
Full-text search over this list's searchable fields.
1 <= length <= 200Comma-separated sort keys, - for descending, at most 1. Keys: name, version, updated_at, created_at. Default: -created_at.
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
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 } ], "page": { "has_more": true, "next_cursor": "string", "page": 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
Query Parameters
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
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 } ], "page": { "has_more": true, "next_cursor": "string", "page": 0, "total": 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
Comma-separated sort keys, - for descending, at most 1. Keys: generated_at. Default: -generated_at.
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueSet to true to include the number of matching rows in page.total.
Response Body
application/json
curl -X GET "https://example.com/api/v1/meter/string/reports"{ "page": { "has_more": true, "next_cursor": "string", "page": 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
Rows per page, 1 to 100 (default 25).
1 <= value <= 100The page.next_cursor of the previous page. Cannot be combined with page.
A 1-based page number, for jumping. Cannot be combined with cursor.
1 <= valueDimension to rank consumers by
Bucket resolution to read top consumers from
Response 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", "page": { "has_more": true, "next_cursor": "string", "page": 0, "total": 0 }, "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"}