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

Retrieve organization spend limit

admin.organization.spend_limit.retrieve() -> OrganizationSpendLimit
GET/organization/spend_limit

Get the organization’s hard spend limit.

ReturnsExpand Collapse
class OrganizationSpendLimit: …

Represents a hard spend limit configured at the organization level.

currency: Union[str, Literal["USD"]]

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

enforcement: Enforcement

The current enforcement state of the hard spend limit.

interval: Union[str, Literal["month"]]

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

object: Literal["organization.spend_limit"]

The object type, which is always organization.spend_limit.

threshold_amount: int

The hard spend limit amount, in cents.

Retrieve organization spend limit

import os
from openai import OpenAI

client = OpenAI(
    admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"),  # This is the default and can be omitted
)
organization_spend_limit = client.admin.organization.spend_limit.retrieve()
print(organization_spend_limit.currency)
{
    "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"
    }
}