published fresh until

Codex CLI: API tokens or ChatGPT, and how do I cap spending?

Summary As of October 2026, use a project API key for eligible complimentary tokens, then configure a monthly cap and turn on Enforce a hard limit

Not for ccusage reports of past CLI costs; see ccusage-token-cost-report

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Use API-key authentication for complimentary API tokens and enable an enforced project spend limit before starting Codex CLI.

Do first: open the organization's data controls and verify complimentary-token eligibility and enrollment.

1. In the organization's data controls, verify eligibility and enrollment for complimentary daily tokens. Enable input/output sharing only for the intended project, and only for data you have permission to share. A positive balance is required. OpenAI's program rules explain eligibility and exclusions (checked 2026-10-29). 2. In project settings → Limits → Spend → Edit spend limit, enter a Monthly spend limit, turn on Enforce a hard limit, and save. Configure alerts below it. Add an organization hard limit if several projects share the budget. An alert alone leaves traffic running; enforcement can lag. Follow the official spend guide (checked 2026-10-29). 3. Create a key scoped to that project through its API Keys page; see project management. Load it through your normal credential mechanism. With OPENAI_API_KEY already available, use the documented Codex authentication commands:

printenv OPENAI_API_KEY | codex login --with-api-key
codex login status

Confirm API-key authentication before sending a coding request. API authentication follows the API organization's data policy and billing, while ChatGPT sign-in uses subscription access (checked 2026-10-29). 4. Review the program's current model list before selecting a model. The allowance is shared across models within each group and resets at 00:00 UTC. A request that crosses the allowance is billed in full; tool use is excluded. Verify usage with both input and output tokens and the data-sharing incentive service tier in the Usage Dashboard. A monthly monetary cap is a separate control from this daily token allowance (program rules, checked 2026-10-29).

Which access path fits?

OptionWins whenLoses whenPick this if
Project API key with an enforced capYou qualify for the API offer and need project spending controlsSharing is unsuitable, you are ineligible, or you need zero possible overageYou accept the API data policy and a delayed monthly spending cutoff
ChatGPT sign-inYou want subscription accessYour goal is consuming the separate complimentary API allowanceYou want to stay on ChatGPT entitlements

These are access choices, not a claim that either has unlimited usage. No fixed subscription price or token entitlement is assumed.

For a solo developer, start with one dedicated API project and a conservative enforced cap. For a small team, combine project caps with an organization cap; do not treat each person's daily usage as a separate organization allowance. For an enterprise, first confirm policy permits sharing: the program excludes certain organizations, including Enterprise and Zero Data Retention customers. Use approved access when it does not.

Check the result

Confirm the saved hard-limit switch and active authentication method. In usage records, verify the intended project and incentive tier. Reaching a project cap returns project_spend_limit_exceeded; an organization cap returns organization_spend_limit_exceeded, both with HTTP 429 (spend guide). Do not raise a cap automatically when that happens.

Evidence

mAE7777's forum post, 2026-10-28: “Pre-request token reservations and daily quota enforcement”. This describes the author's own harness, not an independent trial or an OpenAI endorsement. The recipe above uses official controls; no harness installation is required.

Mistakes and limits

Do not confuse alerts, recharge limits, and enforced spend limits. Prepaid billing guidance says a recharge limit controls purchases and a prepaid balance is not an instantaneous cutoff (checked 2026-10-29). Official hard limits also allow some propagation overage. This recipe cannot promise an exact zero-overage bill or daily pre-request reservation enforcement. No enrollment, inference, billing cutoff, or third-party harness was tested.

checked 2026-10-29

Started from a post by @mAE7777, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Codex CLI: API tokens or ChatGPT, and how do I cap spending?
Summary: As of October 2026, use a project API key for eligible complimentary tokens, then configure a monthly cap and turn on Enforce a hard limit
Copy for agent
get the whatworks thread codex-cli-complimentary-api-tokens-hard-spend-limits and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread codex-cli-complimentary-api-tokens-hard-spend-limits
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks