OpenAI Codex Pricing (2026): API Cost, Credits & Usage Limits Explained
Articles
7 min

OpenAI Codex Pricing (2026): API Cost, Credits & Usage Limits Explained

Dora Gurova
By
Dora Gurova
Updated:
March 7, 2026

OpenAI Codex costs nothing extra if you're on a paid ChatGPT plan — but usage is capped, and the API charges per token. Here's the short version:

How you use Codex What you pay
ChatGPT Plus / Pro / Business / Edu / Enterprise Included — usage limits apply
Extra usage beyond plan limits Buy additional credits
Codex CLI with API key Per-token billing (GPT-4.1 / GPT-5 Codex)
Free tier Trial API credits only — no ongoing free plan

This article explains OpenAI Codex pricing, covering:

  • OpenAI Codex API pricing
  • Codex CLI pricing
  • OpenAI Codex usage limits
  • GPT-5 Codex pricing
  • Codex pricing per token
  • What’s included for free
  • How Codex pricing works across ChatGPT Plus, Pro, Business, Edu, and Enterprise

OpenAI Codex pricing depends on your ChatGPT plan

Codex is included in the following plans:

  • ChatGPT Plus
  • ChatGPT Pro
  • ChatGPT Business
  • ChatGPT Edu
  • ChatGPT Enterprise

Your plan defines how much Codex usage you get before you need to buy additional credits.

OpenAI Codex Usage Limits (2025)

Codex usage is limited and resets periodically depending on the plan. Limits vary by:

  • Whether tasks run locally (CLI, IDE) or in the cloud (ChatGPT)
  • The selected model (GPT-4.1, GPT-4.1-mini, GPT-5 Codex, etc.)
  • Complexity of code (multi-file projects consume more)
  • Conversation/context length

What counts toward Codex usage?

  • Code generation
  • Multi-file edits
  • File creation & refactoring
  • Code transformations
  • ChatGPT coding sessions
  • Codex IDE tasks
  • Local CLI tasks (unless API key is used)

When you hit your limit

You can purchase extra ChatGPT credits to continue using Codex without upgrading your plan.

This applies to:

  • Plus
  • Pro
  • Business
  • Edu
  • Enterprise

OpenAI Codex Pricing (2025) summary table

Here is a clean breakdown:

Aspect Pricing Model Notes
ChatGPT Access Included in Plus, Pro, Business, Edu, Enterprise No standalone Codex subscription
Usage Limits Vary by plan Can buy additional credits
CLI (ChatGPT Auth) Uses plan limits Local tasks count
CLI (API Key) API per-token pricing No plan limits
IDE Extension Same as CLI Choose ChatGPT or API key
API Pricing Per-token Cost depends on GPT-4.1 / GPT-5 model
Free Tier Trial API credits only No free Codex plan

Codex CLI Pricing (2025)

Codex CLI now supports two billing modes:

1. ChatGPT authentication (default)

You consume Codex usage limits from your ChatGPT plan.

2. API Key Mode - Per-Token Billing

You can switch the CLI to API mode:

preferred_auth_method = "apikey"

In this mode, you pay OpenAI API pricing per token, based on the model:

  • GPT-4.1-mini Codex → cheapest
  • GPT-4.1 Codex → mid-tier
  • GPT-5 Codex → highest cost

This satisfies SEO queries like:

  • openai codex api pricing 2025
  • openai codex pricing per token
  • codex api pricing

This mode is essential when your ChatGPT limits are too small for large projects.

OpenAI Codex API Pricing (Per Token)

When using the Codex API (via an API key), cost depends entirely on:

  • Input tokens (your prompt + file context)
  • Output tokens (generated code)
  • Model type

OpenAI charges per 1M tokens, and GPT-5 Codex is the premium tier.

Is OpenAI Codex free?

You only get limited free trial API credits. You must be on a paid ChatGPT tier to use Codex consistently.

Who is Codex best for?

Codex is ideal for:

  • Developers writing or editing code daily
  • Large codebases requiring multi-file refactoring
  • GitHub workflows (PR reviews)
  • CLI/IDE workflows
  • Teams that prefer code-first development

Codex is not an app generator. It doesn’t:

  • Build UI
  • Create full apps
  • Connect databases
  • Manage end-user permissions
  • Deploy or host software

If you need full-stack app generation - keep reading.

Alternative: UI Bakery (for full app generation)

While OpenAI Codex is the best-in-class AI coding assistant, it's optimized for writing code, not building entire web applications.

If your goal is to generate apps from natural language, not just code snippets, a tool like UI Bakery AI Agent fills the gap.

What UI Bakery offers

  • Generates multi-page applications
  • Builds UI automatically
  • Connects to SQL/NoSQL databases, APIs, GraphQL
  • Creates multi-step backend workflows
  • Provides role-based permissions
  • Includes AI usage credits in every plan
  • Built-in environments, audit logs, export, viewer seats

Pricing Snapshot (Cloud, 2025)

  • Free - unlimited apps, sources, hosted DB, monthly AI trial credits
  • Builder ($20/mo developer) - includes $25 AI credits
  • Team ($35/mo developer) - includes $40 AI credits, RBAC, audit logs
  • Enterprise - custom, with dedicated VM & >50 viewer seats

If Codex helps you write code, UI Bakery helps you ship finished apps.

Wrapping up

OpenAI Codex pricing (2025) is flexible but complex, combining:

  • Subscription-based access (ChatGPT)
  • Usage limits
  • Optional API per-token billing
  • CLI & IDE dual-billing modes

Codex is unbeatable for coding, refactoring, and developer workflows, especially with GPT-5 Codex models.

But if you’re looking to generate production-ready software, not just code, consider pairing Codex with a dedicated AI app generator like UI Bakery - ideal for producing entire UIs, databases, and workflows from a single natural language prompt.

FAQ

How much does OpenAI Codex cost per month? 

Codex is included in ChatGPT Plus ($20/mo), Pro ($200/mo), Business ($30/user/mo), Edu, and Enterprise. There is no standalone Codex subscription. If you exceed plan limits, you can purchase additional credits.

How much does the Codex API cost per token? 

API pricing depends on the model. GPT-4.1-mini Codex is the cheapest tier; GPT-4.1 Codex is mid-tier; GPT-5 Codex is the premium option. OpenAI charges per 1M tokens (input + output separately). Switch CLI to API key mode with preferred_auth_method = "apikey" to use per-token billing.

Is OpenAI Codex free? 

Not on an ongoing basis. New accounts get limited trial API credits. Sustained Codex use requires a paid ChatGPT plan or API key with a billing method on file.

What counts toward Codex usage limits? 

Code generation, multi-file edits, file creation and refactoring, ChatGPT coding sessions, IDE tasks, and local CLI tasks (when using ChatGPT auth, not an API key).

What happens when I hit my Codex usage limit? 

You can purchase extra ChatGPT credits to continue without upgrading your plan. This applies to Plus, Pro, Business, Edu, and Enterprise.

Does Codex CLI cost money? 

In ChatGPT auth mode (default), CLI usage draws from your plan's Codex limits at no extra charge. If you switch to API key mode, you're billed per token at standard API rates.