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>].

Steps to set the default model in Codex:

  1. Create the Codex config directory when it does not already exist.
    $ mkdir -p ~/.codex
  2. Add or update the top-level model entry in ~/.codex/config.toml.
    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.

  3. Start a new Codex session and confirm the header shows the configured model.
    $ 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

  4. Override the default model for a single non-interactive run when the change should not persist.
    $ codex exec -m gpt-5.4-mini "Reply with exactly OK"
    OK

    -m overrides the configured default only for that run.

  5. Save recurring alternate model setups as named profiles when one default is not enough.
    [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.