Nbility logoNbility Docs

Search documentation

Search guides and API reference content

Terminal & Agents

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_key and launch from the shell where it is set.
  • Wrong provider: check the selected profile and any trusted project .codex/config.toml overrides.
  • Missing endpoint or incompatible model: check for duplicated /v1 and confirm Responses API support.
  • Prefer a graphical switcher: use CC Switch.

References

Adapted and rewritten for Nbility from aicentos’s Codex CLI guide, licensed under CC BY 4.0. Its account, plan, and proprietary service instructions do not apply here. See the client’s official documentation.

Table of Contents