Lists usage quotas for the caller’s organization in a quota namespace. You can optionally include
descendant organizations in the same datacenter as the caller. Requires the billing_read or
billing_edit permission.
This endpoint requires
any
of the following permissions:
billing_read
billing_edit
OAuth apps require the billing_edit authorization scope to access this endpoint.
Arguments
Path Parameters
Name
Type
Description
quota_namespace [required]
string
The product-specific namespace whose usage quotas are being managed.
Query Strings
Name
Type
Description
include_descendants
boolean
Whether to include quotas configured on descendant organizations in the caller’s organization hierarchy. Only descendants in the same datacenter are supported.
page[cursor]
string
An opaque cursor from a previous response’s meta.page.next_cursor used to retrieve the next page.
Response containing a paginated list of usage quotas.
Expand All
Field
Type
Description
data [required]
[object]
A list of usage quota resources.
attributes [required]
object
Attributes of a usage quota.
enforced [required]
boolean
Whether usage above the limit is actively blocked instead of only tracked or alerted on.
org_public_id [required]
string
The public ID of the organization that owns the quota.
scope
object
A namespace-specific key and value identifying what the quota applies to within an organization. The object contains exactly one entry. A value of "*" identifies the default quota applied to entities without a specific quota. This field is omitted for an organization-wide quota.
<any-key>
string
usage_limit [required]
double
The quota limit in the usage units defined by the quota namespace. May be fractional for quotas configured before public writes required whole units.
id [required]
string
An opaque usage quota identifier. Clients must pass this value back verbatim in update and delete requests and must not infer any structure from it.
type [required]
enum
The JSON:API resource type for a usage quota.
Allowed enum values: quotas
meta [required]
object
Pagination metadata for a usage quota list response.
page [required]
object
Cursor pagination fields for a usage quota list response.
next_cursor
string
An opaque cursor for retrieving the next page. Omitted when there are no more results.
# Path parameters exportquota_namespace="ai_credits" # Use a Personal Access Token or Service Access Token exportDD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# List usage quotas returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]config.unstable_operations["v2.list_quotas".to_sym]=trueendapi_instance=DatadogAPIClient::V2::UsageMeteringAPI.newpapi_instance.list_quotas("ai_credits")
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// List usage quotas returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())ctx=context.WithValue(ctx,datadog.ContextAccessToken,os.Getenv("DD_BEARER_TOKEN"))configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListQuotas",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewUsageMeteringApi(apiClient)resp,r,err:=api.ListQuotas(ctx,"ai_credits",*datadogV2.NewListQuotasOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `UsageMeteringApi.ListQuotas`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `UsageMeteringApi.ListQuotas`:\n%s\n",responseContent)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// List usage quotas returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.UsageMeteringApi;importcom.datadog.api.client.v2.model.UsageQuotasListResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));defaultClient.setUnstableOperationEnabled("v2.listQuotas",true);UsageMeteringApiapiInstance=newUsageMeteringApi(defaultClient);try{UsageQuotasListResponseresult=apiInstance.listQuotas("ai_credits");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling UsageMeteringApi#listQuotas");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
// List usage quotas returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_usage_metering::ListQuotasOptionalParams;usedatadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListQuotas",true);letapi=UsageMeteringAPI::with_config(configuration);letresp=api.list_quotas("ai_credits".to_string(),ListQuotasOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* List usage quotas returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration({authMethods:{AuthZ:{accessToken: process.env.DD_BEARER_TOKENasstring,},},});configuration.unstableOperations["v2.listQuotas"]=true;constapiInstance=newv2.UsageMeteringApi(configuration);constparams: v2.UsageMeteringApiListQuotasRequest={quotaNamespace:"ai_credits",};apiInstance.listQuotas(params).then((data: v2.UsageQuotasListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"tsc"example.ts"
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.