Documentation Menu
Codex CLI
Use the pre-installed OpenAI Codex CLI in your gateway for AI-assisted coding with OpenAI models.
On this page
What It Is
Every BrainRoad gateway includes OpenAI Codex CLI pre-installed globally via npm. It is available from the Console as soon as your agent starts.
Codex is OpenAI’s command-line coding agent. It can read files, write code, run commands, and work through multi-step development tasks using OpenAI models.
Requirements
Codex requires an OpenAI API key. Set it in the console:
export OPENAI_API_KEY="sk-your-key-here"
Quick Start
codex "list all files and explain the project structure"
For interactive mode:
codex
When to Use Codex vs Claude Code
Both are pre-installed and both handle coding tasks. The difference is which AI provider they use:
| Tool | Provider | API Key Needed |
|---|---|---|
claude | Anthropic (Claude) | ANTHROPIC_API_KEY |
codex | OpenAI (GPT/o-series) | OPENAI_API_KEY |
Use whichever matches the API key you have configured, or try both to compare results on a given task.
Related Docs
- Claude Code CLI — Anthropic’s coding CLI (also pre-installed)
- Console Overview — how to access the terminal
- Adding API Keys — configure your OpenAI key