OpenAI Codex CLI
OpenAI lightweight open-source coding agent for the terminal.
Overview
Codex CLI is an open-source terminal agent from OpenAI that edits code and runs commands in a sandbox. It works with a ChatGPT plan or your own OpenAI API key, and can be pointed at other compatible providers.
- Sandboxed execution
- Approval modes
- MCP support
- IDE extension
Our verdict
What we like
- Fast and lightweight
- Open source
Watch out for
- Best results tied to OpenAI models
Works with these providers
Keys from these providers work in this app. Usage is billed by the provider at its list price.
BYOK Key Safety Score
Key handling in OpenAI Codex CLI
Grade A
Your key is stored on your device and requests go directly to the provider.
- Key storage40/40
Key stays on your device; requests go direct to the provider.
- Auditable code25/25
Open source: anyone can verify how keys are handled.
- Self-hosting8/15
Runs as a local app, but not as a self-hosted service.
- Offline option10/10
Supports local models, so no key is needed at all for private work.
- Provider choice6/10
3 provider options, which lets you pick the provider whose data terms you trust.
Whatever the score, give each app its own key, set a monthly spend limit with your provider, and revoke keys you no longer use. Read the key-safety checklist.
OpenAI Codex CLI FAQ
- Does OpenAI Codex CLI support bring your own key?
- Yes. OpenAI Codex CLI accepts your own API key from OpenAI, Ollama and OpenAI-compatible. Usage is billed by the provider at its API rates.
- Where does OpenAI Codex CLI store my API key?
- On your device. Requests go directly from OpenAI Codex CLI to the provider. Its BYOK Tools Key Safety Score is 89/100.
- Is OpenAI Codex CLI free?
- Open source: Free & open source; API usage billed. API usage is billed separately by your model provider.
- Is OpenAI Codex CLI open source?
- Yes. The source code is at https://github.com/openai/codex.
- Can OpenAI Codex CLI run local models?
- Yes. It can connect to local runtimes such as Ollama or LM Studio, so no API key is needed for private or offline use.
- Which platforms does OpenAI Codex CLI support?
- CLI, macOS, Linux, Windows.
Community reviews
No reviews yet.
Alternatives to OpenAI Codex CLI
All coding agents & ides →Aider
Coding Agents & IDEs
AI pair programming in your terminal with git-aware edits.
OpenCode
Coding Agents & IDEs
Open-source terminal coding agent that works with any provider.
Goose
Coding Agents & IDEs
Extensible open-source AI agent from Block for coding and beyond.
Crush
Coding Agents & IDEs
Glamorous terminal coding agent from Charm.
Zed
Coding Agents & IDEs
High-performance collaborative editor with a BYOK agent panel.
Claude Code
Coding Agents & IDEs
Anthropic agentic coding tool for the terminal, usable with an API key.