Switch the model mid-session

models & providers

// what it does

/models opens a picker of every model from your authenticated providers; choose one and it applies to the current session. To make it the default, set "model": "provider/model" in config (anthropic/claude-sonnet-4-5) or pass -m at launch. On startup opencode uses -m first, then config, then your last-used model.

// shortcut

Ctrl+X M

// shell

$ /models
$ { "model": "anthropic/claude-sonnet-4-5" }

// gotcha

The model string is always provider_id/model_id — the provider prefix is required and must match Models.dev. A bare model name like claude-sonnet-4-5 will not resolve.

// resources