---
title: Update an AI Gateway model group
description: Update a model group.
breadcrumbs: Docs > API > Update an AI Gateway model group
---

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

# Update an AI Gateway model group

## 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 | PATCH https://api.datadoghq.com/api/v2/model-groups/{id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/model-groups/{id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/model-groups/{id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/model-groups/{id}      |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/model-groups/{id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/model-groups/{id} |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/model-groups/{id} |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/model-groups/{id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/model-groups/{id}  |

### Overview

Update a model group. For id "default", save membership and request options atomically with expected_revision. Empty selections grant no organization-wide access. Applicable authorized named policies override organization-wide request options; a rejected named-policy request cannot fall back to organization-wide options. The organization-wide audience is fixed and grants resource use only. Requires configuration write permission and policy View and Edit, including for the default policy. Management visibility does not change the inference audience or Run access.

This endpoint requires the `ai_gateway_config_write` permission.

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

### Arguments

#### Path Parameters

| Field           | Type   | Description                                                                    |
| --------------- | ------ | ------------------------------------------------------------------------------ |
| id [*required*] | string | Model group ID, or "default" for the explicit organization-wide access policy. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                   | Type      | Description                                                                                                                                                                                                                                                                                                    |
| ------------ | ----------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object    | Data used to update an AI Gateway model group.                                                                                                                                                                                                                                                                 |
| data         | attributes [*required*] | object    | Attributes used to update an AI Gateway model group.                                                                                                                                                                                                                                                           |
| attributes   | allow_fast_mode         | boolean   | Whether fast mode is allowed for models and routing rules in the group.                                                                                                                                                                                                                                        |
| attributes   | expected_revision       | int64     | Required when updating the default model group. Must match its current revision; a stale revision returns HTTP 409. Omit for named policies.                                                                                                                                                                   |
| attributes   | max_reasoning_level     | enum      | Maximum reasoning level. Null clears the group-specific limit. Allowed enum values: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`.                                                                                                                                                                |
| attributes   | model_ids               | [integer] | Individually selected model catalog IDs. Replaces visible selections and preserves saved hidden selections. Omit to preserve the complete selection; an empty array clears only visible selections. Null is invalid. Individual selections do not include future models. New selections require provider View. |
| attributes   | name                    | string    | Human-readable resource name.                                                                                                                                                                                                                                                                                  |
| attributes   | provider_ids            | [integer] | Explicit provider selections, including current and future models. Replaces visible selections and preserves saved hidden selections. Omit to preserve the complete selection; an empty array clears only visible selections. Null is invalid. New selections require provider View.                           |
| attributes   | routing_rule_slugs      | [string]  | Organization-unique routing rule slugs. Replaces visible route selections and preserves saved hidden selections. Omit to preserve all route selections; an empty array clears only visible selections. Null is invalid. New selections require route View.                                                     |
| data         | id [*required*]         | string    | Resource identifier.                                                                                                                                                                                                                                                                                           |
| data         | type [*required*]       | enum      | AI Gateway model group resource type. Allowed enum values: `model-groups`.                                                                                                                                                                                                                                     |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "allow_fast_mode": true,
      "expected_revision": "integer",
      "max_reasoning_level": "high",
      "model_ids": [],
      "name": "Coding models",
      "provider_ids": [],
      "routing_rule_slugs": [
        "coding-route"
      ]
    },
    "id": "7",
    "type": "model-groups"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

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

{% tabs %}
{% tab label="Model" %}
Response containing one AI Gateway model group.

| Parent field      | Field                             | Type      | Description                                                                                                                                                                                                                                          |
| ----------------- | --------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                   | data [*required*]                 | object    | AI Gateway model group resource.                                                                                                                                                                                                                     |
| data              | attributes [*required*]           | object    | Complete AI Gateway model group configuration.                                                                                                                                                                                                       |
| attributes        | allow_fast_mode [*required*]      | boolean   | Whether fast mode is allowed for models and routing rules in the group.                                                                                                                                                                              |
| attributes        | created_at [*required*]           | date-time | Time when the resource was created.                                                                                                                                                                                                                  |
| attributes        | max_reasoning_level [*required*]  | enum      | Maximum reasoning level. Null means there is no group-specific limit. Allowed enum values: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`.                                                                                               |
| attributes        | model_ids [*required*]            | [integer] | Saved model catalog IDs whose providers the caller can view. Hidden identities are omitted. The `models_restricted` field indicates hidden membership.                                                                                               |
| attributes        | models [*required*]               | [object]  | Metadata for saved model selections whose providers the caller can view. Hidden model identities and metadata are omitted.                                                                                                                           |
| models            | created_at [*required*]           | date-time | Time when the resource was created.                                                                                                                                                                                                                  |
| models            | enabled [*required*]              | boolean   | Whether the resource is enabled.                                                                                                                                                                                                                     |
| models            | id [*required*]                   | string    | Model catalog entry identifier.                                                                                                                                                                                                                      |
| models            | metadata                          | object    | Optional, typed enrichment for a model catalog entry. Missing properties remain unknown.                                                                                                                                                             |
| metadata          | capabilities [*required*]         | object    | Model features reported by the enrichment source. Omitted properties are unknown.                                                                                                                                                                    |
| capabilities      | attachment                        | boolean   | Whether attachment input is supported.                                                                                                                                                                                                               |
| capabilities      | interleaved_reasoning             | boolean   | Whether reasoning can be interleaved with tool use.                                                                                                                                                                                                  |
| capabilities      | reasoning                         | boolean   | Whether reasoning is supported.                                                                                                                                                                                                                      |
| capabilities      | structured_output                 | boolean   | Whether structured output is supported.                                                                                                                                                                                                              |
| capabilities      | temperature                       | boolean   | Whether temperature can be configured.                                                                                                                                                                                                               |
| capabilities      | tool_call                         | boolean   | Whether tool calls are supported.                                                                                                                                                                                                                    |
| metadata          | description                       | string    | Human-readable model description.                                                                                                                                                                                                                    |
| metadata          | display_name                      | string    | Human-readable model name.                                                                                                                                                                                                                           |
| metadata          | family                            | string    | Model family identifier.                                                                                                                                                                                                                             |
| metadata          | kind                              | enum      | Primary model kind. Decision models return a choice or score instead of generated text. Allowed enum values: `language`, `embedding`, `image`, `audio`, `decision`, `reranking`.                                                                     |
| metadata          | knowledge_cutoff                  | string    | Knowledge cutoff reported by the source.                                                                                                                                                                                                             |
| metadata          | last_updated                      | string    | Date the source record was last updated.                                                                                                                                                                                                             |
| metadata          | lifecycle                         | enum      | Model lifecycle state. Allowed enum values: `active`, `alpha`, `beta`, `deprecated`.                                                                                                                                                                 |
| metadata          | limits [*required*]               | object    | Token limits reported by the enrichment source.                                                                                                                                                                                                      |
| limits            | context_window_tokens             | int64     | Total model context window in tokens.                                                                                                                                                                                                                |
| limits            | max_input_tokens                  | int64     | Maximum input tokens when reported separately.                                                                                                                                                                                                       |
| limits            | max_output_tokens                 | int64     | Maximum output tokens.                                                                                                                                                                                                                               |
| metadata          | modalities [*required*]           | object    | Supported model input and output modalities.                                                                                                                                                                                                         |
| modalities        | input                             | [string]  |                                                                                                                                                                                                                                                      |
| modalities        | output                            | [string]  |                                                                                                                                                                                                                                                      |
| metadata          | open_weights                      | boolean   | Whether model weights are openly available.                                                                                                                                                                                                          |
| metadata          | reasoning                         | object    | Supported reasoning controls. Absence means controls are unknown or unavailable.                                                                                                                                                                     |
| reasoning         | controls [*required*]             | [object]  |                                                                                                                                                                                                                                                      |
| controls          | effort_levels                     | [string]  | Supported effort values in provider order for an effort control.                                                                                                                                                                                     |
| controls          | max_budget_tokens                 | int64     | Maximum reasoning-token budget.                                                                                                                                                                                                                      |
| controls          | min_budget_tokens                 | int64     | Minimum reasoning-token budget.                                                                                                                                                                                                                      |
| controls          | type [*required*]                 | enum      | Reasoning-control mechanism. Allowed enum values: `toggle`, `effort`, `budget_tokens`.                                                                                                                                                               |
| metadata          | reference_pricing                 | [object]  | Provider-specific reference prices from the enrichment source. Omitted for shared canonical-model fallback matches. These do not determine gateway charges.                                                                                          |
| reference_pricing | amount [*required*]               | string    | Exact decimal amount per unit, zero or greater, represented as a string to preserve precision. Supports fixed decimal and exponent notation.                                                                                                         |
| reference_pricing | component [*required*]            | string    | Token category priced, such as input, output, cache_read, or cache_write.                                                                                                                                                                            |
| reference_pricing | context_max_tokens                | int64     | Largest input length covered by this price. Omitted when there is no upper bound.                                                                                                                                                                    |
| reference_pricing | context_min_tokens [*required*]   | int64     | Input length above which this price applies. Zero identifies the base tier.                                                                                                                                                                          |
| reference_pricing | currency [*required*]             | string    | Currency of the price. The only supported value is USD.                                                                                                                                                                                              |
| reference_pricing | mode [*required*]                 | string    | Source mode name. Standard is the base mode; other values, such as fast, are source-defined.                                                                                                                                                         |
| reference_pricing | service_tier                      | string    | Provider service tier explicitly associated with this mode by the source. Omitted when unknown.                                                                                                                                                      |
| reference_pricing | unit [*required*]                 | string    | Unit of the quoted amount. The only supported value is million_tokens.                                                                                                                                                                               |
| metadata          | release_date                      | string    | Model release date.                                                                                                                                                                                                                                  |
| metadata          | source [*required*]               | object    | Provenance for model metadata enrichment.                                                                                                                                                                                                            |
| source            | matched_by [*required*]           | enum      | Identifier strategy used to match the gateway catalog entry. Date-suffix and shared canonical-model fallback matches produce partial metadata. Allowed enum values: `override`, `wire_id`, `canonical_id`, `wire_id_date_suffix`, `canonical_model`. |
| source            | model_id [*required*]             | string    | Model identifier in the metadata source provider catalog.                                                                                                                                                                                            |
| source            | name [*required*]                 | string    | Metadata source name.                                                                                                                                                                                                                                |
| source            | observed_at                       | date-time | Last successful observation of this valid source record. Retained invalid entries keep their previous timestamp.                                                                                                                                     |
| source            | provider [*required*]             | string    | Provider namespace in the metadata source, or canonical for a shared model record.                                                                                                                                                                   |
| source            | revision                          | string    | SHA-256 content revision of the source snapshot that supplied this record.                                                                                                                                                                           |
| metadata          | status [*required*]               | enum      | Completeness of the matched source record. Partial also identifies metadata from a base model for a dated snapshot or from a shared canonical-model fallback. Allowed enum values: `available`, `partial`.                                           |
| models            | model_id_canonical [*required*]   | string    | Provider-independent model identifier.                                                                                                                                                                                                               |
| models            | model_id_wire [*required*]        | string    | Model identifier sent to the provider.                                                                                                                                                                                                               |
| models            | provider_id [*required*]          | int64     | Provider identifier.                                                                                                                                                                                                                                 |
| models            | source [*required*]               | enum      | How a model catalog entry is managed. Allowed enum values: `discovered`, `manual`.                                                                                                                                                                   |
| models            | supported_operations [*required*] | [string]  | Operations supported by the model.                                                                                                                                                                                                                   |
| models            | updated_at [*required*]           | date-time | Time when the resource was last updated.                                                                                                                                                                                                             |
| attributes        | models_restricted                 | boolean   | Whether some saved models are hidden from the caller. Hidden identities, names, and counts are omitted. Editing visible selections preserves hidden memberships. Read-only.                                                                          |
| attributes        | name [*required*]                 | string    | Human-readable resource name.                                                                                                                                                                                                                        |
| attributes        | provider_ids [*required*]         | [integer] | Explicitly selected provider IDs the caller can view. Hidden identities are omitted. The `providers_restricted` field indicates hidden membership.                                                                                                   |
| attributes        | providers [*required*]            | [object]  | Viewable explicitly selected providers, separate from individually selected models. Hidden provider identities and metadata are omitted.                                                                                                             |
| providers         | id [*required*]                   | int64     | Provider ID.                                                                                                                                                                                                                                         |
| providers         | name [*required*]                 | string    | Provider display name.                                                                                                                                                                                                                               |
| attributes        | providers_restricted              | boolean   | Whether some saved providers are hidden from the caller. Hidden identities, names, and counts are omitted. Editing visible selections preserves hidden memberships. Read-only.                                                                       |
| attributes        | revision                          | int64     | Revision of the organization-wide policy. Present for the default model group and absent for named policies.                                                                                                                                         |
| attributes        | routing_rules [*required*]        | [object]  |                                                                                                                                                                                                                                                      |
| routing_rules     | slug [*required*]                 | string    | Organization-unique routing rule slug.                                                                                                                                                                                                               |
| attributes        | routing_rules_restricted          | boolean   | Whether some saved routes are hidden from the caller. Omit routing_rule_slugs to preserve all memberships; replacing the visible selection also preserves saved hidden memberships. Read-only.                                                       |
| attributes        | updated_at [*required*]           | date-time | Time when the resource was last updated.                                                                                                                                                                                                             |
| data              | id [*required*]                   | string    | Resource identifier.                                                                                                                                                                                                                                 |
| data              | type [*required*]                 | enum      | AI Gateway model group resource type. Allowed enum values: `model-groups`.                                                                                                                                                                           |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "allow_fast_mode": true,
      "created_at": "2026-08-24T12:00:00Z",
      "max_reasoning_level": "high",
      "model_ids": [
        101
      ],
      "models": [
        {
          "created_at": "2026-08-24T12:00:00Z",
          "enabled": true,
          "id": "101",
          "metadata": {
            "capabilities": {
              "attachment": false,
              "interleaved_reasoning": false,
              "reasoning": false,
              "structured_output": false,
              "temperature": false,
              "tool_call": false
            },
            "description": "string",
            "display_name": "string",
            "family": "string",
            "kind": "string",
            "knowledge_cutoff": "string",
            "last_updated": "string",
            "lifecycle": "string",
            "limits": {
              "context_window_tokens": 400000,
              "max_input_tokens": "integer",
              "max_output_tokens": 128000
            },
            "modalities": {
              "input": [
                "text"
              ],
              "output": [
                "text"
              ]
            },
            "open_weights": false,
            "reasoning": {
              "controls": [
                {
                  "effort_levels": [
                    "high"
                  ],
                  "max_budget_tokens": "integer",
                  "min_budget_tokens": "integer",
                  "type": "effort"
                }
              ]
            },
            "reference_pricing": [
              {
                "amount": "2.5",
                "component": "input",
                "context_max_tokens": 272000,
                "context_min_tokens": 0,
                "currency": "USD",
                "mode": "standard",
                "service_tier": "priority",
                "unit": "million_tokens"
              }
            ],
            "release_date": "string",
            "source": {
              "matched_by": "wire_id",
              "model_id": "gpt-5.2-codex",
              "name": "models.dev",
              "observed_at": "2019-09-19T10:00:00.000Z",
              "provider": "openai",
              "revision": "string"
            },
            "status": "available"
          },
          "model_id_canonical": "gpt-5.2-codex",
          "model_id_wire": "gpt-5.2-codex-20260801",
          "provider_id": 42,
          "source": "discovered",
          "supported_operations": [
            "OPENAI_CHAT_COMPLETIONS"
          ],
          "updated_at": "2026-08-24T12:00:00Z"
        }
      ],
      "models_restricted": true,
      "name": "Coding models",
      "provider_ids": [
        42
      ],
      "providers": [
        {
          "id": 42,
          "name": "production-us"
        }
      ],
      "providers_restricted": true,
      "revision": "integer",
      "routing_rules": [
        {
          "slug": "coding-route"
        }
      ],
      "routing_rules_restricted": true,
      "updated_at": "2026-08-24T12:00:00Z"
    },
    "id": "7",
    "type": "model-groups"
  }
}
```
{% /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="403" %}
Forbidden

{% 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="409" %}
Conflict

{% 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 id="7"

# 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 PATCH "https://api.${DD_SITE}/api/v2/model-groups/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "allow_fast_mode": true,
      "max_reasoning_level": "high",
      "model_ids": [
        101
      ],
      "name": "Coding models",
      "routing_rule_slugs": [
        "coding-route"
      ]
    },
    "id": "7",
    "type": "model-groups"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
