For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/cloud-cost-management/get-a-cloud-cost-management-tag-key.md. A documentation index is available at /llms.txt.
Language
Datadog site

Get a Cloud Cost Management tag key

GEThttps://api.datadoghq.com/api/v2/cost/tag_keys/{tag_key}https://api.us3.datadoghq.com/api/v2/cost/tag_keys/{tag_key}https://api.us5.datadoghq.com/api/v2/cost/tag_keys/{tag_key}https://api.datadoghq.eu/api/v2/cost/tag_keys/{tag_key}https://api.ap1.datadoghq.com/api/v2/cost/tag_keys/{tag_key}https://api.ap2.datadoghq.com/api/v2/cost/tag_keys/{tag_key}https://api.uk1.datadoghq.com/api/v2/cost/tag_keys/{tag_key}https://api.ddog-gov.com/api/v2/cost/tag_keys/{tag_key}https://api.us2.ddog-gov.com/api/v2/cost/tag_keys/{tag_key}

Overview

Get details for a specific Cloud Cost Management tag key, including example tag values and description.

This endpoint requires the cloud_cost_management_read permission.

OAuth apps require the cloud_cost_management_read authorization scope to access this endpoint.

Arguments

Path Parameters

Name
Type
Description
tag_key [required]
string

The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, kubernetes/instance).

Query Strings

Name
Type
Description
filter[metric]
string

The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics.

page[size]
integer

Controls the size of the internal tag value search scope. This does not restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000.

Default: 50

Response

OK

A single Cloud Cost Management tag key.

Field
Type
Description
data [required]
object

A Cloud Cost Management tag key.

Code Example

Get a Cloud Cost Management tag key
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Path parameters
export tag_key="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/cost/tag_keys/${tag_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"