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

Retrieve a project spend alert

Retrieves a spend alert configured for a project. Supply project_id and alert_id to identify the project and the alert you want to inspect.

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

2 parameters
project_idstringrequired
The unique identifier of the project containing the spend alert.
alert_idstringrequired
The unique identifier of the project spend alert to retrieve.

1 status code
200Returns the 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

project_id must identify the project containing the alert, and alert_id must identify the project spend alert to retrieve. The returned alert uses USD and a monthly evaluation interval.