Codex CLI Setup
1. Install Codex from https://github.com/openai/codex
2. Edit the ~/.codex/config.toml file and add:
preferred_auth_method="apikey"
model_reasoning_effort="high"
Setting the model_reasoning_effort="high" is optional but recommended.
Codex IDE Setup
On the machine that will access the git repositories (for example, if VS Code runs on Windows but connects to a Linux host via SSH, create the files on the Linux host).
1. Create ~/.codex/config.toml with the same contents as above,
2. Create ~/.codex/auth.json with:
{
"OPENAI_API_KEY": "apikey"
}
If `auth.json` already exists, remove all other entries and keep only the API key.
3. Install the Codex IDE extension in VS Code (or restart VS Code if already installed).
Provisioning Multiple Users with Unique API Keys
To provision multiple users, each with a different API key, without having to actually invite the users to your org:
- Create a new project named Codex in your OpenAI settings at http://platform.openai.com.
- In the project settings, navigate to API Keys → Create new secret key → Service account.
- Set the Service Key Name to codex-USER, where USER is a unique identifier for each user.
This approach allows the OpenAI dashboard to display Codex/API usage statistics per user.