## Update organization spend limit

`OrganizationSpendLimit admin().organization().spendLimit().update(SpendLimitUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/organization/spend_limit`

Create or replace the organization's hard spend limit.

### Parameters

- `SpendLimitUpdateParams params`

  - `Currency currency`

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

    - `USD("USD")`

  - `Interval interval`

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

    - `MONTH("month")`

  - `long thresholdAmount`

    The hard spend limit amount, in cents.

### Returns

- `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.

    - `USD("USD")`

  - `Enforcement enforcement`

    The current enforcement state of the hard spend limit.

    - `Status status`

      Whether the hard spend limit is currently enforcing.

      - `INACTIVE("inactive")`

      - `ENFORCING("enforcing")`

  - `Interval interval`

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

    - `MONTH("month")`

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

    The object type, which is always `organization.spend_limit`.

    - `ORGANIZATION_SPEND_LIMIT("organization.spend_limit")`

  - `long thresholdAmount`

    The hard spend limit amount, in cents.

### Example

```java
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.SpendLimitUpdateParams;

public final class Main {
    private Main() {}

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

        SpendLimitUpdateParams params = SpendLimitUpdateParams.builder()
            .currency(SpendLimitUpdateParams.Currency.USD)
            .interval(SpendLimitUpdateParams.Interval.MONTH)
            .thresholdAmount(1L)
            .build();
        OrganizationSpendLimit organizationSpendLimit = client.admin().organization().spendLimit().update(params);
    }
}
```

#### Response

```json
{
  "currency": "USD",
  "enforcement": {
    "status": "inactive"
  },
  "interval": "month",
  "object": "organization.spend_limit",
  "threshold_amount": 0
}
```
