---
title: Get a model pricing override by canonical ID
description: Get a provider model's pricing override and effective pricing source, naming the model in the canonical query parameter.
breadcrumbs: Docs > API > Get a model pricing override by canonical ID
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Get a model pricing override by canonical ID

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in Preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                   |
| ----------------- | ------------------------------------------------------------------------------ |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/providers/{provider_id}/model-pricing     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/providers/{provider_id}/model-pricing |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/providers/{provider_id}/model-pricing |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/providers/{provider_id}/model-pricing      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/providers/{provider_id}/model-pricing |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/providers/{provider_id}/model-pricing |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/providers/{provider_id}/model-pricing |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/providers/{provider_id}/model-pricing      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/providers/{provider_id}/model-pricing  |

### Overview

Get a provider model's pricing override and effective pricing source, naming the model in the `canonical` query parameter. Unlike the endpoint that takes the canonical ID in the path, this one accepts canonical IDs that contain `/`. Requires `ai_gateway_config_read` and provider View. Catalog and pricing metadata inherit provider access. Direct reads of hidden resources return 404.

This endpoint requires the `ai_gateway_config_read` permission.

OAuth apps require the `ai_gateway_config_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#ai-gateway) to access this endpoint.

### Arguments

#### Path Parameters

| Field                    | Type    | Description  |
| ------------------------ | ------- | ------------ |
| provider_id [*required*] | integer | Provider ID. |

#### Query Strings

| Field                  | Type   | Description                                                              |
| ---------------------- | ------ | ------------------------------------------------------------------------ |
| canonical [*required*] | string | Canonical model identifier. It can contain `/`, such as `openai/gpt-4o`. |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing model pricing information.

| Parent field      | Field                          | Type      | Description                                                                                                                                                                                                                                |
| ----------------- | ------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|                   | data [*required*]              | object    | Data for a model pricing response.                                                                                                                                                                                                         |
| data              | attributes [*required*]        | object    | Attributes of a model pricing resource.                                                                                                                                                                                                    |
| attributes        | authoritative                  | boolean   | True when models.dev pricing is authoritative for this organization and provider.                                                                                                                                                          |
| attributes        | automatic_pricing              | object    | The published models.dev price. Present only when it is the effective price.                                                                                                                                                               |
| automatic_pricing | last_validated_at [*required*] | date-time | Time the price was last revalidated against the source.                                                                                                                                                                                    |
| automatic_pricing | mapping                        | object    | The reviewed endpoint mapping used to identify a custom provider. Omitted when the provider and model identity matched exactly.                                                                                                            |
| mapping           | id [*required*]                | string    | Mapping identifier.                                                                                                                                                                                                                        |
| mapping           | revision [*required*]          | string    | Mapping revision.                                                                                                                                                                                                                          |
| mapping           | scope [*required*]             | string    | Mapping scope, such as `provider`.                                                                                                                                                                                                         |
| mapping           | version [*required*]           | int64     | Mapping version.                                                                                                                                                                                                                           |
| automatic_pricing | mode_triggers                  | [object]  | Request fields that select each priced mode, such as `speed: fast` for `anthropic` models. Omitted when the model has a single mode.                                                                                                       |
| mode_triggers     | body                           | [object]  | Request body fields that must match.                                                                                                                                                                                                       |
| body              | name [*required*]              | string    | Field or header name.                                                                                                                                                                                                                      |
| body              | value [*required*]             | string    | Value that selects the mode.                                                                                                                                                                                                               |
| mode_triggers     | headers                        | [object]  | Request headers that must match.                                                                                                                                                                                                           |
| headers           | name [*required*]              | string    | Field or header name.                                                                                                                                                                                                                      |
| headers           | value [*required*]             | string    | Value that selects the mode.                                                                                                                                                                                                               |
| mode_triggers     | mode [*required*]              | string    | Priced mode selected by the fields.                                                                                                                                                                                                        |
| automatic_pricing | observed_at [*required*]       | date-time | Time the price was observed in the source.                                                                                                                                                                                                 |
| automatic_pricing | rates [*required*]             | [object]  | Published rates.                                                                                                                                                                                                                           |
| rates             | amount [*required*]            | string    | Exact decimal amount per unit, zero or greater, represented as a string to preserve precision. Supports fixed decimal and exponent notation.                                                                                               |
| rates             | component [*required*]         | string    | Token category priced, such as `input`, `output`, `cache_read`, or `cache_write`.                                                                                                                                                          |
| rates             | context_max_tokens             | int64     | Largest input length covered by this price. Omitted when there is no upper bound.                                                                                                                                                          |
| rates             | context_min_tokens             | int64     | Input length above which this price applies. Omitted for the base tier.                                                                                                                                                                    |
| rates             | currency [*required*]          | string    | Currency of the price. The only supported value is USD.                                                                                                                                                                                    |
| rates             | mode [*required*]              | string    | Source mode name. `standard` is the base mode. Other values, such as `fast`, are source-defined and selected by `mode_triggers`.                                                                                                           |
| rates             | operation                      | string    | Operation the price applies to. Omitted when it applies to every operation.                                                                                                                                                                |
| rates             | service_tier                   | string    | Provider service tier explicitly associated with this mode by the source. Omitted when unknown.                                                                                                                                            |
| rates             | unit [*required*]              | string    | Unit of the quoted amount. The only supported value is million_tokens.                                                                                                                                                                     |
| automatic_pricing | source [*required*]            | object    | The pricing source entry the price was read from.                                                                                                                                                                                          |
| source            | match_method [*required*]      | string    | How the gateway matched the model to the source entry, such as `wire_id`.                                                                                                                                                                  |
| source            | model_id [*required*]          | string    | Model identifier in the source.                                                                                                                                                                                                            |
| source            | name [*required*]              | string    | Pricing source name.                                                                                                                                                                                                                       |
| source            | provider_id [*required*]       | string    | Provider identifier in the source.                                                                                                                                                                                                         |
| source            | revision [*required*]          | string    | Source revision the price was read from.                                                                                                                                                                                                   |
| automatic_pricing | stale [*required*]             | boolean   | True when the price has not been revalidated recently and is being retained as last-known-good.                                                                                                                                            |
| attributes        | blocks_budgeted_requests       | boolean   | True when a `BLOCK` budget covering this model rejects its requests before they reach the provider.                                                                                                                                        |
| attributes        | cost_multiplier                | double    | Effective provider multiplier applied to every reported rate.                                                                                                                                                                              |
| attributes        | duration_priced                | boolean   | True when the provider bills this model per minute of audio instead of per token, as with transcription models. The gateway prices only per token, so it can't charge for these models, and a per-token override can't express their rate. |
| attributes        | effective_source               | enum      | Effective source of the model pricing data. Allowed enum values: `catalog_auto`, `model_override`, `models_dev`, `unpriced`, `unknown`.                                                                                                    |
| attributes        | pricing_config                 | object    | Pricing configuration for the model.                                                                                                                                                                                                       |
| pricing_config    | overrides                      | object    | Manual pricing overrides.                                                                                                                                                                                                                  |
| overrides         | cache_read_cost_per_mtok       | double    | Cost per million tokens for cache reads.                                                                                                                                                                                                   |
| overrides         | cache_write_cost_per_mtok      | double    | Cost per million tokens for cache writes.                                                                                                                                                                                                  |
| overrides         | non_cached_input_cost_per_mtok | double    | Cost per million tokens for non-cached input.                                                                                                                                                                                              |
| overrides         | output_cost_per_mtok           | double    | Cost per million tokens for output.                                                                                                                                                                                                        |
| pricing_config    | rates                          | object    | Effective pricing rates.                                                                                                                                                                                                                   |
| rates             | cache_read_cost_per_mtok       | double    | Cost per million tokens for cache reads.                                                                                                                                                                                                   |
| rates             | cache_write_cost_per_mtok      | double    | Cost per million tokens for cache writes.                                                                                                                                                                                                  |
| rates             | non_cached_input_cost_per_mtok | double    | Cost per million tokens for non-cached input.                                                                                                                                                                                              |
| rates             | output_cost_per_mtok           | double    | Cost per million tokens for output.                                                                                                                                                                                                        |
| pricing_config    | source [*required*]            | object    | Source of the pricing data.                                                                                                                                                                                                                |
| source            | provider_id                    | string    | Pricing catalog provider identifier.                                                                                                                                                                                                       |
| source            | type [*required*]              | enum      | Source type for the pricing configuration. Allowed enum values: `catalog`, `custom`.                                                                                                                                                       |
| pricing_config    | tiers                          | [object]  | Custom prices that replace the base rates for the requests they select. Only valid for custom pricing. At most 16 tiers, and no two may share the same `service_tier` and `context_min_tokens`.                                            |
| tiers             | context_min_tokens             | int64     | Minimum input tokens for the price to apply.                                                                                                                                                                                               |
| tiers             | rates [*required*]             | object    | Rates that replace the base custom rates. At least one is required.                                                                                                                                                                        |
| rates             | cache_read_cost_per_mtok       | double    | Cost per million tokens for cache reads.                                                                                                                                                                                                   |
| rates             | cache_write_cost_per_mtok      | double    | Cost per million tokens for cache writes.                                                                                                                                                                                                  |
| rates             | non_cached_input_cost_per_mtok | double    | Cost per million tokens for non-cached input.                                                                                                                                                                                              |
| rates             | output_cost_per_mtok           | double    | Cost per million tokens for output.                                                                                                                                                                                                        |
| tiers             | service_tier                   | string    | Provider service tier the price applies to. Lowercase letters, digits, `_` and `-`.                                                                                                                                                        |
| pricing_config    | version [*required*]           | int64     | Pricing configuration version. The only supported version is `1`.                                                                                                                                                                          |
| attributes        | status                         | enum      | Whether the gateway has a price for the model. Allowed enum values: `priced`, `unpriced`.                                                                                                                                                  |
| attributes        | unpriced_description           | string    | Human-readable sentence for `unpriced_reason`. Omitted when the model is priced or the code has no description yet.                                                                                                                        |
| attributes        | unpriced_reason                | string    | Stable code explaining why the model has no price, such as `automatic_price_absent`. Omitted when the model is priced.                                                                                                                     |
| data              | id [*required*]                | string    | Resource identifier.                                                                                                                                                                                                                       |
| data              | type [*required*]              | enum      | Model pricing resource type. Allowed enum values: `model-pricing`.                                                                                                                                                                         |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "authoritative": true,
      "automatic_pricing": {
        "last_validated_at": "2026-08-24T12:00:00Z",
        "mapping": {
          "id": "mapping-a",
          "revision": "mapping-revision",
          "scope": "provider",
          "version": 1
        },
        "mode_triggers": [
          {
            "body": [
              {
                "name": "speed",
                "value": "fast"
              }
            ],
            "headers": [
              {
                "name": "speed",
                "value": "fast"
              }
            ],
            "mode": "fast"
          }
        ],
        "observed_at": "2026-08-24T12:00:00Z",
        "rates": [
          {
            "amount": "2.5",
            "component": "input",
            "context_max_tokens": 272000,
            "context_min_tokens": 0,
            "currency": "USD",
            "mode": "standard",
            "operation": "string",
            "service_tier": "priority",
            "unit": "million_tokens"
          }
        ],
        "source": {
          "match_method": "wire_id",
          "model_id": "gpt-5.2-codex",
          "name": "models.dev",
          "provider_id": "openai",
          "revision": "source-revision"
        },
        "stale": false
      },
      "blocks_budgeted_requests": false,
      "cost_multiplier": 1,
      "duration_priced": false,
      "effective_source": "string",
      "pricing_config": {
        "overrides": {
          "cache_read_cost_per_mtok": 0.6,
          "cache_write_cost_per_mtok": 7.5,
          "non_cached_input_cost_per_mtok": 6,
          "output_cost_per_mtok": 22.5
        },
        "rates": {
          "cache_read_cost_per_mtok": 0.6,
          "cache_write_cost_per_mtok": 7.5,
          "non_cached_input_cost_per_mtok": 6,
          "output_cost_per_mtok": 22.5
        },
        "source": {
          "provider_id": "openai",
          "type": "custom"
        },
        "tiers": [
          {
            "context_min_tokens": 200000,
            "rates": {
              "cache_read_cost_per_mtok": 0.6,
              "cache_write_cost_per_mtok": 7.5,
              "non_cached_input_cost_per_mtok": 6,
              "output_cost_per_mtok": 22.5
            },
            "service_tier": "priority"
          }
        ],
        "version": 1
      },
      "status": "priced",
      "unpriced_description": "string",
      "unpriced_reason": "automatic_price_absent"
    },
    "id": "gpt-4o",
    "type": "model-pricing"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export provider_id="42"
# Required query arguments
export canonical="openai/gpt-4o"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, 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/providers/${provider_id}/model-pricing?canonical=${canonical}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
