Codex setup guide
Add a custom provider in ~/.codex/config.toml, set your key, and share one config across the CLI and desktop app.
Signing into the Codex CLI or IDE extension with a ChatGPT account and immediately hitting a 400 model error rarely means your account is broken. In most cases it comes down to a stale model pin, an outdated client, or a workspace admin toggle.
If you sign into the Codex CLI, IDE extension, or Codex inside the ChatGPT desktop app with a ChatGPT account and hit a 400 right away, you will see this exact message:
The 'gpt-6.1-sol' model is not supported when using Codex with a ChatGPT account.Fastest fixes first: Open ~/.codex/config.toml and change any pinned model = "gpt-6.1-sol" to model = "gpt-6.2-sol" (or delete the line to use the catalog default), then upgrade @openai/codex and sign in again. On a Business, Enterprise, or Edu account, ask your workspace admin to enable the model. If you want to bypass ChatGPT account model gates altogether, switch Codex to API key mode.
Codex supports two authentication paths: OAuth sign-in with a ChatGPT account, or direct API key authentication. When you use a ChatGPT account, the backend validates every request against the active model catalog for your subscription tier and workspace policy. Any retired, gated, or mismatched model ID comes back as a 400.
Nearly every report of this error maps to one of five scenarios:
| Scenario | Root cause | Exact fix |
|---|---|---|
| Pinned model in config.toml or scripts | Local config still pins gpt-6.1-sol or a retired slug after the ChatGPT catalog moved on (gpt-6.2-sol is the default from Codex 0.171.0) | Set model = "gpt-6.2-sol" in ~/.codex/config.toml or remove the line |
| Works in web chat, fails in CLI or IDE extension | Outdated @openai/codex binary, stale background daemon, or an IDE extension bundling an older binary | Upgrade @openai/codex, update the IDE extension, and restart the daemon/editor |
| Business, Enterprise, or Edu workspace | Workspace admins control Codex and model access; newer or specific models are often off by default | Have a workspace admin enable the model in the Admin Console, then re-login |
| Recent plan upgrade or multiple accounts | ~/.codex/auth.json still holds a stale OAuth token or a personal free-tier session | Run codex logout (or clear auth.json) and run codex login again |
| Need a model blocked on ChatGPT login | ChatGPT OAuth sessions expose a stricter subset of models than the developer API catalog | Authenticate with an OpenAI API key or point config.toml at CodingPass |
Work through the steps below in order; most setups are back up after the first two.
The single most common culprit is a leftover model pin in ~/.codex/config.toml. Starting in Codex 0.171.0, gpt-6.2-sol became the catalog default for everyday coding and agentic sessions. Once an older slug like gpt-6.1-sol is retired or restricted on the ChatGPT backend, any file or flag still pinning it will immediately fail.
Edit ~/.codex/config.toml to point at gpt-6.2-sol, or remove the model line altogether so Codex tracks the current catalog default:
model = "gpt-6.2-sol"To test right away for a single run, pass --model on the command line, or switch inside an active session with /model:
codex --model gpt-6.2-sol/model gpt-6.2-solCheck two places that are easy to overlook:
.codex/config.toml and any [profiles.*] blocks in ~/.codex/config.toml for hardcoded gpt-6.1-sol linesgrep -rn "gpt-6.1-sol" ~/.codex ~/.zshrc ~/.bashrc to catch old -m gpt-6.1-sol or --model gpt-6.1-sol flagsIf your config does not pin an old model, or if the model works in ChatGPT on the web while failing in your terminal or editor, your local client is likely out of date. Older CLI binaries and lingering background daemons keep sending outdated routing profiles, and IDE extensions bundle their own binary independently of your global npm install.
Check your installed version and upgrade to the latest release:
codex --versionnpm install -g @openai/codex@latestIf you installed Codex via Homebrew instead:
brew upgrade codexAfter upgrading, finish both restarts before retrying:
If you recently upgraded from a free account to Plus or Pro, or switched between a personal account and a work workspace, ~/.codex/auth.json can keep serving an old OAuth token whose permissions no longer match.
Check which auth mode Codex thinks is active:
codex login statusThen clear the local session and sign in again (use --device-auth on headless servers or over SSH):
codex logoutcodex login# Headless or SSH environmentscodex login --device-authIf codex logout does not clear a stuck session, delete ~/.codex/auth.json (or $CODEX_HOME/auth.json if you set CODEX_HOME) and run codex login again, making sure you select the right paid account or workspace in the browser.
In ChatGPT Business, Enterprise, and Edu workspaces, model visibility in Codex is governed by organization policies. Even when a model is live for individual Plus and Pro users, workspace administrators often need to enable Codex access or specific models explicitly.
Local config edits cannot override a workspace block:
gpt-6.2-sol or gpt-6.1-sol, depending on policy) is turned on for your workspace or role.codex logout && codex login locally so your OAuth token picks up the updated workspace permissions.When you need a model that your ChatGPT subscription does not expose, or you want to avoid ChatGPT account catalog changes altogether, switch Codex from ChatGPT login to an API key.
To use an OpenAI API key directly:
printenv OPENAI_API_KEY | codex login --with-api-keyIf you prefer a fixed monthly coding plan that runs gpt-6.2-sol and gpt-6.1-terra (alongside Claude models) under one key with no surprise charges, add CodingPass as a provider in ~/.codex/config.toml. Go starts at $10/mo for gpt-6.1-terra, and Plus at $30/mo includes gpt-6.2-sol, all metered at official API rates against your monthly allowance:
model = "gpt-6.2-sol"model_provider = "codingpass" [model_providers.codingpass]name = "codingpass"base_url = "https://codingpass.ai/v1"env_key = "CODINGPASS_API_KEY"wire_api = "responses"Export your key in ~/.zshrc or ~/.bashrc, open a new shell, and run codex:
export CODINGPASS_API_KEY="cp-live-..."codexThe Codex CLI, the IDE extension, and Codex in the ChatGPT desktop app all read the same ~/.codex/config.toml. To keep your ChatGPT login alongside CodingPass, place the top two lines in a dedicated profile and launch with codex --profile cp. See the full Codex setup guide, browse all supported models, or compare plans on pricing.
ChatGPT web, the desktop app, and the Codex CLI check different backend catalogs and client versions. Staggered rollouts, workspace policies that restrict Codex separately from web chat, or an outdated CLI binary can all let web chat work while the CLI returns 400. Upgrade @openai/codex first and run /model to inspect the exact list exposed to your current session.
Yes. codex resume loads your local session history regardless of the model change. Update ~/.codex/config.toml or launch with codex --model gpt-6.2-sol, and if an old session restores with the retired model name, run /model gpt-6.2-sol inside the session.
The same fix applies to any variant of The '<model>' model is not supported when using Codex with a ChatGPT account. That message always means the requested slug is retired or unavailable on your ChatGPT-authenticated Codex backend. Replace the old slug with gpt-6.2-sol (or remove the hardcoded model line), update the CLI, and refresh your login.
Point ~/.codex/config.toml at CodingPass to run GPT-6.2 Sol or GPT-6.1 Terra on an API key without ChatGPT account model gates.