OpenAI 获取组织支出提醒
2026-11-19 17:41 更新
获取组织支出提醒
get /organization/spend_alerts/{alert_id}
获取组织支出提醒。
路径参数
alert_id: string
要获取的支出提醒 ID。
返回值
OrganizationSpendAlert object { id, currency, interval, 3 more }
表示在组织级别配置的支出提醒。
id: string
标识符,可在 API 端点中引用。
currency: "USD"
阈值金额所用的币种。
"USD"
interval: "month"
用于评估支出是否达到阈值的时间区间。
"month"
notification_channel: object { recipients, type, subject_prefix }
支出提醒的电子邮件通知设置。
recipients: array of string
接收支出提醒通知的电子邮件地址。
type: "email"
通知渠道类型。目前仅支持 email。
"email"
subject_prefix: optional string or null
提醒邮件的可选主题前缀。
object: "organization.spend_alert"
对象类型,固定为 organization.spend_alert。
"organization.spend_alert"
threshold_amount: integer
提醒阈值金额,单位为美分。
示例
## 使用组织管理员密钥查询支出提醒,将路径中的提醒 ID 换成实际值。
curl "https://api.openai.com/v1/organization/spend_alerts/alert_abc123" \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json"
响应示例
{
"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 支出提醒"
}
}以上内容是否对您有帮助:

TRAE-AI编程


更多建议: