---
title: "How Codex Rate Limits Work: 5-Hour, Weekly, Credits and API Keys"
description: "How OpenAI Codex rate limits work for ChatGPT subscriptions (5-hour and weekly windows), Business and Enterprise credit budgets, and API keys — and how to watch them from your menu bar."
canonical: "https://aibattery.dev/guides/codex-rate-limits"
source: "https://aibattery.dev/guides/codex-rate-limits.md"
published: 2026-10-11
modified: 2026-10-15
section: Codex
category: Understand limits
author: KyleNesium
license: MIT
language: en
---

# How Codex Rate Limits Work

OpenAI Codex — the CLI, the IDE extensions, and Codex in ChatGPT — runs on whichever OpenAI plan you sign in with, and that plan decides what limits you. There are three different shapes, and they behave differently enough that it helps to know which one you're on.

## ChatGPT subscriptions: 5-hour and weekly windows

On a ChatGPT Free, Plus, Pro, or Team subscription, Codex counts your usage against two rolling windows at once: a **5-hour window** that governs bursts, and a **weekly window** that governs sustained use. Each has its own percentage used and its own reset time, and whichever is closer to full is the one that stops you first — AI Battery marks it *binding*.

OpenAI reports both windows as a percentage of your plan's allowance rather than as a token count, so there is no fixed number to memorise: the usage endpoint says how much of the window you have used and when it resets, and that is exactly what AI Battery shows. Purchased credits, if you have bought any, appear as a separate balance under the windows.

## Business and Enterprise: a credit budget

Business and Enterprise workspaces don't use the two windows. Instead an administrator sets a **spend control** — an individual credit budget per user for the billing period. Codex reports how much of that budget you have used; when it is exhausted (or the workspace marks spend control as reached) Codex stops until the period resets or the budget is raised. Workspaces without an individual cap report as uncapped.

AI Battery shows this as a single **Credits** bar instead of the 5-hour / weekly pair, named after the budget OpenAI reports (for example the Business plan's limit) rather than the bare plan type, with "no cap" when there is no individual limit. Once AI Battery has watched the budget for an hour, the tooltip adds a runway — "~N d to limit" — paced from how fast you've been spending it this period.

## API keys: per-minute limits and a real bill

If you run `codex login --api-key` (or add a key in AI Battery), there are no plan windows at all. Every request is billed at OpenAI's API rates, and the only limits are the per-minute **request** and **token** rate limits OpenAI returns in its `x-ratelimit-*` response headers. They refill continuously, so hitting one means slowing down for a minute, not waiting hours.

Because there is no subscription behind an API key, the costs AI Battery shows for it are a real bill — they appear without the `~` prefix used for API-equivalent estimates everywhere else. (If a ChatGPT-backed Codex account is also signed in, the `~` stays: the CLI's sessions can't be attributed to the key.)

## 100% is "at capacity", not "throttled"

A window reading 100% means you have used your allowance; it does not by itself mean OpenAI is rejecting requests. Codex reports an explicit throttle (a `rate_limit_reached` status or an HTTP 429) when it is. AI Battery only shows the red "Limit reached" state and the broken menu bar star when the provider actually reports a throttle, and it holds a brand-new near-full reading for 10 minutes before trusting it, so one glitchy response can't paint a false alarm.

## How AI Battery reads them

- **ChatGPT sign-in or imported CLI login** — AI Battery reads the ChatGPT usage endpoint each refresh. It spends no tokens. If the endpoint is unreachable it falls back to the newest Codex CLI session log, which carries a recent snapshot of the same windows, and the footer says *Cached* — but only if that log is less than 7 days old, so a stale rollout can't stand in for a live reading.
- **API key** — AI Battery sends a 16-token probe each refresh and reads the per-minute limits from the response headers (billed at API rates; the refresh slider shows the cost).
- **Labels follow the provider** — the long window is called **Weekly**, the Usage link opens your ChatGPT usage page, and status alerts watch the Codex components of status.openai.com.
- **Alerts** — the Rate Limit alert threshold (50–95%) applies to both windows, or to the Credits budget on a spend-control plan.

## Pacing tips

- Watch the **weekly** window on Monday, not Friday — a 5-hour reset can't save a week you've already spent.
- Switch the menu bar metric to **Auto**: it surfaces whichever window is closest to stopping you.
- If you keep hitting the 5-hour window, long rollouts with big file reads are usually the cause — the same context discipline that helps Claude Code helps Codex.
- Running Claude Code and Codex side by side? Add both accounts: the popover opens on an overview with a card for each, and the menu bar leads with whichever is closer to its limit.

## Related guides

- [How Claude Code Rate Limits Work](https://aibattery.dev/guides/claude-code-rate-limits.md) — Everything you need to know about Claude Code rate limits: 5-hour burst windows, 7-day sustained limits, how they're calculated, and how to avoid hitting them mid-task.
- [AI Battery Settings Guide](https://aibattery.dev/guides/settings.md) — Every AI Battery setting explained: Claude and Codex accounts and the multi-account overview, refresh interval and per-poll cost, idle cutoff, display toggles, the menu bar metric picker and auto mode, alerts, launch at login, About and updates, and the context health indicators.
- [Understanding Claude Code's Context Window](https://aibattery.dev/guides/context-health.md) — How Claude Code context works, what auto-compaction does, and how to manage sessions for better results.

---

Part of [AI Battery guides](https://aibattery.dev/guides/index.md). AI Battery is a free, open-source macOS menu bar app for Claude Code and OpenAI Codex usage: https://aibattery.dev/
