Codex CLI and the IDE extension share Codex configuration. Nbility connects through the OpenAI Responses-compatible protocol. The fields below follow OpenAI's current configuration reference.
Completion path: create a key on Token Management → configure Codex → send a short test request → confirm it in Usage Logs.
Install Codex CLI
The official installer is recommended on macOS and Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
You can also use npm:
npm install -g @openai/codex
Run codex --version to verify the installation.
Configure a custom provider
Create a key on Token Management, then add this user-level configuration to ~/.codex/config.toml:
model = "gpt-5.4"
model_provider = "nbility"
[model_providers.nbility]
name = "Nbility"
base_url = "https://api.nbility.ai/v1"
env_key = "NBILITY_API_KEY"
wire_api = "responses"
stream_idle_timeout_ms = 300000
Inject the key into the shell that starts Codex:
export NBILITY_API_KEY="YOUR_API_KEY"
codex
Windows PowerShell:
$env:NBILITY_API_KEY="YOUR_API_KEY"
codex
env_key is the current recommended authentication method for custom providers. Do not place the real key in config.toml, and do not create auth.json manually for this setup.
IDE extension
The official Codex IDE extension reuses user-level Codex configuration. Verify the CLI first, reload the VS Code/Cursor window, and select the same model in the extension. The legacy chatgpt.apiBase example is not part of the current Codex configuration reference and should not be used.
Verify and troubleshoot
Run codex in a project and use /status to inspect the active provider and model.
- Missing key: ensure
NBILITY_API_KEYis visible to the process that starts Codex. 401: check that the key is active and the account has balance.404: usehttps://api.nbility.ai/v1andwire_api = "responses".- Missing model: verify the ID on Models. Codex custom providers use Responses, not Chat Completions.
Create a dedicated Codex key when possible so limits, revocation, and usage are easy to manage.