Setting a default model keeps new Codex CLI sessions on the model you actually want instead of relying on the current recommended default for the active install or account.
Current Codex docs and the current local codex --help output both show that model selection is handled through ~/.codex/config.toml and the -m option. The current CLI does not provide a codex model set subcommand.
Use a top-level model entry when most sessions should use the same model. For one-off runs, pass -m on the command line, and for recurring alternate setups you can save CLI profiles under [profiles.<name>].
$ mkdir -p ~/.codex
model = "gpt-5.4"
Use ~/.codex/config.toml for a personal default, or use .codex/config.toml inside a trusted repository when the model should apply only to that project. Current Codex docs recommend gpt-5.4 for most tasks and gpt-5.4-mini for faster, lighter work.
Keep only one top-level model value in the active config layer. If the file already contains model = ..., replace it instead of adding a second copy.
$ codex ╭──────────────────────────────────────────────────────────╮ │ >_ OpenAI Codex │ │ │ │ model: gpt-5.4 xhigh /model to change │ │ directory: ~/projects/example-app │ ╰──────────────────────────────────────────────────────────╯ ›
The decisive success signal is the model line showing the configured model before the first prompt is sent. The exact suffix after the model name can differ by account or reasoning setting.
If the directory is inside a repository that has not been trusted yet, complete the trust prompt first and then confirm the model line. Related: How to fix Codex trusted directory error
Related: How to start a Codex interactive session
$ codex exec -m gpt-5.4-mini "Reply with exactly OK" OK
-m overrides the configured default only for that run.
Related: How to run Codex exec with a prompt
[profiles.fast] model = "gpt-5.4-mini" [profiles.deep] model = "gpt-5.4"
$ codex --profile fast
Profiles are currently experimental and apply to the CLI, not the IDE extension. Inside an already open CLI thread, use /model when only that thread should switch models.