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

Update organization spend limit

client.admin.organization.spendLimit.update(SpendLimitUpdateParams { currency, interval, threshold_amount } body, RequestOptionsoptions?): OrganizationSpendLimit { currency, enforcement, interval, 2 more }
POST/organization/spend_limit

Create or replace the organization’s hard spend limit.

ParametersExpand Collapse
body: SpendLimitUpdateParams { currency, interval, threshold_amount }
currency: "USD"

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

interval: "month"

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

threshold_amount: number

The hard spend limit amount, in cents.

minimum1
ReturnsExpand Collapse
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.

enforcement: Enforcement { status }

The current enforcement state of the hard spend limit.

interval: (string & {}) | "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: number

The hard spend limit amount, in cents.

Update organization spend limit

import OpenAI from 'openai';

const client = new OpenAI({
  adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});

const organizationSpendLimit = await client.admin.organization.spendLimit.update({
  currency: 'USD',
  interval: 'month',
  threshold_amount: 1,
});

console.log(organizationSpendLimit.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"
    }
}