Class AiGatewayRateLimitCreateAttributes

Attributes used to create an AI Gateway rate limit.

Hierarchy

  • AiGatewayRateLimitCreateAttributes

Constructors

Properties

additionalProperties?: {
    [key: string]: any;
}

A container for additional, undeclared properties. This is a holder for any undeclared properties as specified with the 'additionalProperties' keyword in the OAS document.

Type declaration

  • [key: string]: any
costMicrocentsPerMinute?: number

Maximum priced spend per rolling minute, in microcents of 1e-8 USD each. In ENFORCE mode, the gateway rejects requests to models with no pricing because their cost can't be counted.

inputTokensPerMinute?: number

Maximum input tokens per rolling minute.

Action taken when request rate exceeds the limit.

name: string

Rate limit name. Must not be empty.

outputTokensPerMinute?: number

Maximum output tokens per rolling minute.

requestsPerMinute?: number

Maximum requests per rolling minute. At least one of requests_per_minute, input_tokens_per_minute, output_tokens_per_minute, cost_microcents_per_minute, or a non-empty window_limits is required.

Dimension rules for a template rate limit, which gives each matched user, Team, or value its own allowance with the rule's limits. Can't be combined with user_id, team_id, or tags, and can't be changed after creation. Omit for a rule with one shared allowance.

tags?: {
    [key: string]: string;
}

Optional scope tags, such as provider, model, ml_app, or custom dimensions. A request matches when it has all of these tags. The reserved metadata keys name, budget_name, and span_filter are rejected.

Type declaration

  • [key: string]: string
teamId?: string

Optional UUID. Count only requests attributed to this Datadog Team.

userId?: string

Optional UUID. Count only this user's requests.

Limits over rolling windows longer than a minute, such as $20 of spend per 24 hours. This field is available only to organizations with the feature enabled. Other organizations receive a 400 Bad Request response for a non-empty list. Each limit counts the rule's matching traffic, or each counter of a template rate limit, over its window. Set per-minute limits in the *_per_minute fields. A rule can have at most four limits in total, including any per-minute limits that are set. Each metric and window pair can appear only once, and for the same metric, a longer window must have a larger amount. In ENFORCE mode, the gateway rejects a request that exceeds any limit with HTTP 429 and a Retry-After header. If the list includes a cost limit, the gateway also rejects requests to models with no pricing because their cost can't be counted.

Generated using TypeDoc