---
title: "Update Custom Costs file"
method: PATCH
path: "/api/v2/cost/custom_costs/{file_id}"
tags: ["Cloud Cost Management"]
---

# Update Custom Costs file

`PATCH /api/v2/cost/custom_costs/{file_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/cost/custom_costs/{file_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `cloud_cost_management_write`

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

## Path parameters

- `file_id` string, required

## Request body

- CustomCostsFileUpdateRequest: Request for updating a Custom Costs file.
  - `data` CustomCostsFileUpdateData, required: Custom Costs file to update.
    - `attributes` CustomCostsFileUpdateAttributes, required: Attributes of a Custom Costs file that can be updated.
      - `ai_provider` boolean, required: Whether the Custom Costs file contains the costs of an AI provider.
    - `id` string, required: ID of the Custom Costs file.
    - `type` 'cost_metadata', required: Type of the Custom Costs file resource.

## Response `200`

OK

- CustomCostsFileUploadResponse: Response for Uploaded Custom Costs files.
  - `data` CustomCostsFileMetadataHighLevel: JSON API format for a Custom Costs file.
    - `attributes` CustomCostsFileMetadata: Schema of a Custom Costs metadata.
      - `ai_provider` boolean: Whether the Custom Costs file contains the costs of an AI provider.
      - `billed_cost` number, double: Total cost in the cost file.
      - `billing_currency` string: Currency used in the Custom Costs file.
      - `charge_period` CustomCostsFileUsageChargePeriod: Usage charge period of a Custom Costs file.
        - `end` number, double: End of the usage of the Custom Costs file.
        - `start` number, double: Start of the usage of the Custom Costs file.
      - `name` string: Name of the Custom Costs file.
      - `provider_names` string[]: Providers contained in the Custom Costs file.
      - `status` string: Status of the Custom Costs file.
      - `uploaded_at` number, double: Timestamp, in millisecond, of the upload time of the Custom Costs file.
      - `uploaded_by` CustomCostsUser: Metadata of the user that has uploaded the Custom Costs file.
        - `email` string: The name of the Custom Costs file.
        - `icon` string: The name of the Custom Costs file.
        - `name` string: Name of the user.
    - `id` string: ID of the Custom Costs metadata.
    - `type` string: Type of the Custom Costs file metadata.
  - `meta` CustomCostUploadResponseMeta: Meta for the response from the Upload Custom Costs endpoints.
    - `version` string: Version of Custom Costs file

## Other responses

- `404`: Not Found
- `429`: Too many requests

## Changes

- **2026-11-12** `d7d8eecfcbee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/changes/api/v2/cost/custom_costs/:file_id/patch.md)

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/14d85160bfa9?raw)
