Command-line agents
Codex
Route OpenAI Codex through NoviaHub — install it, write config.toml, set the environment variable, verify and switch models.
Codex is OpenAI’s coding agent, available in the terminal as the Codex CLI. Its config file can add custom model providers, which it calls over the Responses protocol. Point a provider at NoviaHub and Codex uses your NoviaHub balance.
Prerequisites
Section titled “Prerequisites”- A NoviaHub API key (see API Keys) and some balance (see Wallet and top-ups).
- A model that supports Responses: open it under Models & Pricing and check that its endpoint labels include
Response.
Install
Section titled “Install”curl -fsSL https://chatgpt.com/codex/install.sh | shpowershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"npm install -g @openai/codex# orbrew install --cask codexConfigure NoviaHub
Section titled “Configure NoviaHub”-
Store the key in the environment variable
NOVIAHUB_API_KEY. Codex reads the key from an environment variable; don’t write the key into the config file.终端窗口 # macOS uses zsh by default; with bash on Linux, use ~/.bashrc instead of ~/.zshrcecho 'export NOVIAHUB_API_KEY="sk-..."' >> ~/.zshrcsource ~/.zshrc终端窗口 setx NOVIAHUB_API_KEY "sk-..."setxdoes not affect the current window; close the terminal and open a new one. -
Edit the config file
~/.codex/config.toml(%USERPROFILE%\.codex\config.tomlon Windows), creating it if needed:~/.codex/config.toml model = "gpt-6-sol"model_provider = "noviahub"[model_providers.noviahub]name = "NoviaHub"base_url = "https://noviahub.com/v1"env_key = "NOVIAHUB_API_KEY"wire_api = "responses"Setting Purpose modelThe default model ID. model_providerWhich provider to use; matches noviahubin[model_providers.noviahub]below.nameThe provider’s display name. base_urlThe API address, including /v1:https://noviahub.com/v1.env_keyThe environment variable that holds the key. wire_apiThe protocol. The docs say responsesis the only supported value and the default when omitted. -
Open a new terminal and run
codex.
Verify
Section titled “Verify”-
Type
/statusin Codex and check that the active model is the one you set. -
Ask anything. A normal answer means it works; the call and its cost appear under Usage Logs in the NoviaHub console.
-
If the configuration doesn’t take effect,
/debug-configshows the config layers Codex actually loaded.
Switch models
Section titled “Switch models”- For now: type
/modelin Codex. - Permanently: change
modelinconfig.toml.
Codex only uses Responses, so choose models whose endpoint labels include Response. On 2026-09-28 those on NoviaHub were gpt-6-sol, gpt-6-luna, gpt-6-astra, gpt-5.6-sol, gpt-5.6-luna, gpt-5.6-terra, deepseek-v4-flash, deepseek-flash, deepseek-v4-flash-vision-exp and kimi-k3. Models change; Models & Pricing is authoritative. A model without Responses support will fail.
Troubleshooting
Section titled “Troubleshooting”401 Invalid token
First check that NOVIAHUB_API_KEY is set in the new terminal (on macOS / Linux, run echo $NOVIAHUB_API_KEY), then check on the API Keys page that the key is Enabled.
403 insufficient_user_quota
Your account balance has run out. Top up first.
Codex in the ChatGPT desktop app
The docs say the ChatGPT desktop app reads the same ~/.codex/config.toml. The steps on this page cover the command line only.
References
Section titled “References”Checked on 2026-09-28:
- Codex CLI installation: https://learn.chatgpt.com/docs/codex/cli
- Custom providers (advanced configuration): https://learn.chatgpt.com/docs/config-file/config-advanced
- Configuration reference: https://learn.chatgpt.com/docs/config-file/config-reference
- Authentication and environment variables: https://learn.chatgpt.com/docs/auth
- Command reference: https://learn.chatgpt.com/docs/developer-commands
setx(Windows): https://learn.microsoft.com/windows-server/administration/windows-commands/setx