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

Retrieve organization spend alert

OrganizationSpendAlert admin().organization().spendAlerts().retrieve(params = SpendAlertRetrieveParams.none(), requestOptions = RequestOptions.none())
GET
/organization/spend_alerts/{alert_id}

Retrieves an organization spend alert.

Retrieve organization spend alert

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.admin.organization.spendalerts.OrganizationSpendAlert;
import com.openai.models.admin.organization.spendalerts.SpendAlertRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        OrganizationSpendAlert organizationSpendAlert = client.admin().organization().spendAlerts().retrieve("alert_id");
    }
}
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"
    }
}
Parameters
SpendAlertRetrieveParams params
Optional<String> alertId
Returns
class OrganizationSpendAlert:

Represents a spend alert configured at the organization level.

String id

The identifier, which can be referenced in API endpoints.

Currency currency

The currency for the threshold amount.

Interval interval

The time interval for evaluating spend against the threshold.

NotificationChannel notificationChannel

Email notification settings for a spend alert.

JsonValue; object_
constant
constant

The object type, which is always organization.spend_alert.

long thresholdAmount

The alert threshold amount, in cents.

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"
    }
}