---
title: Get an AI Gateway budget instance summary
description: Aggregate counters for an accounting window, including total spend and the numbers of instances at or above the warning threshold and capacity.
breadcrumbs: Docs > API > Get an AI Gateway budget instance summary
---

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

# Get an AI Gateway budget instance 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/budgets/{id}/instances/summary     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/budgets/{id}/instances/summary |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/budgets/{id}/instances/summary |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/budgets/{id}/instances/summary      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/budgets/{id}/instances/summary |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/budgets/{id}/instances/summary |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/budgets/{id}/instances/summary |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/budgets/{id}/instances/summary      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/budgets/{id}/instances/summary  |

### Overview

Aggregate counters for an accounting window, including total spend and the numbers of instances at or above the warning threshold and capacity. Use split_dim to aggregate only counters that match every given dimension value.

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 | Budget UUID. |

#### Query Strings

| Field     | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| window    | string | RFC3339 timestamp inside the desired accounting window. Omit to use the current window.                                                                                                                                                                                                                                                                                                                                            |
| split_dim | array  | Keep only instance counters whose split dimension equals a value, written as `<dim>=<value>`, such as `split_dim=user_id=<uuid>&split_dim=tag:env=prod`. 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 budget. |

### Response

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

{% tabs %}
{% tab label="Model" %}
Response containing aggregate state across budget instance counters.

| Parent field | Field                                     | Type      | Description                                                                                                                   |
| ------------ | ----------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]                         | object    | Aggregate state across budget instance counters.                                                                              |
| data         | attributes [*required*]                   | object    | Aggregate state across budget instance counters.                                                                              |
| attributes   | budget_id [*required*]                    | uuid      | Budget identifier.                                                                                                            |
| attributes   | exceeded_capacity_count [*required*]      | int64     | Number of instances at or above capacity.                                                                                     |
| attributes   | instance_count [*required*]               | int64     | Number of instance counters.                                                                                                  |
| attributes   | over_warning_threshold_count [*required*] | int64     | Number of instances at or above the warning threshold.                                                                        |
| attributes   | restricted_details [*required*]           | boolean   | Whether instances were withheld because their provider or model is hidden. Summary counts and totals exclude those instances. |
| attributes   | total_spend_microcents [*required*]       | int64     | Spend summed across all instances, in microcents.                                                                             |
| attributes   | window_start [*required*]                 | date-time | Start of the accounting window.                                                                                               |
| data         | id [*required*]                           | uuid      | Resource identifier.                                                                                                          |
| data         | type [*required*]                         | enum      | Budget instance summary resource type. Allowed enum values: `budget-instances-summary`.                                       |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "budget_id": "11111111-1111-1111-1111-111111111111",
      "exceeded_capacity_count": 0,
      "instance_count": 3,
      "over_warning_threshold_count": 1,
      "restricted_details": false,
      "total_spend_microcents": 75000000,
      "window_start": "2026-10-01T00:00:00Z"
    },
    "id": "11111111-1111-1111-1111-111111111111",
    "type": "budget-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="11111111-1111-1111-1111-111111111111"

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