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

List project spend alerts

Lists the spend alerts configured for a project. Use limit, order, after, and before to control the page size, sort order, and cursor position when retrieving alerts.

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

5 parameters
project_idstringrequired
The unique identifier of the project whose spend alerts to retrieve.
limitintegeroptional
The maximum number of spend alerts to return, from 0 through 100. Defaults to 20 when omitted.
orderstringoptional
The sort order for spend alerts: asc or desc. Defaults to asc when omitted.
Allowed:ascdescDefault:asc
afterstringoptional
The ID of the last spend alert from the previous page, used to retrieve the next page.
beforestringoptional
The ID of the first spend alert from the previous page, used to retrieve the previous page.

1 status code
200Returns a paginated list containing the current project spend alerts, the first and last alert IDs, and a `has_more` indicator.
objectstringrequired
Always `list`.
Allowed:list
dataarray<object>required
Spend alerts returned in the current page.
first_idstringrequired
The ID of the first spend alert in this page.
last_idstringrequired
The ID of the last spend alert in this page.
has_morebooleanrequired
Whether more spend alerts are available when paginating.

Error handling

project_id must identify the project whose alerts you want to inspect. limit must be between 0 and 100, and order must be either asc or desc; limit defaults to 20 and order defaults to asc when omitted.