Configure the OpenAI Codex CLI to use models served by CoreInfra AI Hub.
You need the Codex CLI, a CoreInfra AI Hub token, and either uvx or pipx.
On a new Mac, install Apple's Command Line Tools first. Skip this step if they are already installed.
xcode-select --installIf you do not have uvx, install uv:
brew install uvYou can also use uv's official installer or choose the pipx command below.
Run setup with your CoreInfra token:
uvx --from git+https://github.com/CoreInfraAI/setup-codex setup-codex --api-key <your-token>Then verify that Codex works:
codex exec "2 + 2" --skip-git-repo-checkTo run setup with pipx instead:
pipx run --spec git+https://github.com/CoreInfraAI/setup-codex setup-codex --api-key <your-token>- Creates a model catalog at
<codex-home>/models.jsonfrom the models available through CoreInfra AI Hub. - Configures
<codex-home>/config.tomlto use thecoreinfraprovider while preserving your other settings. - Stores your API token in
<codex-home>/.envwith file mode600when you pass--api-key. - Backs up each existing file before changing it. Backups are saved beside the original file with a
.baksuffix.
--codex-home PATH codex home directory (default: $CODEX_HOME or ~/.codex)
--model SLUG default model for a fresh config (default: gpt-5.6-sol)
--api-key TOKEN CoreInfra API token to write into .env
| Variable | Default | Description |
|---|---|---|
COREINFRA_HUB_BASE_URL |
https://hub.coreinfra.ai |
Hub endpoint used by setup and written to the Codex config. Override it for another instance, such as staging. Trailing slashes are removed. |
Re-run setup after upgrading Codex so the model catalog matches the new binary. Add --refresh to bypass the uvx cache:
uvx --refresh --from git+https://github.com/CoreInfraAI/setup-codex setup-codex- Only models served over the Responses API are included. Models limited to chat-completions or messages — including Kimi, GLM, Claude — cannot be used by Codex.
- ChatGPT Work currently supports only OpenAI models.