API Reference
Log In
API Reference

Update an AI anomaly (alert rule)

Updates an alert rule.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The ID of the alert rule, returned when the alert rule was created: a short string ID such as jR2kmLs. A fired alert has its own, different ID.

Body Params

Alert rule that monitors AI metrics and costs and fires an alert when its condition is met. Supports threshold-based rules, relative change detection, and cumulative usage tracking

string
required

The name of the alert rule

Metadata of a resource

string | null
required

The unique identifier of the team that owns this alert rule.

string
enum
required

The monitoring strategy of the alert rule. THRESHOLD monitors for absolute values exceeding a threshold, RELATIVE_CHANGE monitors for percentage changes between periods, CUMULATIVE_USAGE monitors for total usage over a period

Allowed:
string | null
enum

The data source for this alert rule. SDK uses real-time SDK instrumentation data, PROVIDER uses provider-synced billing data (OpenAI, Anthropic, etc.)

Allowed:
string
enum
required

The AI metric to monitor. Cost metrics track spending, token metrics track usage, performance metrics track latency and duration, error metrics track failures

string
enum
required

The comparison operator used to evaluate the threshold. Comparison operators (GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL_TO, LESS_THAN_OR_EQUAL_TO) compare absolute values and are the only operators accepted for THRESHOLD and CUMULATIVE_USAGE alert rules. Change operators (PERCENT_INCREASE, PERCENT_DECREASE, INCREASES_BY, DECREASES_BY) compare relative changes between periods and are the only operators accepted for RELATIVE_CHANGE alert rules

number
required

The numeric threshold value that fires the alert. For percentage-based rules (when isPercentage is true), this represents the percentage value (e.g., 50 for 50%). For absolute value rules, this is the metric value to compare against

notificationAddresses
array of strings

Email addresses to notify when an alert fires. Multiple addresses can be specified. Each address receives an email notification when the alert rule's condition is met

notificationAddresses
slackConfigurations
array of strings

Slack configuration IDs to notify when an alert fires. Each configuration represents a Slack workspace and channel where notifications will be posted

slackConfigurations
string | null

Optional description providing additional context about the alert rule's purpose and configuration

string | null
enum
required

The time period over which the metric is evaluated. For THRESHOLD and RELATIVE_CHANGE alert rules, this determines the evaluation window. For CUMULATIVE_USAGE alert rules, this determines the accumulation period

boolean
required

Whether the alert rule is on. When false, the alert rule is paused but kept: it does not evaluate conditions or send notifications.

filters
array of objects | null

Filter criteria to limit the scope of what the alert rule monitors. Each filter specifies a dimension (e.g., ORGANIZATION, PRODUCT, MODEL), an operator (e.g., IS, CONTAINS), and a value to match. The IN ("is one of") operator takes a list in values instead and matches any listed entry. Only metrics matching all filters are evaluated

filters
webhookConfigurations
array of strings

Webhook configuration IDs to notify when an alert fires. Each configuration represents a webhook endpoint that receives a POST request with alert details

webhookConfigurations
string | null
enum

The dimension by which to group monitoring. When specified, the alert rule is evaluated separately for each unique value of this dimension (e.g., per ORGANIZATION, per MODEL, per PRODUCT)

string | null
enum

The duration the alert rule's condition must persist before an alert fires. This prevents false positives from transient spikes. If null, the alert fires immediately when the condition is met. Not supported on RELATIVE_CHANGE alert rules.

int32 | null

Minimum number of quality facts required before a QUALITY_RATE rule can fire. A quality fact is one quality_rate outcome metric reported for a job of the rule's job type. Below this floor the evaluation reports insufficient coverage. Null uses a one-sample safety floor on create and preserves the existing floor on update

boolean | null

Whether the threshold value represents a percentage. When true, the threshold is interpreted as a percentage value. When false or null, the threshold is an absolute value

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*