Is Codex CLI Free? Codex CLI Pricing & API Cost Breakdown (2026)
Finance teams keep asking the same question after engineers install OpenAI’s terminal agent: “Is Codex CLI free?” The installer costs $0, but every model call bills against either your ChatGPT subscription quota or API tokens. This guide maps both wallets, cites official Codex pricing, and shows how teams running always-on agents on a rented Mac mini LaunchAgent should budget separately for compute and inference.
Is Codex CLI free?
No—for sustained professional use. Codex CLI is free to download; inference is not free.
| Billing path | Install cost | Inference cost | Best for |
|---|---|---|---|
| ChatGPT sign-in (default) | $0 | Included in Plus ($20/mo) and higher | Interactive coding |
| API key mode | $0 | Per-token API rates | Overflow & automation |
| Free ChatGPT tier | $0 | Limited trial only | Evaluation, not production |
Quotable definition: Codex CLI is free to download; usage is not free—every model call consumes either ChatGPT plan quota or API tokens.
Two billing systems behind one terminal
OpenAI ships Codex in the CLI, IDE extensions, and cloud tasks, but operators only manage two wallets:
- Obra Superpowers coding agent install
- Subscription wallet (ChatGPT auth) — Local messages and cloud tasks share rolling five-hour windows. Plus users typically see about 30–150 GPT-5.3-Codex local messages per 5h depending on prompt size (see the limits table).
- API wallet (API key auth) — No included messages. Models bill per million input, cached input, and output tokens with a card on file.
Teams often keep ChatGPT auth on laptops and API keys for CI bursts—store keys with Keychain patterns on cloud Mac mini hosts.
ChatGPT plan snapshot (Codex-relevant)
| Plan | Monthly price | Codex CLI | Indicative GPT-5.3-Codex local / 5h |
|---|---|---|---|
| Free | $0 | Trial access | Not for production |
| Plus | $20 | Full CLI | ~30–150 messages |
| Pro $100 | $100 | Higher caps | ~150–750 messages |
| API key only | — | Usage-based | No included cap |
Subscription mode: limits, credits, and promos
Local messages and cloud tasks share one five-hour counter on ChatGPT-authenticated Codex. When you hit the ceiling, work pauses until the window resets, you buy credits, or you switch to a smaller model such as GPT-5.4-mini.
Monitor live usage with /status or enable /statusline in the CLI; reset timestamps appear on the Codex usage dashboard.
API key mode: per-token mechanics
With API key authentication, Codex behaves like any OpenAI API client. Model tier dominates spend; cloud tasks and GitHub code review are not available in pure API-key mode per OpenAI’s matrix.
Worked example: A 40-turn refactor averaging 8k input + 2k output tokens per turn on a mid-tier Codex model often lands in the $3–$12 range for that session—variance is normal when agents re-read entire repositories.
Real-world monthly cost bands
OpenAI cites $100–$200 per developer per month as a typical Codex-heavy average, with tails from $40 to $400+ when cloud tasks and Fast mode spike.
| Persona | Stack | Expected Codex spend |
|---|---|---|
| Plus individual | CLI + GPT-5.4-mini routine | $20 plan + $0–$30 credits |
| Pro engineer | CLI + cloud tasks | $100 plan + $50–$150 credits |
| Platform CI | API keys on cloud Mac mini | $200–$800+ API invoice |
| Hybrid fleet | MLX + Codex codegen | Lower API tail — see MLX spend guide |
Nine cost controls that move the needle
- Default to GPT-5.4-mini for lint and docstring work.
- Trim
AGENTS.mdand disable unused MCP servers. - Cap parallel agents — see concurrency ceilings.
- Disable Fast mode unless latency SLAs require it.
- Separate API keys per environment with budget alerts.
- Route summarization to local inference per MLX hybrid guide.
- Use ChatGPT auth interactively; API keys for bounded automation only.
- Stop 429 retry storms — failover playbook.
- Run long agents on always-on Mac mini instead of sleeping laptops.
Codex CLI on a cloud Mac mini (infrastructure vs tokens)
Codex bills inference to OpenAI; hardware is separate. Renting a Mac mini M4 (~$99/mo entry on ProxyMac) helps when you need 24/7 OpenClaw schedules, stable egress for corporate proxies, and unified memory for hybrid MLX + Codex—across HK / JP / KR / SG / US nodes. Model tokens still flow to OpenAI; compare ProxyMac pricing only after you forecast API spend.
FAQ
Related reading
Run Codex CLI on Apple Silicon
A ProxyMac Mac mini gives you dedicated compute for Codex CLI—infrastructure cost separate from token spend, available in HK, JP, KR, SG, and US.