---
title: "Get an AI Gateway budget"
method: GET
path: "/api/v2/budgets/{id}"
tags: ["AI Gateway"]
---

# Get an AI Gateway budget

`GET /api/v2/budgets/{id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/budgets/{id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `ai_gateway_config_read`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/budgets/:id/get.ts> (a function with typed inputs; its response is checked against the schema)

Get a spend budget by ID, including its capacity, scope, reset window, warning threshold, and enforcement mode.

## Path parameters

- `id` string, uuid, required

## Response `200`

OK

- AiGatewayBudgetResponse: Response containing one AI Gateway budget.
  - `data` AiGatewayBudgetResource, required: AI Gateway budget resource.
    - `attributes` AiGatewayBudgetAttributes, required: AI Gateway budget configuration and metadata.
      - `capacity_microcents` integer, required: Budget capacity in microcents.
      - `created_at` string, date-time, required: Time when the resource was created.
      - `created_by` string, required: Identifier of the principal that created the resource.
      - `enabled` boolean, required: Whether the resource is enabled.
      - `enforcement` 'BLOCK' | 'NOTIFY', required: Action taken when spend exceeds the budget.
      - `monitor_id` integer, nullable, required: Datadog monitor ID provisioned for this budget. Null when monitor provisioning was skipped or failed.
      - `name` string, required: Human-readable resource name.
      - `scope_restricted` boolean, required: Whether provider or model scope metadata was withheld. Omit unchanged scope fields on an unrelated update to preserve their saved values.
      - `selector` AiGatewayBudgetSelectorEntry[], nullable: Dimension rules for a template budget. A nonempty selector creates independent counters for matched instances. Omit or pass an empty selector for a legacy fixed-scope budget.
        - `dim` string, required: Dimension to match: user_id, team_id, model, provider, or tag:<key>. Reserved metadata tag keys are rejected.
        - `per_value` boolean, required: Separate counters by the matched value when true. Otherwise, pool spend within the other separated dimensions.
        - `values` string[]: Allowed dimension values. Omit to match any value, including an absent dimension. An explicit list must contain at least one value.
      - `tags` AiGatewayBudgetTags, required: Request tags that must match for the budget to apply.
      - `team_id` string, uuid: Optional Datadog Team scope.
      - `updated_at` string, date-time, required: Time when the resource was last updated.
      - `user_id` string, uuid: User scope. Omitted when the budget is not user-scoped.
      - `warning_threshold` number, double, required: Fraction of capacity at which to issue a warning.
      - `window_policy` 'DAILY' | 'WEEKLY' | 'MONTHLY', required: UTC accounting period for a budget.
    - `id` string, uuid, required: Resource identifier.
    - `type` 'budgets', required: AI Gateway budget resource type.

## Other responses

- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
