---
title: "Get historical cost across your account"
method: GET
path: "/api/v2/usage/historical_cost"
tags: ["Usage Metering"]
---

# Get historical cost across your account

`GET /api/v2/usage/historical_cost`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/usage/historical_cost`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `usage_read`, `billing_read`

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](https://docs.datadoghq.com/account_management/multi_organization/).

## Query parameters

- `start_month` string, date-time, required
- `view` string
- `end_month` string, date-time
- `include_connected_accounts` boolean

## Response `200`

OK

- CostByOrgResponse: Chargeback Summary response.
  - `data` CostByOrg[]: Response containing Chargeback Summary.
    - `attributes` CostByOrgAttributes: Cost attributes data.
      - `account_name` string: The account name.
      - `account_public_id` string: The account public ID.
      - `charges` ChargebackBreakdown[]: List of charges data reported for the requested month.
        - `charge_type` string: The type of charge for a particular product.
        - `cost` number, double: The cost for a particular product and charge type during a given month.
        - `product_name` string: The product for which cost is being reported.
      - `date` string, date-time: The month requested.
      - `org_name` string: The organization name.
      - `public_id` string: The organization public ID.
      - `region` string: The region of the Datadog instance that the organization belongs to.
      - `total_cost` number, double: The total cost of products for the month.
    - `id` string: Unique ID of the response.
    - `type` 'cost_by_org': Type of cost data.

## Other responses

- `400`: Bad Request
- `403`: Forbidden - User is not authorized
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
