Cloud Cost Management

Update Custom Costs file

Changed on

Mark whether a Custom Costs file holds AI provider costs. Datadog then recomputes the costs for the months that the file covers.

patch/api/v2/cost/custom_costs/{file_id}

Request

  • Base URL
    https://api.datadoghq.com
  • Auth
    • API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
    • or OAuth 2
      Authorization code/oauth2/v1/authorize
      Token URL/oauth2/v1/token
      Scopescloud_cost_management_write

Path parameters

file_idstring required

File ID.

Request body

Example request

{
  "data": {
    "attributes": {
      "ai_provider": true
    },
    "id": "00000000-0000-0000-0000-000000000007",
    "type": "cost_metadata"
  }
}

Response

OK

Example response

{
  "data": {
    "attributes": {
      "billed_cost": 100.5,
      "billing_currency": "USD",
      "charge_period": {
        "end": 1706745600000,
        "start": 1704067200000
      },
      "name": "my_file.json",
      "provider_names": [
        "my_provider"
      ],
      "status": "active",
      "uploaded_at": 1704067200000,
      "uploaded_by": {
        "email": "email.test@datadohq.com",
        "icon": "icon.png",
        "name": "Test User"
      }
    }
  }
}

Changes