Pick a model at startup
Pass-m (or --model) with a model reference:
Model references
A model reference names a model, with or without its provider:
Some model IDs exist under more than one provider. Every Anthropic model also appears under
claude-code, and several GPT models appear under both openai and openai-codex. For a bare model ID, o4 prefers providers you have credentials for, then takes the first match in the catalog. Add the provider prefix when you want to control which account pays for the request.
Switch models during a session
/modelopens the Select Model list. Type to filter by provider or model name, use the arrow keys to move, and pressEnterto switch. The current model is marked← active. While the model is working,/modelwaits until the turn finishes, then opens the list./model <reference>switches straight to a model, for example/model openai:gpt-5.5. While the model is working, it waits until the turn finishes.Ctrl+Mopens the same list when the prompt is empty, even while the model is working. If you pick a model during a turn, the session switches to it at once, but the running turn keeps its old model unless the model router is on.Ctrl+Popens Select Provider, which narrows the model list to the provider you pick. Many terminals send the same code forCtrl+MandEnter; o4 tells them apart where the terminal supports it, but not inside tmux. IfCtrl+Mdoesn’t open the list, use/model.Alt+Mmoves to the next model in o4’s full model list and shows a notice such asModel: gpt-5.5. You can remap it with thecycle_modelaction (see Keyboard shortcuts).
anthropic, openai, xai and deepseek until that provider has an API key in o4’s settings or the environment. It lists the other providers’ models whether or not you have credentials, because o4 can’t check them ahead of time: claude-code, openai-codex and kimi-coding can use a sign-in, ollama can run locally without a key, and custom providers can use any auth. A model without working credentials fails on its first request. Alt+M doesn’t filter at all, so it can also land on a hidden model.
A switch keeps your conversation, rebuilds the system prompt for the new model, and applies to the current session only. It doesn’t change the default model for new sessions, and the notice after /model or Ctrl+M says so: Switched to <name> (<id>) for this session · /config model sets the default.
The Model tab of /config (/config model) has two rows:
- Model shows your saved default model, or the current model if none is saved.
Enteropens Select Default Model. The model you pick is saved asmodelin~/.o4/settings.json, and the other settings in that file stay as they are. The current session switches to it too; if a turn is running, the switch waits until the turn finishes. If a trusted project’s.o4/settings.jsonsets a differentmodel, that one still wins in the project, so the session stays on it, and the notice says so:Saved <name> (<id>) as the default model, but this project's .o4/settings.json uses <model> here. - Refresh catalog downloads the latest model catalog. See Keep the model catalog up to date.
The default model
When you start o4 without-m, it uses the model setting if one is saved. o4 checks these places in order:
.o4/settings.jsonin the project, which o4 reads only in a trusted workspace.~/.o4/settings.json.config.toml(see Configuration files).
/config model, which saves it to ~/.o4/settings.json. The setup wizard saves its choice there too. The wizard opens on its own when o4 finds no API key or no usable default model, and /onboard opens it at any time. You can also set the default by hand. Both files take a model reference:
--no-onboarding, it stops with Configured model '...' is not selectable. instead.
When no default is saved
With no saved model, the interactive interface opens the setup wizard so you can choose one. In print mode, o4 goes ahead without asking. With--no-onboarding, it stops instead:
- ChatGPT/Codex credentials, and no Anthropic key, OpenAI key or Claude Code token:
openai-codex:gpt-5.6-sol. - A Claude Code token and no Anthropic API key:
claude-code:claude-fable-5. - A default provider set with the Provider row under
/config> Providers: that provider’s default model. That is the model named in the other rules for the providers they mention,glm-5.3forzaiandzai-coding-plan, and otherwise the provider’s first model ID in alphabetical order. - ChatGPT/Codex credentials and no OpenAI API key:
openai-codex:gpt-5.6-sol. - An Anthropic API key:
anthropic:claude-fable-5. - An OpenAI API key:
openai:gpt-5.2. - A Kimi key:
kimi-coding:kimi-for-coding. - Otherwise:
anthropic:claude-fable-5.
~/.codex/auth.json automatically, so if you have signed in to the Codex CLI, rule 1 or 4 can apply even though you never configured Codex in o4. Save a default model to avoid surprises.
List the available models
--list-models prints every registered model, grouped by provider, and exits. It doesn’t need an API key:
provider default means the catalog sets no output limit and the provider decides.
Unlike Select Model, this list includes models whose provider has no credentials yet. It also includes models you add in ~/.o4/providers.toml or ~/.o4/models.toml.
Keep the model catalog up to date
The o4 binary has a built-in model catalog. o4 can also download catalog updates from Open4rena and cache them in~/.o4/catalog/. Downloaded entries replace built-in entries with the same provider and model ID, so new models and price changes can arrive without a new o4 release. The download covers the anthropic, openai, amazon-bedrock, google, deepseek, xai and ollama providers.
The catalog refreshes:
- In the background when the interactive interface starts, if the last refresh was more than 7 days ago.
- When you choose Refresh catalog on the Model tab of
/config, or run/models-update, which does the same. The row shows when the catalog was last updated.
Model catalog updated: 7 providers refreshed, 0 failed.. If the download fails, you see Model catalog update failed: ... Using cached data. and o4 keeps the models it already has.
Add or change model entries
~/.o4/models.toml adds models to a built-in provider, or replaces a built-in entry with the same provider and ID. o4 loads it after the built-in and downloaded catalogs, so its entries win. For example, this adds a model to the built-in ollama provider that runs on a local Ollama server:
~/.o4/models.toml
id, name, api, provider, base_url and a [models.cost] table. For provider, use the name of a built-in provider.
Set api to the value the provider’s built-in models use. --list-models doesn’t show it:
o4 doesn’t check the
api value when it loads the file. With a value it has no handler for, such as a typo, the model is still listed, but every request to it fails with API provider '<api>' not found.
The other fields are optional:
[models.cost] holds the input, output, cache_read and cache_write prices, in US dollars per million tokens. Each one defaults to 0.
Two compat settings are useful in your own entries:
visibility = "hide"leaves the model out ofo4 --list-models, the Select Model list and model mentions. You can still choose it with-m provider:id.effortslists the reasoning levels the model accepts, fromminimal,low,medium,high,xhighandmax. It needsreasoning = true. Without it, the model only offers thedefaultlevel. See Reasoning.
~/.o4/providers.toml instead. See OpenAI-compatible endpoints and Local models.
Related
- Model router and fallback switches to another model automatically when a provider is rate limited or failing.
- Reasoning and prompt profiles covers reasoning effort and how the model choice changes the system prompt.
- Context and cost explains how the context window and prices affect a session.
- CLI reference lists every flag.