Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

Update organization spend alert

$ openai admin:organization:spend-alerts update
POST
/organization/spend_alerts/{alert_id}

Updates an organization spend alert.

Parameters
--alert-id: string

The ID of the spend alert to update.

--currency: "USD"

The currency for the threshold amount.

--interval: "month"

The time interval for evaluating spend against the threshold.

--notification-channel: object { recipients, type, subject_prefix }

Email notification settings for a spend alert.

--threshold-amount: number

The alert threshold amount, in cents.

Returns
organization_spend_alert: object { id, currency, interval, 3 more }

Represents a spend alert configured at the organization level.

id: string

The identifier, which can be referenced in API endpoints.

currency: "USD"

The currency for the threshold amount.

interval: "month"

The time interval for evaluating spend against the threshold.

notification_channel: object { recipients, type, subject_prefix }

Email notification settings for a spend alert.

object: "organization.spend_alert"

The object type, which is always organization.spend_alert.

threshold_amount: number

The alert threshold amount, in cents.

Update organization spend alert

openai admin:organization:spend-alerts update \
  --admin-api-key 'My Admin API Key' \
  --alert-id alert_id \
  --currency USD \
  --interval month \
  --notification-channel '{recipients: [string], type: email}' \
  --threshold-amount 0
Response example
{
    "id": "alert_abc123",
    "object": "organization.spend_alert",
    "threshold_amount": 150000,
    "currency": "USD",
    "interval": "month",
    "notification_channel": {
        "type": "email",
        "recipients": ["finance@example.com"],
        "subject_prefix": "OpenAI spend alert"
    }
}
Returns Examples
Response example
{
    "id": "alert_abc123",
    "object": "organization.spend_alert",
    "threshold_amount": 150000,
    "currency": "USD",
    "interval": "month",
    "notification_channel": {
        "type": "email",
        "recipients": ["finance@example.com"],
        "subject_prefix": "OpenAI spend alert"
    }
}