Skip to content
Primary navigation

Retrieve organization spend limit

admin.organization.spend_limit.retrieve() -> OrganizationSpendLimit { currency, enforcement, interval, 2 more }
GET/organization/spend_limit

Get the organization’s hard spend limit.

ReturnsExpand Collapse
class OrganizationSpendLimit { currency, enforcement, interval, 2 more }

Represents a hard spend limit configured at the organization level.

currency: String | :USD

The currency for the threshold amount. Currently, only USD is supported.

One of the following:
String = String
Currency = :USD

The currency for the threshold amount. Currently, only USD is supported.

enforcement: Enforcement{ status}

The current enforcement state of the hard spend limit.

status: String | :inactive | :enforcing

Whether the hard spend limit is currently enforcing.

One of the following:
String = String
Status = :inactive | :enforcing

Whether the hard spend limit is currently enforcing.

One of the following:
:inactive
:enforcing
interval: String | :month

The time interval for evaluating spend against the threshold. Currently, only month is supported.

One of the following:
String = String
Interval = :month

The time interval for evaluating spend against the threshold. Currently, only month is supported.

object: :"organization.spend_limit"

The object type, which is always organization.spend_limit.

threshold_amount: Integer

The hard spend limit amount, in cents.

Retrieve organization spend limit

require "openai"

openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

organization_spend_limit = openai.admin.organization.spend_limit.retrieve

puts(organization_spend_limit)
{
    "object": "organization.spend_limit",
    "threshold_amount": 10000,
    "currency": "USD",
    "interval": "month",
    "enforcement": {
        "status": "enforcing"
    }
}
Returns Examples
{
    "object": "organization.spend_limit",
    "threshold_amount": 10000,
    "currency": "USD",
    "interval": "month",
    "enforcement": {
        "status": "enforcing"
    }
}