Usage Metering

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.

get/api/v2/usage/historical_cost

Request

  • Base URL
    https://api.datadoghq.com
  • URL
    https://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 2
      Authorization code: /oauth2/v1/authorize
      Token URL: /oauth2/v1/token scopes: usage_read, billing_read

Query parameters

start_monthstring date-time required

Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost beginning this month.

viewstring

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.

end_monthstring date-time

Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost ending this month.

include_connected_accountsboolean

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.