Skip to main content

OpenAI Codex API key setup

OpenAI's Codex coding agent (CLI, IDE, Web, Sites). Codex CLI runs locally in your terminal with a ChatGPT sign-in (free) or an OpenAI API key; the IDE integrates into VS Code; Codex Web runs cloud tasks asynchronously; Codex Sites builds workspace-internal web apps. Powered by GPT-5.5, with AGENTS.md configuration, 24 slash commands, approval modes, and role-specific plugins. Code review with in-place annotations is available on ChatGPT plans. ChatGPT plans (Plus, Pro, Business) add the IDE and Web surfaces with rate limits that scale by model tier.

Get your key

  1. Open the OpenAI Codex site: openai.com/codex/
  2. Create an account and generate an API key.
  3. Paste it into the Dracon key manager — stored encrypted (AES-256-GCM), used browser-direct, works in every Dracon tool.

Free tier

Yes. Codex CLI is free with a ChatGPT account (sign-in required). The Codex usage page or limit banner in the active CLI session is the canonical way to see remaining allowance and reset windows.

Rate limits: Codex usage: 1x tier (~20 messages/5hr, ChatGPT Plus) — base models. 5x tier (~100 messages/5hr, ChatGPT Pro) — all models. 20x tier (~200 messages/5hr, Business/Enterprise) — highest tier. Pro is higher-allowance, not unlimited. Windows reset on a 5-hour rolling basis. API-key usage is on a separate billing lane.

Connection details

Env var
OPENAI_API_KEY
Model lineup
codex-1, codex-mini, gpt-5-codex, gpt-5, gpt-4.1

Gotchas

Browser-direct chat is not available for this provider: CLI tool, not an API. The vault still stores its key for tools that run elsewhere (for example a LiteLLM chain from the router builder).

Add your OpenAI Codex key Build a fallback chain Compare free tiers