Codex CLI with Nbility
This guide covers OpenAI’s terminal client. The CLI, desktop app, and third-party Codex++ launcher have different setup surfaces. See Codex for the broader configuration guide.
Install and prepare a token
Follow the official CLI installation guide. Create a dedicated key in Token management and choose a model with Responses and tool support from Models.
Set the key in the terminal that will launch Codex:
export NBILITY_API_KEY="YOUR_API_KEY"
In PowerShell use $env:NBILITY_API_KEY = "YOUR_API_KEY". Setting this variable alone does not select the provider.
Configure a custom provider
Merge this into ~/.codex/config.toml (the .codex/config.toml file in your Windows user directory). Replace YOUR_MODEL_ID and retain unrelated settings.
model = "YOUR_MODEL_ID"
model_provider = "nbility"
[model_providers.nbility]
name = "Nbility"
base_url = "https://api.nbility.ai/v1"
env_key = "NBILITY_API_KEY"
wire_api = "responses"
Official Codex uses Responses here; a Chat Completions configuration is not interchangeable. The env_key reference keeps the credential out of project files.
Launch and troubleshoot
Run codex from the same terminal. Ask it to explain a small file, then verify the request in Usage logs.
- Missing variable: match its name to
env_keyand launch from the shell where it is set. - Wrong provider: check the selected profile and any trusted project
.codex/config.tomloverrides. - Missing endpoint or incompatible model: check for duplicated
/v1and confirm Responses API support. - Prefer a graphical switcher: use CC Switch.