---
title: List AI Gateway budget instances
description: List instance counters for an accounting window.
breadcrumbs: Docs > API > List AI Gateway budget instances
---

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

# List AI Gateway budget instances

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

### Overview

List instance counters for an accounting window. Legacy fixed-scope budgets return one pooled row with an empty instance_key. Omit window to use the current window. Use split_dim to keep 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. |
| sort      | enum    | Sort order for budget instance counters. Allowed enum values: `spend_desc`, `spend_asc`, `key_asc`. Default: `spend_desc`.                                                                                                                                                                                                                                                                                                         |
| limit     | integer | Maximum number of budget instance counters to return. Default: `50`.                                                                                                                                                                                                                                                                                                                                                               |
| offset    | integer | Number of budget instance counters to skip. Default: `0`.                                                                                                                                                                                                                                                                                                                                                                          |

### Response

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

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

| Parent field         | Field                                      | Type      | Description                                                                                         |
| -------------------- | ------------------------------------------ | --------- | --------------------------------------------------------------------------------------------------- |
|                      | data [*required*]                          | [object]  |                                                                                                     |
| data                 | attributes [*required*]                    | object    | One budget instance counter.                                                                        |
| attributes           | budget_id [*required*]                     | uuid      | Budget identifier.                                                                                  |
| attributes           | effective_capacity_microcents [*required*] | int64     | Capacity enforced for this instance, in microcents.                                                 |
| attributes           | instance_key [*required*]                  | string    | Opaque canonical counter key. Empty for legacy pooled counters.                                     |
| attributes           | modified_at [*required*]                   | date-time | Time the instance counter was last modified.                                                        |
| attributes           | spend_microcents [*required*]              | int64     | Spend counted against this instance, in microcents.                                                 |
| attributes           | split_dims [*required*]                    | object    | Dimension values decoded from instance_key. User and Team values are raw UUIDs.                     |
| additionalProperties | <any-key>                                  | string    |                                                                                                     |
| attributes           | window_start [*required*]                  | date-time | Start of the accounting window.                                                                     |
| data                 | id [*required*]                            | string    | Resource identifier.                                                                                |
| data                 | type [*required*]                          | enum      | Budget instance counter resource type. Allowed enum values: `budget-instances`.                     |
|                      | meta [*required*]                          | object    | Visibility information for identifying instance details.                                            |
| meta                 | restricted_details [*required*]            | boolean   | Whether identifying rows were withheld from the returned page. Pagination uses the underlying rows. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": [
    {
      "attributes": {
        "budget_id": "11111111-1111-1111-1111-111111111111",
        "effective_capacity_microcents": 100000000,
        "instance_key": "",
        "modified_at": "2026-10-05T12:00:00Z",
        "spend_microcents": 25000000,
        "split_dims": {
          "<any-key>": "string"
        },
        "window_start": "2026-10-01T00:00:00Z"
      },
      "id": "11111111-1111-1111-1111-111111111111|2026-10-01T00:00:00Z|",
      "type": "budget-instances"
    }
  ],
  "meta": {
    "restricted_details": false
  }
}
```
{% /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" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
