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

OrganizationSpendLimit admin().organization().spendLimit().retrieve(SpendLimitRetrieveParamsparams = SpendLimitRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/organization/spend_limit

Get the organization’s hard spend limit.

ParametersExpand Collapse
SpendLimitRetrieveParams params
ReturnsExpand Collapse
class OrganizationSpendLimit:

Represents a hard spend limit configured at the organization level.

Currency currency

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

Enforcement enforcement

The current enforcement state of the hard spend limit.

Interval interval

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

JsonValue; object_ "organization.spend_limit"constant"organization.spend_limit"constant

The object type, which is always organization.spend_limit.

long thresholdAmount

The hard spend limit amount, in cents.

Retrieve organization spend limit

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.admin.organization.spendlimit.OrganizationSpendLimit;
import com.openai.models.admin.organization.spendlimit.SpendLimitRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        OrganizationSpendLimit organizationSpendLimit = client.admin().organization().spendLimit().retrieve();
    }
}
{
    "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"
    }
}