> ## Documentation Index
> Fetch the complete documentation index at: https://docs.marginfront.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set a Hard Spend Ceiling for Codex at OpenAI

> The real hard stops for Codex spend live at OpenAI. Which one you can set depends on how your Codex is billed.

# Set a Hard Spend Ceiling for Codex at OpenAI

MarginFront meters what your team spends on Codex and can pause work on machines where it's installed. That's a guardrail, not a wall.

The stops nobody at your company can remove are the ones OpenAI runs on its own servers. This page shows you which of those you're allowed to set, based on how your company pays for Codex, and exactly where to set it.

**OpenAI's stops fail closed: the server refuses the request. MarginFront's device cap fails open: it's a guardrail, never a wall.**

> **Everything here was checked on 2026-07-28 and every claim carries its source link.** OpenAI changes these controls. Open the linked page yourself before you commit a budget to it.

***

## Fail closed vs fail open (read this first)

Two kinds of limit. The difference is the whole point of this page.

**Fail closed is a locked door.** The stop lives on OpenAI's servers. When the number is hit, OpenAI refuses the request. Nobody at your company can argue past it, because the thing saying no isn't on their laptop. If it breaks, it stays shut.

**Fail open is a seatbelt.** MarginFront's device cap runs on the developer's own machine. When the cap is hit it pauses work and tells them to come find you. If the check can't read its data, if the machine is offline, if somebody uninstalls it, work keeps going. A broken guardrail should never brick a developer's day, so it doesn't.

Which do you want? Both, for different jobs.

* You want **fail closed** for the number you'd have to explain to your board. One ceiling at OpenAI, set once, that nothing gets past.
* You want **fail open** for the day-to-day. Per-developer visibility, a weekly budget, and a nudge that stops a runaway session long before it becomes the board conversation. That's [Track Claude Code & Codex Spend](/tools/code-cost-clarity).

Set the OpenAI ceiling high enough that hitting it is a genuine emergency. Run your real budget with the day-to-day guardrail underneath it.

***

## Find your billing mode first

Every lever below depends on this one answer. Ask whoever pays the OpenAI bill.

| How your team runs Codex                                     | Your section                                              |
| ------------------------------------------------------------ | --------------------------------------------------------- |
| Signed in with an OpenAI API key, billed on the API Platform | [API key billing](#api-key-billing)                       |
| ChatGPT Enterprise or Edu workspace seats                    | [ChatGPT Enterprise and Edu](#chatgpt-enterprise-and-edu) |
| ChatGPT Business workspace seats                             | [ChatGPT Business](#chatgpt-business)                     |
| Personal ChatGPT Plus or Pro accounts                        | [ChatGPT Plus and Pro](#chatgpt-plus-and-pro)             |

A team can be in more than one mode at once (some developers on API keys, some on personal Plus seats). Each mode needs its own ceiling. A ceiling in one mode does nothing for the others.

Free and Go personal seats include Codex too. For a ceiling they work like [ChatGPT Plus and Pro](#chatgpt-plus-and-pro): no admin lever.

*Source: [Codex pricing](https://learn.chatgpt.com/codex/pricing), retrieved 2026-07-28: "ChatGPT Work and Codex are included in your ChatGPT Free, Go, Plus, Pro, Business, Edu, or Enterprise plan."*

***

## API key billing

**This is the strongest lever OpenAI offers.** It's a real hard stop, and it's the only mode with a documented way to set that stop from code.

**What it does.** You set a monthly spend limit on your organization, on an individual project, or both. Turn on **Enforce a hard limit** and OpenAI stops serving traffic at that number: "When tracked spend reaches an applicable hard limit, affected API requests return a `429` error with the `insufficient_quota` code."

**Hard stop or alert?** Hard stop, at OpenAI. Spend alerts are the separate, softer control on the same page: an alert "Sends a notification; API traffic continues." Alerts don't enforce a cap. You can run both, so an email warns you before the wall arrives.

**Where to click.**

1. Go to **Organization limits** (`https://platform.openai.com/settings/organization/limits`).
2. Under **Spend**, select **Edit spend limit**.
3. Enter the **Monthly spend limit**.
4. Turn on **Enforce a hard limit**. This step is the one that makes it a wall instead of a note.
5. Select **Save**.

You need permission to manage the organization or project settings you're editing.

**Or set it from code.** OpenAI's Admin API creates or replaces the organization's monthly hard limit at `/v1/organization/spend_limit`. The amount is in cents, so the example below sets \$100 a month.

```bash theme={null}
curl -X POST https://api.openai.com/v1/organization/spend_limit \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "threshold_amount": 10000,
    "currency": "USD",
    "interval": "month"
  }'
```

> **An Admin key isn't a developer key.** It can change your billing controls. Keep it in your secret manager and run this from a machine you control. It never belongs on a developer's laptop, and MarginFront never asks for it.

**The limits of this limit.**

* **Monthly only.** The cap covers a monthly cycle and resets with the next one. There's no weekly or per-developer version here.
* **It overshoots a little.** OpenAI is explicit: "Enforcement is not instantaneous. The API Platform can process a small amount of extra usage while the limit state propagates, so recorded spend can slightly exceed the configured amount." Treat the number as a ceiling with a small ledge on top, not a razor line.
* **Turning it back on takes a moment too.** "Raising or removing the reached limit allows traffic to resume after the update propagates."
* **Two limits can both apply.** An organization hard limit covers traffic across every project. A project hard limit covers only that project. Reaching either one returns the `429`.
* **Your tier's usage limit is a separate thing.** OpenAI also assigns your organization an approved monthly usage limit based on its usage tier. That isn't the limit you set, and hitting it looks different when you're diagnosing a `429`.

*Sources: [OpenAI spend limits guide](https://developers.openai.com/api/docs/guides/spend-limits) and [OpenAI Admin APIs guide](https://developers.openai.com/api/docs/guides/admin-apis), both retrieved 2026-07-28.*

***

## ChatGPT Enterprise and Edu

**Two separate controls, and you want both.** One caps what each person can use. The other caps how far the whole workspace can run past its plan.

**What it does.**

* **Usage limits** set a monthly limit for each user. You can apply a workspace default, group defaults, and per-user overrides on top. Only workspace admins and owners can configure them.
* **The workspace overage limit** caps eligible usage beyond your committed plan. **Set it to 0 and the workspace can't go into overage at all.** Leaving it on "No limit" means no cap is configured on eligible overage usage. "No limit" doesn't make credits free; eligible overage usage continues and may be billed under your agreement.

**Hard stop or alert?** Hard stop, at OpenAI. Exhausted limits can pause access to eligible features. The overage limit at 0 means the workspace isn't allowed into overage.

**Where to click.** Both live in the Global Admin Console, in the usage and billing settings for the workspace. Members and analytics viewers can't change them, so this has to be done by an admin or owner.

**Or set it from code.** Eligible Enterprise and Edu workspaces get OpenAI's **Spend Controls API**, which automates the same monthly limits at the workspace, group, and user level. It's called with a workspace-scoped Admin key, created in the Global Admin Console under **Credentials > Admin keys**, carrying these scopes:

* `chatgpt.enterprise.usage_limit.read` to read the current usage-limit settings.
* `chatgpt.enterprise.usage_limit.write` to change them.

That Admin key is an administrative credential. It doesn't authenticate model requests, and it should never sit on a developer's machine.

**The limits of this limit.**

* **Monthly only,** same as every other ceiling on this page.
* **"Eligible workspace" isn't defined publicly.** Confirm with your OpenAI account contact that your workspace has the Spend Controls API before anyone plans work around it. The console controls are the safe assumption; the API is the one to verify.
* **The API's exact routes sit behind an authenticated reference.** You need to be signed in as an admin to read them, so budget a little time before writing any automation.
* **This covers ChatGPT workspace usage, not your API Platform bill.** If you also run API keys, that's a second ceiling in a different place. See [API key billing](#api-key-billing).

> **OpenAI's help center blocks automated readers.** We confirmed the linked article's contents through a rendering proxy on 2026-07-28. Open it in a browser yourself before you set policy off it.

*Sources: [Manage usage limits and overages in ChatGPT Enterprise and Edu](https://help.openai.com/en/articles/20001001-manage-usage-limits-and-overages-in-chatgpt-enterprise-and-edu) and [ChatGPT usage limits and spend controls](https://learn.chatgpt.com/docs/enterprise/usage-limits), both retrieved 2026-07-28.*

***

## ChatGPT Business

**By default, all seats and users have no limits specified.** If nobody has been into these settings, your Business workspace has no ceiling at all. Check this before you assume a previous admin set one.

**What it does.** You set a credit maximum per seat type, and you can override it for individual people. It's the console equivalent of the Enterprise usage limits, one tier down.

**Hard stop or alert?** A configured credit maximum is a limit at OpenAI, not a notification. The catch is entirely the default: unset means unlimited, so the control only helps once somebody sets it.

**Where to click.**

1. Go to **Workspace settings**, then **Billing**.
2. Find the seat type you want to cap and select **Add** to set a credit maximum.
3. To cap one person instead, select **Manage** on that seat type, then **Add** to set that person's limit. A per-user limit overrides the seat-type limit.

**While you're in there, check auto top-up.** If a **Minimum balance** and **Target balance** are set, ChatGPT automatically charges the payment method on file to refill credits whenever the balance drops below the minimum. That's a spend accelerator sitting next to your spend limit. Know which one you've turned on.

**The limits of this limit.**

* **Console only.** The Spend Controls API is an Enterprise and Edu feature. On Business, somebody sets these by hand, so put a calendar reminder on reviewing them.
* **Monthly only,** same as the rest.
* **Unset is the dangerous state,** and it's also the shipped state.

*Source: [Managing credits and spend controls in ChatGPT Business](https://help.openai.com/en/articles/20001155-managing-credits-and-spend-controls-in-chatgpt-business), retrieved 2026-07-28. This article also blocks automated readers and was confirmed through a rendering proxy; open it in a browser before you set policy off it.*

***

## ChatGPT Plus and Pro

**There's no admin lever here.** Plus and Pro are personal plans. OpenAI publishes spend controls for API Platform organizations and for Business, Enterprise, and Edu workspaces. It publishes no admin spend-limit control for a personal Plus or Pro seat, because there's no admin console over somebody's personal account.

**What you actually get.** The plan's own usage limits, which are OpenAI's product limits and not your budget, plus the option for the user to buy more credits when they run out. Buying more credits is the opposite of a ceiling.

**What to do instead.** Two honest options.

1. **Move those developers to a billing mode that has a ceiling.** An API key on your organization, or a Business, Enterprise, or Edu workspace seat. This is the only way to get a fail-closed stop for their Codex work.
2. **Accept a fail-open guardrail and know what you bought.** [MarginFront's device cap](/tools/code-cost-clarity) meters the spend and pauses work on machines where it's installed. A developer can take it off, and it can't see a machine that never installed it. For personal seats it's the only control that exists, and it's a seatbelt.

If your Codex-heavy people are on personal Plus or Pro seats, option 1 is the one that changes your risk. Option 2 makes the spend visible, which is worth a lot, but it'll never be the wall.

*Source: [Codex pricing](https://learn.chatgpt.com/codex/pricing), retrieved 2026-07-28, which lists Plus and Pro as personal plans with usage limits and purchasable credits and documents no admin spend control for them.*

***

## What none of these do

True in every mode above. Worth knowing before you promise a number to anyone.

* **Monthly only.** Every OpenAI ceiling here runs on a monthly cycle. You can't express "\$200 per developer per week" at OpenAI. That shape of budget has to live somewhere else.
* **One provider only.** An OpenAI ceiling caps OpenAI. It knows nothing about what your team spends with Anthropic, Google, or xAI, so it can't be your whole-company AI budget.
* **Alerts notify. They don't stop.** The documented notification channel for spend alerts is email. An alert is a heads-up, not a brake.
* **Codex has no dollar cap of its own.** There's no "cap Codex at \$X" switch inside Codex. Every stop above is an account control that Codex activity draws against. OpenAI says it plainly about the workspace controls: they "aren't a universal Codex limit system and don't govern OpenAI API Platform billing."
* **Enforcement isn't instant.** Expect a small overshoot on the way up and a short delay on the way back down after you raise a limit.

*Sources: [OpenAI spend limits guide](https://developers.openai.com/api/docs/guides/spend-limits), [OpenAI Admin APIs guide](https://developers.openai.com/api/docs/guides/admin-apis), and [ChatGPT usage limits and spend controls](https://learn.chatgpt.com/docs/enterprise/usage-limits), all retrieved 2026-07-28.*

***

## Belt and suspenders

The two controls do different jobs, and neither one replaces the other.

|                           | OpenAI's spend limit     | MarginFront's device cap                    |
| ------------------------- | ------------------------ | ------------------------------------------- |
| Where it runs             | OpenAI's servers         | The developer's machine                     |
| When it breaks            | Stays shut (fail closed) | Lets work through (fail open)               |
| Can a developer remove it | No                       | Yes                                         |
| Time window               | Monthly                  | Whatever window your admin sets             |
| Covers                    | OpenAI spend             | The AI coding spend it meters               |
| Good for                  | The emergency ceiling    | The daily budget and the per-developer view |

Set the ceiling at OpenAI for the number that would actually hurt. Run the daily budget with [Track Claude Code & Codex Spend](/tools/code-cost-clarity), and set those caps from code with [MarginFront's Spend Controls API](/api-reference/spend-controls). You're still responsible for your real OpenAI charges either way.
