API referenceCost reports
Calculate a cost and usage report
POST
Computes costs and usage for a period that includes its start and excludes its end. Reports are not stored. A token reports on its own project.
header
X-Auth-Token<token>application/json- body
allow_partial?booleanWhen a region does not answer, return the regions that did and list the rest in missing_regions, instead of failing the report.
as_of?stringOptional reporting cutoff; defaults to the current time and cannot be in the future.
Format
date-timefilter?granularity*stringValue in
"hourly""daily""monthly"group_by?array<>|Items
items <= 5metrics?array<>|Items
1 <= items <= 2time_period*OK
application/json- response
as_of*stringFormat
date-timecurrency*stringgroup_definitions*array<string>|nullmissing_regions?array<string>|Regions left out of an allow_partial report because they did not answer.
pricing_version*stringregions?array<>|The regions this report covers and how far each one's data is complete.
results_by_time*array<>|nullcurl -X POST "https://example.com/v1/cost_reports" \ -H "Content-Type: application/json" \ -d '{ "granularity": "hourly", "time_period": { "end": "2019-08-24T14:15:22Z", "start": "2019-08-24T14:15:22Z" } }'{ "as_of": "2019-08-24T14:15:22Z", "currency": "string", "group_definitions": [ "string" ], "missing_regions": [ "string" ], "pricing_version": "string", "regions": [ { "data_through": "2019-08-24T14:15:22Z", "name": "string" } ], "results_by_time": [ { "estimated": true, "groups": [ { "keys": [ "string" ], "metrics": { "property1": { "amount": "string", "unit": "string" }, "property2": { "amount": "string", "unit": "string" } } } ], "time_period": { "end": "2019-08-24T14:15:22Z", "start": "2019-08-24T14:15:22Z" }, "total": { "property1": { "amount": "string", "unit": "string" }, "property2": { "amount": "string", "unit": "string" } }, "usage_by_unit": { "property1": { "amount": "string", "unit": "string" }, "property2": { "amount": "string", "unit": "string" } } } ]}