OpenAI Codex
Codex is OpenAI’s coding agent that helps you write, review, and ship code faster. Use it side-by-side in your IDE or delegate larger tasks to the cloud.
You can view Help Guide for more details.
Install Codex
You can install Codex using one of the following methods.
Option 1: Install via Homebrew
brew install codexOption 2: Install via npm
npm install -g @openai/codexConfigure Codex
Codex reads its settings from a local configuration file written in TOML format.
Step 1: Open the configuration file
vim ~/.codex/config.tomlStep 2: Define the default model and provider
# Default model used by Codex
model = "o3"
# Default model provider
model_provider = "openai-chat-completions"Step 3: Configure the model provider
Set the API Key
Set your API key as an environment variable:
This key is generated when you create an AI Gateway instance.
Use Codex
After configuration, you can start using Codex immediately.
Start an interactive session
Send a one-off request
All requests will be forwarded through the AI Gateway, allowing centralized authentication, routing, and usage tracking.
Last updated