NAME
OpenAPI::Client::OpenAI::Path::organization-projects-project_id-spend_alerts - Documentation for the /organization/projects/{project_id}/spend_alerts path.
OPERATIONS
GET /organization/projects/{project_id}/spend_alerts
list-project-spend-alerts
$client->list_project_spend_alerts({
body => { ... },
});
Lists project spend alerts.
Path/query parameters
project_id(in path, required, string) - The ID of the project to inspect.limit(in query, optional, integer) - A limit on the number of spend alerts to return. Defaults to 20.order(in query, optional, string) - Sort order for the returned spend alerts.Allowed values: asc, desc
Default: asc
after(in query, optional, string) - Cursor for pagination. Provide the ID of the last spend alert from the previous response to fetch the next page.before(in query, optional, string) - Cursor for pagination. Provide the ID of the first spend alert from the previous response to fetch the previous page.
Responses
200 - Project spend alerts listed successfully.
Content-Type: application/json
Example:
{
"data" : [
"{\n \"id\": \"alert_abc123\",\n \"object\": \"project.spend_alert\",\n \"threshold_amount\": 100000,\n \"currency\": \"USD\",\n \"interval\": \"month\",\n \"notification_channel\": {\n \"type\": \"email\",\n \"recipients\": [\"finance@example.com\"],\n \"subject_prefix\": \"OpenAI spend alert\"\n }\n}\n"
],
"first_id" : "string",
"has_more" : false,
"last_id" : "string",
"object" : "list"
}
POST /organization/projects/{project_id}/spend_alerts
create-project-spend-alert
$client->create_project_spend_alert({
body => { ... },
});
Creates a project spend alert.
Path/query parameters
project_id(in path, required, string) - The ID of the project to update.
Responses
200 - Project spend alert created successfully.
Content-Type: application/json
Example:
{
"currency" : "USD",
"id" : "alert_abc123",
"interval" : "month",
"notification_channel" : {
"recipients" : [
"finance@example.com"
],
"subject_prefix" : "OpenAI spend alert",
"type" : "email"
},
"object" : "project.spend_alert",
"threshold_amount" : 100000
}
SCHEMAS
CreateSpendAlertBody
Properties:
currency(string, required) - The currency for the threshold amount.Allowed values: USD
interval(string, required) - The time interval for evaluating spend against the threshold.Allowed values: month
notification_channel(SpendAlertNotificationChannel, required)See "SpendAlertNotificationChannel" below for shape.
threshold_amount(integer, required) - The alert threshold amount, in cents.
ProjectSpendAlert
Properties:
currency(string, required) - The currency for the threshold amount.Allowed values: USD
id(string, required) - The identifier, which can be referenced in API endpoints.interval(string, required) - The time interval for evaluating spend against the threshold.Allowed values: month
notification_channel(SpendAlertNotificationChannel, required)See "SpendAlertNotificationChannel" below for shape.
object(string, required) - The object type, which is alwaysproject.spend_alert.Allowed values: project.spend_alert
threshold_amount(integer, required) - The alert threshold amount, in cents.
ProjectSpendAlertListResource
Properties:
data(array of ProjectSpendAlert, required) - Spend alerts returned in the current page.first_id(anyOf, required) - The ID of the first spend alert in this page.has_more(boolean, required) - Whether more spend alerts are available when paginating.last_id(anyOf, required) - The ID of the last spend alert in this page.object(string, required) - Alwayslist.Allowed values: list
SpendAlertNotificationChannel
Properties:
recipients(array of string, required) - Email addresses that receive the spend alert notification.subject_prefix(anyOf) - Optional subject prefix for alert emails.type(string, required) - The notification channel type. Currently onlyemailis supported.Allowed values: email
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (C) 2023-2026 by Nelson Ferraz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.