Integrations

Codex

Codex uses `~/.codex/config.toml` for OpenAI-compatible models and reads credentials from `OPENAI_API_KEY` (Windows config directory: `%USERPROFILE%\.codex\`).

Last updated: 2026-08-03

If a model is unavailable, confirm it exists in the model list and recheck your API Key and Base URL. View model list
1

Install Codex

Install globally and verify.

Terminal
npm install -g @openai/codex@latest
codex --version
3

Temporary setup (current terminal only)

Use this only to test connectivity. The variable is lost when the terminal closes.

Windows PowerShell
$env:OPENAI_API_KEY="your-apihub-key"
macOS / Linux
export OPENAI_API_KEY="your-apihub-key"
4

Launch

Start Codex and confirm no 401 errors before working on real tasks.

Terminal
codex

Verification

  • Codex reads config successfully and sends requests without auth errors.

Common Errors

  • Wrong `wire_api` value causes protocol mismatch.
  • `OPENAI_API_KEY` is not set in the terminal that launches Codex.
  • On Windows, using `~` instead of `%USERPROFILE%` — path not found.