Get historical cost across your account
Get historical cost across multi-org and single root-org accounts. Cost data for a given month becomes available no later than the 16th of the following month.
This endpoint is only accessible for parent-level organizations.
Request
- Base URLhttps://api.datadoghq.com
- URLhttps://api.datadoghq.com/api/v2/usage/historical_cost
- Auth
- API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
- or OAuth 2Authorization code: /oauth2/v1/authorizeToken URL: /oauth2/v1/token scopes: usage_read, billing_read
Query parameters
Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost beginning this month.
String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are summary and sub-org. Defaults to summary.
Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost ending this month.
Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to false.
Response
OK
Example response
{
"data": [
{
"attributes": {
"charges": [
{
"charge_type": "on_demand",
"product_name": "infra_host"
}
]
},
"type": "cost_by_org"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.