Codex: Quota exceeded. Check your plan and billing details

Uncategorized


1) Why you get “Quota exceeded” even with 1000 Codex credits

Codex has two sign-in modes

Codex supports:

  • Sign in with ChatGPT → uses your ChatGPT/Codex plan limits + credits
  • Sign in with API key → uses OpenAI Platform (API) billing at standard API rates (OpenAI Developers)

So if your CLI is currently authenticated with an API key, Codex is trying to charge your Platform API account, not your Codex credits. (OpenAI Developers)

Your 1000 credits are “Flexible usage credits” (Codex + Sora), not API credits

Credits are a pay-as-you-go add-on for Codex & Sora when you exceed plan limits. They are not the same thing as Platform API billing. (OpenAI Help Center)

That’s also why your Platform usage can stay at $0: if the API request is blocked due to quota/billing, it may fail before any billable usage is recorded.


2) Fix: make Codex CLI actually use your Codex credits

Step A — Check what auth mode your CLI is using

Run:

codex login status

This prints the active authentication mode. (OpenAI Developers)

Step B — If it’s using API key mode, wipe credentials and re-login with ChatGPT

codex logout
codex login
  • codex logout removes saved credentials (both API key and ChatGPT auth). (OpenAI Developers)
  • codex login (without flags) starts the ChatGPT OAuth login by default. (OpenAI Developers)

If you’re on a headless/remote machine:

codex login --device-auth

(OpenAI Developers)

Step C — Make sure you’re not forcing API-key auth accidentally

Check and remove any API-key forcing:

  • Environment variable in your shell:
echo $OPENAI_API_KEY

If it prints something, unset it (for this terminal):

unset OPENAI_API_KEY

Also note Codex caches login locally (often at ~/.codex/auth.json or keychain). (OpenAI Developers)

Step D — Confirm inside Codex

In a running Codex session, use:


3) If you want to use API keys (Platform billing), here’s what “Quota exceeded” usually means

If you authenticate with an API key, you must have Platform billing enabled (payment method/credits/spend limit > 0). Codex pricing explicitly says API-key usage is usage-based and charged at standard API rates. (OpenAI Developers)

So the fix is on the Platform side:

  • Add a payment method / enable pay-as-you-go
  • Ensure the project/org tied to that API key has a non-zero spend allowance

(Your Platform Usage page showing $0 doesn’t prove billing is enabled—it just means no successful billable calls happened.)


4) About your other error: organization_id did not match the target organization

That happens when credentials/tokens were created for one org/workspace but you’re trying to use them against another context (common when switching accounts, workspaces, or mixing keys/logins). Codex explicitly notes it caches credentials and reuses them until you logout. (OpenAI Developers)
Solution: codex logout + login again with the correct account/workspace.


5) Very important: you pasted a live API key in chat

Please revoke that key immediately in the Platform dashboard and create a new one. Treat it like a password.


Quick “who tracks what?” (so you’re no longer confused)

ChatGPT / Codex / Sora (consumer apps)

OpenAI Platform (API)

  • Usage appears in Platform Usage
  • Charged by tokens (LLMs) or per-second (video) depending on model type (OpenAI)

If you do just one thing now

Run:

codex logout
codex login
codex login status

Leave a Reply