Optional requestFactory: UsageMeteringApiRequestFactoryOptional responseProcessor: UsageMeteringApiResponseProcessorPrivate configurationPrivate requestPrivate responseThe request object
Optional options: ConfigurationRequest a temporary increase to your monthly AI credit limit. Set total to the new monthly limit you need, in whole credits, not the number of credits to add. Include a justification and, optionally, an expiry. If you omit the expiry, the grant ends at the next UTC month boundary. A user with the Billing Edit permission approves or denies the request. Requires an authenticated human user. Service-account credentials are unsupported.
The request object
Optional options: ConfigurationCancels the limit change scheduled to take effect at the start of the next usage period, leaving the usage quota and its current limit unchanged. Returns 404 when the quota does not exist, has no scheduled change, or its scheduled change has already taken effect; in every case the quota is left unchanged. The quota must belong to the caller's organization or one of its descendants, and its opaque identifier must belong to the requested quota namespace. Requires the billing_edit permission.
The request object
Optional options: ConfigurationDeletes a usage quota by its opaque identifier. The quota must belong to the caller's organization or one of its descendants, and its opaque identifier must belong to the requested quota namespace. Requires the billing_edit permission.
The request object
Optional options: ConfigurationRevoke only the grant that's still associated with this approved request. The request and audit history remain. A stale request can't revoke a replacement grant. Requires the Billing Edit permission. Requires an authenticated human user. Service-account credentials aren't supported. Request status remains approved after the grant's expiry, revocation, or replacement.
The request object
Optional options: ConfigurationCancel a pending request that you own. The request history is kept, and no grant is created or revoked. Requires an authenticated human user. Service-account credentials are unsupported.
The request object
Optional options: ConfigurationGet active billing dimensions for cost attribution. Cost data for a given month becomes available no later than the 19th of the following month.
Optional options: ConfigurationGet a mapping of billing dimensions to the corresponding keys for the supported usage metering public API endpoints. Mapping data is updated on a monthly cadence.
This endpoint is only accessible to parent-level organizations.
The request object
Optional options: ConfigurationGet cost across multi-org account.
Cost by org data for a given month becomes available no later than the 16th of the following month.
Note: This endpoint has been deprecated. Please use the new endpoint
/historical_cost
instead.
This endpoint is only accessible for parent-level organizations.
The request object
Optional options: ConfigurationGet 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.
The request object
Optional options: ConfigurationGet 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.
The request object
Optional options: ConfigurationGet hourly usage by product family.
The request object
Optional options: ConfigurationGet monthly cost attribution by tag across multi-org and single root-org accounts.
Cost Attribution data for a given month becomes available no later than the 19th of the following month.
This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id is
set in the response. If it is, make another request and pass next_record_id as a parameter.
Pseudo code example:
response := GetMonthlyCostAttribution(start_month, end_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
sleep(5 seconds) # Avoid running into rate limit
response := GetMonthlyCostAttribution(start_month, end_month, next_record_id=cursor)
cursor := response.metadata.pagination.next_record_id
END
This endpoint is only accessible for parent-level organizations. This endpoint is not available in the US2-FED site.
The request object
Optional options: ConfigurationRead an owned request, its decision, and its linked grant state. Requires an authenticated human user. Service-account credentials are unsupported. Request status remains approved after expiry, revocation, or replacement.
The request object
Optional options: ConfigurationGet projected cost across multi-org and single root-org accounts. Projected cost data is only available for the current month and becomes available around the 12th of the month.
This endpoint is only accessible for parent-level organizations.
The request object
Optional options: ConfigurationReturns a usage quota's current configuration by its opaque identifier. Scheduled limits are returned separately until they take effect, after which they are returned as the current limit.
By default, you can retrieve quotas from your organization and authorized descendant organizations in the same data center. Set include_descendants=false to restrict access to your organization.
A quota remains readable after its associated user, role, or team is deleted. Requires billing_read or billing_edit.
The request object
Optional options: ConfigurationRead an organization request, justification, decision, and linked grant state. Requires Billing Edit. Requires an authenticated human user. Service-account credentials are unsupported. Request status remains approved after expiry, revocation, or replacement.
The request object
Optional options: ConfigurationGet hourly usage for application security . Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API
The request object
Optional options: ConfigurationGet usage attribution types.
Optional options: ConfigurationGet hourly usage for Lambda traced invocations. Note: This endpoint has been deprecated.. Hourly usage data for all products is now available in the Get hourly usage by product family API
The request object
Optional options: ConfigurationGet resource-level usage for a billing dimension and month, using the same data as the resource breakdown in Plan & Usage. Supports all host and non-host resource types available in that breakdown. Availability depends on the billing dimension and the organization's usage data.
Results are scoped to the authenticated organization. Set filter[include_descendants]
to true to also return usage from its descendant organizations in all regions.
Set filter[view] to billable to return resources that contribute to billable usage.
For dimensions billed at the 99th percentile, this view returns resources at the
selected billing hour. For sum-based dimensions, it returns monthly resource usage.
Set filter[view] to all to return the full monthly resource breakdown. Requests
for unsupported billing dimensions, or dimensions configured with an unsupported
billing aggregation method, return a 400 Bad Request error.
To get the next page of results, pass the meta.pagination.next_record_id value
from the previous response as page[next_record_id], and keep all filters unchanged.
A null cursor indicates the last page. Paginated responses contain at most
page[limit] resource records, including queries across descendant organizations.
Exception: for any billing dimension billed at the 99th percentile,
filter[view]=billable returns the complete resource breakdown in one response,
including requested descendants. Eligibility depends on the organization's
billing configuration for the requested dimension and month, not on the product
name. For these queries, page[limit] and page[next_record_id] are ignored, and
meta.pagination.next_record_id is null. Sum-based usage and filter[view]=all
remain paginated.
The request object
Optional options: ConfigurationGet hourly usage for observability pipelines. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API
The request object
Optional options: ConfigurationList the field names returned by GET /api/v1/usage/summary at each of its
three response levels. Each list contains every key the data endpoint
emits—both typed fields declared in the OpenAPI spec and untyped keys
exposed through additionalProperties (the latter used for billing
dimensions and usage types added after the v1 schema freeze).
This endpoint is only accessible for parent-level organizations.
Go example:
fields, _, err := api.GetUsageSummaryAvailableFields(ctx)
attr := fields.Data.GetAttributes()
// resp is the *UsageSummaryResponse returned by api.GetUsageSummary(ctx, ...)
// Layer 1: UsageSummaryResponse
for _, key := range attr.GetResponseFields() {
if val, ok := resp.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
// Layer 2: UsageSummaryDate (per month)
for _, date := range resp.GetUsage() {
for _, key := range attr.GetDateFields() {
if val, ok := date.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
// Layer 3: UsageSummaryDateOrg (per org per month)
for _, org := range date.GetOrgs() {
for _, key := range attr.GetDateOrgFields() {
if val, ok := org.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
}
}
Optional options: ConfigurationList the authenticated user's own requests, including decided requests. Other users' requests are never included. Requires an authenticated human user. Service-account credentials aren't supported. Request status remains approved after the grant's expiry, revocation, or replacement.
The request object
Optional options: ConfigurationProvide a paginated version of listMyTemporaryGrantRequests returning a generator with all the items.
Optional options: ConfigurationLists usage quotas for the caller's organization in a quota namespace. You can optionally include
descendant organizations in the same data center as the caller. Requires the billing_read or
billing_edit permission.
The request object
Optional options: ConfigurationProvide a paginated version of listQuotas returning a generator with all the items.
Optional options: ConfigurationList all request statuses within the authenticated organization. Filter by pending status for the review queue. Requires Billing Edit, including for reads. Requires an authenticated human user. Service-account credentials are unsupported. Request status remains approved after expiry, revocation, or replacement.
The request object
Optional options: ConfigurationProvide a paginated version of listTemporaryGrantRequests returning a generator with all the items.
Optional options: ConfigurationUpdates the supplied fields on a usage quota. Setting enforced=false clears any pending change atomically, including when enforcement is already disabled. Other immediate updates preserve future pending changes when pending_usage_limit is omitted. For an organization-wide quota, pending_usage_limit schedules a limit for the next usage period. The quota must belong to the caller's organization or one of its descendants, and its opaque identifier must belong to the requested quota namespace. Requires the billing_edit permission.
The request object
Optional options: ConfigurationApprove or deny the submitted terms, which are immutable. Approval atomically writes the grant, audit record, and request decision. An expired request can't be approved. Requires the Billing Edit permission. Requires an authenticated human user. Service-account credentials aren't supported. Request status remains approved after the grant's expiry, revocation, or replacement.
The request object
Optional options: ConfigurationGenerated using TypeDoc
Creates or updates one or more usage quotas by scope. If a quota already exists for a supplied scope, it is updated. Otherwise, a quota is created only when
usage_limitandenforcedare provided. Setcreate_only=trueto atomically create exactly one quota in the caller's organization and reject an existing quota with409instead of updating it. This mode does not support pending limits or descendant writes. Repeated create-only requests do not replay the original response. If a response is lost, a retry can return409even if the first request succeeded; reconcile the outcome before retrying or importing the quota. For the organization-wide quota,pending_usage_limitschedules a limit for the next usage period and can accompany an immediate limit or update an existing quota by itself. Scheduled changes followinclude_descendantslike the other fields. Requires thebilling_editpermission.Quota namespaces and scope keys
The
quota_namespacepath parameter selects the product whose usage quotas are managed. Each namespace supports its own scope keys, described below. Omitscopefor the organization-wide quota.ai_creditsscope keysEach item's
scopecontains exactly one of the following keys.user_handlejane@example.com. User handles are returned in thedata[].attributes.handlefield by the Users API."*", the default quota applied to users without a specific quota."*agents*", the quota shared by all autonomous agents.include_descendantsis false. Wheninclude_descendantsis true, the handle must exist in the caller's organization or in at least one targeted descendant organization. The quota is then applied only to the organizations where the handle exists, and the item fails only if the handle exists in none of them.role_uuid12345678-1234-1234-1234-123456789012."*"is not accepted because there is no default role quota. Role UUIDs are returned in thedata[].idfield by the Roles API.include_descendantshas no effect on arole_uuidscope: the role is validated against the caller's organization only.team_id(private preview)data[].idfield by the Teams API.team_idare in private preview. Contact your Datadog account team to request access.