Retrieve organization spend alert
client.admin.organization.spendAlerts.retrieve(stringalertID, RequestOptionsoptions?): OrganizationSpendAlert { id, currency, interval, 3 more }
GET/organization/spend_alerts/{alert_id}
Retrieve organization spend alert
import OpenAI from 'openai';
const client = new OpenAI({
adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});
const organizationSpendAlert = await client.admin.organization.spendAlerts.retrieve('alert_id');
console.log(organizationSpendAlert.id);{
"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
{
"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"
}
}