provider Usage Metering GET
/api/v2/usage/estimated_cost @utdk/datadog
/api/v2/usage/estimated_cost Get estimated cost across your account
Get estimated cost across multi-org and single root-org accounts.
Estimated cost data is only available for the current month and previous month
and is delayed by up to 72 hours from when it was incurred.
To access historical costs prior to this, use the `/historical_cost` endpoint.
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
- view query
- 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`.
- string
- start_month query
- Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning this month. **Either start_month or start_date should be specified, but not both.** (start_month cannot go beyond two months in the past). Provide an `end_month` to view month-over-month cost.
- string
- end_month query
- Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
- string
- start_date query
- Datetime in ISO-8601 format, UTC, precise to day: `[YYYY-MM-DD]` for cost beginning this day. **Either start_month or start_date should be specified, but not both.** (start_date cannot go beyond two months in the past). Provide an `end_date` to view day-over-day cumulative cost.
- string
- end_date query
- Datetime in ISO-8601 format, UTC, precise to day: `[YYYY-MM-DD]` for cost ending this day.
- string
- cost_aggregation query
- Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals.
- enum: cumulative
- include_connected_accounts query
- Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.
- boolean
Try it
Authentication
Configure credentials for Datadog API V2 Collection
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import datadog from '@utdk/datadog';
await datadog.getestimatedcostbyorg({
"include_connected_accounts": false
})