Skip to content
Primary navigation

List organization spend alerts

$ openai admin:organization:spend-alerts list
GET/organization/spend_alerts

Lists organization spend alerts.

ParametersExpand Collapse
--after: optional string

Cursor for pagination. Provide the ID of the last spend alert from the previous response to fetch the next page.

--before: optional string

Cursor for pagination. Provide the ID of the first spend alert from the previous response to fetch the previous page.

--limit: optional number

A limit on the number of spend alerts to return. Defaults to 20.

--order: optional "asc" or "desc"

Sort order for the returned spend alerts.

ReturnsExpand Collapse
OrganizationSpendAlertListResource: object { data, first_id, has_more, 2 more }

Paginated list of organization spend alerts.

data: array of OrganizationSpendAlert { id, currency, interval, 3 more }

Spend alerts returned in the current page.

id: string

The identifier, which can be referenced in API endpoints.

currency: "USD"

The currency for the threshold amount.

"USD"
interval: "month"

The time interval for evaluating spend against the threshold.

"month"
notification_channel: object { recipients, type, subject_prefix }

Email notification settings for a spend alert.

recipients: array of string

Email addresses that receive the spend alert notification.

type: "email"

The notification channel type. Currently only email is supported.

subject_prefix: optional string

Optional subject prefix for alert emails.

object: "organization.spend_alert"

The object type, which is always organization.spend_alert.

threshold_amount: number

The alert threshold amount, in cents.

first_id: string

The ID of the first spend alert in this page.

has_more: boolean

Whether more spend alerts are available when paginating.

last_id: string

The ID of the last spend alert in this page.

object: "list"

Always list.

List organization spend alerts

openai admin:organization:spend-alerts list \
  --admin-api-key 'My Admin API Key'
{
    "object": "list",
    "data": [
        {
            "id": "alert_abc123",
            "object": "organization.spend_alert",
            "threshold_amount": 100000,
            "currency": "USD",
            "interval": "month",
            "notification_channel": {
                "type": "email",
                "recipients": ["finance@example.com"],
                "subject_prefix": "OpenAI spend alert"
            }
        }
    ],
    "first_id": "alert_abc123",
    "last_id": "alert_abc123",
    "has_more": false
}
Returns Examples
{
    "object": "list",
    "data": [
        {
            "id": "alert_abc123",
            "object": "organization.spend_alert",
            "threshold_amount": 100000,
            "currency": "USD",
            "interval": "month",
            "notification_channel": {
                "type": "email",
                "recipients": ["finance@example.com"],
                "subject_prefix": "OpenAI spend alert"
            }
        }
    ],
    "first_id": "alert_abc123",
    "last_id": "alert_abc123",
    "has_more": false
}