Using OpenAI Codex CLI

Run Codex CLI with Onysoft models

Codex can use Onysoft as a custom model provider. Codex uses the Responses API endpoint. The configuration below works with Codex's default tool options; no extra lines turning off web_search or multi_agent are needed.

Installation

Terminal
npm i -g @openai/codex

Configuration File

The configuration file is ~/.codex/config.toml on macOS and Linux and %USERPROFILE%\.codex\config.toml on Windows. Put the following in it (instead of the model shown you can use another catalog id such as anthropic/claude-sonnet-5.5 or openai/gpt-5.5):

config.toml
model_provider = "onysoft"
model = "openai/gpt-5.3-codex"

[model_providers.onysoft]
name = "Onysoft"
base_url = "https://api.onysoft.com/v1"
env_key = "ONYSOFT_API_KEY"
wire_api = "responses"

# recommended: keep the key out of commands Codex runs and out of ~/.codex/shell_snapshots files
[shell_environment_policy]
exclude = ["ONYSOFT_API_KEY"]

Setting the Key

Codex reads the key from the ONYSOFT_API_KEY environment variable. Enter the key hidden (it is not written to the command history):

PowerShell
$secret = Read-Host "Paste your Onysoft API key" -AsSecureString
$env:ONYSOFT_API_KEY = [System.Net.NetworkCredential]::new("", $secret).Password
Remove-Variable secret
codex
zsh / bash
read -rs "ONYSOFT_API_KEY?Onysoft API key: "; echo
# if you use bash, instead: read -rsp "Onysoft API key: " ONYSOFT_API_KEY; echo
export ONYSOFT_API_KEY
codex

Models

Models tried with this configuration on Codex 0.166: openai/gpt-5.3-codex, openai/gpt-5.5, anthropic/claude-sonnet-5.5 and the free deepseek/deepseek-v4.1-flash:tr (on personal keys free models are available to verified accounts). You can use other chat models as well; write the id exactly as in the catalog.

Notes

Want help finding the right model?