Sample - OpenAI API
POST/organization/projects/{project_id}/spend_alerts/{alert_id}

Update a project spend alert

Updates a spend alert configured for a project. Provide the complete alert configuration, including the threshold, USD currency, monthly interval, and email notification channel.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 4 body fields
project_idstringrequired
The unique identifier of the project containing the spend alert.
alert_idstringrequired
The unique identifier of the project spend alert to update.

Complete project spend alert configuration, including its threshold, evaluation interval, and email notification settings.

threshold_amountintegerrequired
The alert threshold amount, in cents.
currencystringrequired
The currency for the threshold amount.
Allowed:USD
intervalstringrequired
The time interval for evaluating spend against the threshold.
Allowed:month
notification_channelobjectrequired
Email notification settings for a spend alert.

1 status code
200Returns the updated project spend alert with its identifier, object type, threshold amount, currency, interval, and notification channel.
idstringrequired
The identifier, which can be referenced in API endpoints.
objectstringrequired
The object type, which is always `project.spend_alert`.
Allowed:project.spend_alert
threshold_amountintegerrequired
The alert threshold amount, in cents.
currencystringrequired
The currency for the threshold amount.
Allowed:USD
intervalstringrequired
The time interval for evaluating spend against the threshold.
Allowed:month
notification_channelobjectrequired
Email notification settings for a spend alert.

Error handling

threshold_amount, currency, interval, and notification_channel are required in the update body. threshold_amount must be 0 or greater, currency must be USD, interval must be month, and the notification channel type must be email.