Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 113 additions & 5 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11356,6 +11356,14 @@ components:
AiGatewayRateLimitAttributes:
description: Attributes of an AI Gateway rate limit.
properties:
cost_microcents_per_minute:
description: Maximum priced spend per rolling minute, in microcents of 1e-8 USD each, shared by all matching traffic, or per counter for a template rate limit. Null when this rule does not limit cost.
example: 100000000
format: int64
maximum: 10000000000000
minimum: 1
nullable: true
type: integer
created_at:
description: Creation timestamp.
example: "2026-09-01T00:00:00Z"
Expand Down Expand Up @@ -11459,6 +11467,8 @@ components:
- scope_restricted
- name
- tags
- is_template
- template_split_dims
- mode
- enabled
- revision
Expand All @@ -11470,6 +11480,14 @@ components:
AiGatewayRateLimitCreateAttributes:
description: Attributes used to create an AI Gateway rate limit.
properties:
cost_microcents_per_minute:
description: Maximum priced spend per rolling minute, in microcents of 1e-8 USD each. At most 10000000000000, that is $100,000. In `ENFORCE` mode, requests to a model with no pricing are rejected, because their cost can't be counted.
example: 100000000
format: int64
maximum: 10000000000000
minimum: 1
nullable: true
type: integer
input_tokens_per_minute:
description: Maximum input tokens per rolling minute.
format: int64
Expand All @@ -11491,7 +11509,7 @@ components:
nullable: true
type: integer
requests_per_minute:
description: Maximum requests per rolling minute. At least one of `requests_per_minute`, `input_tokens_per_minute`, and `output_tokens_per_minute` is required.
description: Maximum requests per rolling minute. At least one of `requests_per_minute`, `input_tokens_per_minute`, `output_tokens_per_minute`, and `cost_microcents_per_minute` is required.
example: 600
format: int64
maximum: 10000000
Expand Down Expand Up @@ -11540,6 +11558,17 @@ components:
AiGatewayRateLimitInstanceAttributes:
description: One counter of a template rate limit and its live usage.
properties:
cost_microcents:
description: Priced spend, in microcents, counted in the rolling one-minute window. 0 when the rate limit doesn't limit cost.
example: 25000000
format: int64
type: integer
cost_microcents_per_minute:
description: The rate limit's per-counter spend limit, in microcents. Null when it doesn't limit cost.
example: 100000000
format: int64
nullable: true
type: integer
first_seen:
description: When the gateway first recorded a request for this counter.
example: "2026-10-28T10:00:00Z"
Expand All @@ -11561,7 +11590,7 @@ components:
example: "v1|7:user_id=36:11111111-1111-1111-1111-111111111111"
type: string
last_seen:
description: When the gateway last recorded a request for this counter; up to a few minutes behind live traffic.
description: When the gateway last saw this counter hot, that is near or at a limit or limiting; up to a few minutes behind live traffic.
example: "2026-10-28T10:05:00Z"
format: date-time
type: string
Expand Down Expand Up @@ -11684,7 +11713,7 @@ components:
description: Aggregate of a template rate limit's counters.
properties:
instance_count:
description: Number of counters.
description: Number of counters that were near or at a limit, or limited a request, in the last hour. Counters with room to spare aren't recorded.
example: 14
format: int64
type: integer
Expand Down Expand Up @@ -11734,6 +11763,17 @@ components:
- max_utilization
- truncated
type: object
AiGatewayRateLimitInstancesSummaryListResponse:
description: Response containing the counter summary of every template rate limit in the organization.
properties:
data:
items:
$ref: "#/components/schemas/AiGatewayRateLimitInstancesSummaryResource"
description: The aggregate of one template rate limit's counters.
type: array
required:
- data
type: object
AiGatewayRateLimitInstancesSummaryResource:
description: Aggregate of a template rate limit's counters.
properties:
Expand Down Expand Up @@ -11854,6 +11894,13 @@ components:
AiGatewayRateLimitUpdateAttributes:
description: Attributes used to update an AI Gateway rate limit. Only sent fields are changed.
properties:
cost_microcents_per_minute:
description: Spend limit in microcents per rolling minute. Set to 0 to remove the cost limit. Null is ignored. At least one limit must remain.
format: int64
maximum: 10000000000000
minimum: 0
nullable: true
type: integer
enabled:
description: Whether this rate limit is active.
type: boolean
Expand Down Expand Up @@ -11926,6 +11973,11 @@ components:
AiGatewayRateLimitUsageAttributes:
description: Live consumption of one AI Gateway rate limit.
properties:
cost_microcents:
description: Priced spend, in microcents, counted in the rolling one-minute window. Only rules with a cost limit count it, so it is 0 for other rules and for the untracked and total entries.
example: 25000000
format: int64
type: integer
input_tokens:
description: Input tokens counted in the rolling one-minute window.
example: 45000
Expand Down Expand Up @@ -231139,6 +231191,62 @@ paths:
x-unstable: |-
**Note**: This endpoint is in Preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/rate-limits/instances/summary:
get:
description: Aggregate the counters of every template rate limit in the organization in one call, with one summary per template in the order the rate limit list returns them. Each summary is the one the single-template counter summary endpoint returns without split_dim, including scope_restricted and truncated. Rate limits with one shared allowance are left out. Summaries are cached for up to 15 seconds.
operationId: ListAiGatewayRateLimitInstancesSummaries
responses:
"200":
content:
application/json:
examples:
default:
value:
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
- attributes:
instance_count: 0
limited_requests: 0
limiting_count: 0
max_utilization: 0
near_limit_count: 0
rate_limit_id: 44444444-4444-4444-4444-444444444444
scope_restricted: true
truncated: false
would_limit_requests: 0
id: 44444444-4444-4444-4444-444444444444
type: rate-limit-instances-summary
schema:
$ref: "#/components/schemas/AiGatewayRateLimitInstancesSummaryListResponse"
description: OK
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- ai_gateway_config_read
summary: List AI Gateway rate limit counter summaries
tags:
- AI Gateway
x-permission:
operator: OR
permissions:
- ai_gateway_config_read
x-unstable: |-
**Note**: This endpoint is in Preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/rate-limits/usage:
get:
description: Get live usage for the organization's rate limits. Returns requests and tokens counted in the rolling one-minute window and requests limited in the last 15 minutes for each enabled rate limit, plus `untracked` (traffic no enforced rate limit covers) and `total` (all gateway traffic).
Expand Down Expand Up @@ -231342,7 +231450,7 @@ paths:
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/rate-limits/{id}/instances:
get:
description: List the counters of a template rate limit, one per matched user, Team, or value, with their live usage. Counters appear within a few minutes of their first request and are dropped after 30 days without one. Usage is read for counters seen in the last 20 minutes, at most 200 per request; past that, rows carry usage_known false. Counters for a provider or model the caller can't see are left out, and when the caller can't see the template's selector, the list is empty. A rate limit with one shared allowance, including one whose selector has no per_value entry, returns an empty list. Returns 503 when counter usage can't be read.
description: List the hot counters of a template rate limit, one per matched user, Team, or value, with their live usage. Only counters at 80% or more of a limit, or that limited or would have limited a request, in the last hour are listed. A counter appears within a few minutes of becoming hot. Usage is read for at most 200 counters per request; past that, rows carry usage_known false. Counters for a provider or model the caller can't see are left out, and when the caller can't see the template's selector, the list is empty. A rate limit with one shared allowance, including one whose selector has no per_value entry, returns an empty list. Returns 503 when counter usage can't be read.
operationId: ListAiGatewayRateLimitInstances
parameters:
- $ref: "#/components/parameters/AiGatewayRateLimitID"
Expand Down Expand Up @@ -231403,7 +231511,7 @@ paths:
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/rate-limits/{id}/instances/summary:
get:
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. 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.
description: Aggregate a template rate limit's hot counters (those near or at a limit, or limiting, in the last hour), 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.
operationId: GetAiGatewayRateLimitInstancesSummary
parameters:
- $ref: "#/components/parameters/AiGatewayRateLimitID"
Expand Down
1 change: 1 addition & 0 deletions examples/v2/ai-gateway/CreateAiGatewayRateLimit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
body = DatadogAPIClient::V2::AiGatewayRateLimitCreateRequest.new({
data: DatadogAPIClient::V2::AiGatewayRateLimitCreateData.new({
attributes: DatadogAPIClient::V2::AiGatewayRateLimitCreateAttributes.new({
cost_microcents_per_minute: 100000000,
input_tokens_per_minute: nil,
mode: DatadogAPIClient::V2::AiGatewayRateLimitMode::ALERT,
name: "Default rate limit",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# List AI Gateway rate limit counter summaries returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.list_ai_gateway_rate_limit_instances_summaries".to_sym] = true
end
api_instance = DatadogAPIClient::V2::AIGatewayAPI.new
p api_instance.list_ai_gateway_rate_limit_instances_summaries()
1 change: 1 addition & 0 deletions examples/v2/ai-gateway/UpdateAiGatewayRateLimit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
body = DatadogAPIClient::V2::AiGatewayRateLimitUpdateRequest.new({
data: DatadogAPIClient::V2::AiGatewayRateLimitUpdateData.new({
attributes: DatadogAPIClient::V2::AiGatewayRateLimitUpdateAttributes.new({
cost_microcents_per_minute: nil,
input_tokens_per_minute: nil,
mode: DatadogAPIClient::V2::AiGatewayRateLimitMode::ALERT,
output_tokens_per_minute: nil,
Expand Down
Loading
Loading