---
title: Get an AI Gateway rate limit counter summary
description: Aggregate a template rate limit's counters, including how many there are, how many are near or at their limit, and the fullest counter's utilization.
breadcrumbs: Docs > API > Get an AI Gateway rate limit counter summary
---

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

# Get an AI Gateway rate limit counter summary

## 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/rate-limits/{id}/instances/summary     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/rate-limits/{id}/instances/summary |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/rate-limits/{id}/instances/summary |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/rate-limits/{id}/instances/summary      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/rate-limits/{id}/instances/summary |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/rate-limits/{id}/instances/summary |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/rate-limits/{id}/instances/summary |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/rate-limits/{id}/instances/summary      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/rate-limits/{id}/instances/summary  |

### Overview

Aggregate a template rate limit's counters, including how many there are, how many are near or at their limit, and the fullest counter's utilization. Use split_dim to aggregate only counters that match every given dimension value. When the caller can't see the template's selector, every count is zero and scope_restricted is true. Summaries are cached for up to 15 seconds. Returns 503 when counter usage can't be read.

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      |
| --------------- | ------ | ---------------- |
| id [*required*] | string | Rate limit UUID. |

#### Query Strings

| Field     | Type  | Description                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| split_dim | array | Keep only counters whose split dimension equals a value, written as `<dim>=<value>`, such as `split_dim=user_id=<uuid>&split_dim=model=gpt-4o`. Dimensions use the `split_dims` names `user_id`, `team_id`, `model`, `provider`, and `tag:<key>`. Repeat the parameter to filter on several dimensions; a counter must match all of them. Each dimension may appear once and must be a per-value dimension of the rate limit. |

### Response

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

{% tabs %}
{% tab label="Model" %}
Response containing the aggregate of a template rate limit's counters.

| Parent field | Field                         | Type    | Description                                                                                                                                                                 |
| ------------ | ----------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]             | object  | Aggregate of a template rate limit's counters.                                                                                                                              |
| data         | attributes [*required*]       | object  | Aggregate of a template rate limit's counters.                                                                                                                              |
| attributes   | instance_count [*required*]   | int64   | Number of counters.                                                                                                                                                         |
| attributes   | limited_requests              | int64   | Requests the counters rejected in the last 15 minutes (ENFORCE), totaled over the counters whose usage was read.                                                            |
| attributes   | limiting_count [*required*]   | int64   | Counters that limited, or would have limited, a request in the last 15 minutes.                                                                                             |
| attributes   | max_utilization [*required*]  | double  | Utilization of the fullest counter.                                                                                                                                         |
| attributes   | near_limit_count [*required*] | int64   | Counters at 80% or more of a limit in the rolling window.                                                                                                                   |
| attributes   | rate_limit_id [*required*]    | uuid    | Rate limit UUID.                                                                                                                                                            |
| attributes   | scope_restricted              | boolean | True when the caller can't see the template's selector because it lists a provider or model the caller can't access. The counters are then hidden, and every count is zero. |
| attributes   | truncated [*required*]        | boolean | True when some recently active counters' usage wasn't read, so the counts may be low.                                                                                       |
| attributes   | would_limit_requests          | int64   | Requests the counters would have rejected in the last 15 minutes (ALERT), totaled over the counters whose usage was read.                                                   |
| data         | id [*required*]               | uuid    | Rate limit UUID.                                                                                                                                                            |
| data         | type [*required*]             | enum    | AI Gateway rate limit counter summary resource type. Allowed enum values: `rate-limit-instances-summary`.                                                                   |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "instance_count": 14,
      "limited_requests": 25,
      "limiting_count": 2,
      "max_utilization": 1.2,
      "near_limit_count": 3,
      "rate_limit_id": "33333333-3333-3333-3333-333333333333",
      "scope_restricted": false,
      "truncated": false,
      "would_limit_requests": 0
    },
    "id": "33333333-3333-3333-3333-333333333333",
    "type": "rate-limit-instances-summary"
  }
}
```
{% /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 id="33333333-3333-3333-3333-333333333333"

# 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/rate-limits/${id}/instances/summary" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
