Thanks to visit codestin.com
Credit goes to github.com

Skip to content

UsageMeteringApi.get_monthly_usage_attribution fails on ApiValueError since Nov 5th #2933

@cherkaskyb

Description

@cherkaskyb

Describe the bug

The get-monthly-usage-attribution endpoint is returning a YYYY-MM formatted string under the usage[].month field.
This is the validation that fails as the month field is defined as datetime in the MonthlyUsageAttributionBody

Label the issue properly.

  • Add severity/ - this is a breaking change on a stable public api, so considered quite severe.

To Reproduce

This snipped fails:

from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi
from datadog_api_client import ApiClient, Configuration

request = {
    "start_month": datetime(2025, 11, 4),
    "end_month": datetime(2025, 11, 5),
    "tag_breakdown_keys": "team",
    "fields": "*",
    "include_descendants": True
}

config = Configuration(
    host=host,
    api_key={"apiKeyAuth": api_key, "appKeyAuth": app_key},
)
with ApiClient(config) as client:
    api_instance = UsageMeteringApi(client)
    r = api_instance.get_monthly_usage_attribution(**request)

Expected behavior

for the sdk not to fail, and for the api to process correctly the response coming back from the dd-api.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment and Versions (please complete the following information):
tested on 2.30.0 and 2.45.0. both failed with the same error

Additional context
This started failing at Nov 5'th and worked well up until this point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions