Key takeaways

  • Type /models or press Ctrl+X then M to change the model for the current session; F2 cycles recently used models.
  • Press Ctrl+T to cycle a model's variants, which is how OpenCode sets reasoning effort, or add #high to a model ID.
  • Set "model" in opencode.json for a default, though the root setting does not keep a variant; agents and commands can pin model#variant.

To change the model in OpenCode, type /models in the terminal app and pick one, or press Ctrl+X and then M. To change reasoning effort, press Ctrl+T to cycle through the current model's variants, which is how OpenCode names its effort and thinking levels. Both choices apply to the current session only. To make a model the default, set "model" in opencode.json.

That covers most people. The rest of this guide covers every place OpenCode lets you choose a model: per session, per command-line run, per project, per agent and per custom command, and how to define your own effort levels. Every step comes from the OpenCode docs as of November 17, 2026. The docs describe OpenCode V2. V2.3.0 shipped on November 13 according to the GitHub releases page, and V1 still gets updates, so where V1 differs it is noted below.

Before you start

OpenCode only lists models from providers you have connected. If the model you want is missing from the list, connect its provider first. In the terminal app, run:

/connect

Pick a provider and follow the prompts. It supports API keys and OAuth. From a shell you can do the same with opencode auth login, for example opencode auth login anthropic --method key, according to the providers docs.

To see every model OpenCode can use right now, run:

opencode models

Model IDs take the form provider/model, such as anthropic/claude-sonnet-5-5. A reasoning level goes after a #: openai/gpt-6.1-sol#high. IDs are case-sensitive.

How to change the model in OpenCode for the current session

  1. In the OpenCode terminal app, type /models and press Enter. You can also press Ctrl+X, release, then press M. Ctrl+X is OpenCode's leader key, the prefix for most shortcuts.
  2. Pick a model from the list.
  3. Send your next prompt. It goes to the new model.

Inside the model list, Ctrl+F marks a model as a favorite, Ctrl+A opens the provider list and Ctrl+U opens usage limits, according to the keybinds docs.

To switch quickly between models you have used before, press F2 for the next recent model and Shift+F2 for the previous one.

The choice sticks to the session and does not touch your config file. The models docs say a model chosen for a session takes precedence over the configured default, so a new default in opencode.json won't change a session that already has a model.

How to change reasoning effort in OpenCode

OpenCode calls reasoning levels "variants". A variant is a named set of options for one model, usually its reasoning effort or thinking budget. Common names are low, medium, high and max, but each model has its own set, and the names come from the model's catalog entry on models.dev.

In the terminal app:

  1. Choose the model first, since its variants depend on it.
  2. Press Ctrl+T to cycle to the next variant.
  3. Send your prompt.

The command for a list of variants, variant.list, has no key by default. You can bind one yourself (see "How to change the keybinds" below).

For a single run from the shell, add the variant to the model ID:

opencode run --model openai/gpt-6.1-sol#high "Review this migration plan"

If you name a variant the model doesn't have, OpenCode stops with a model-resolution error. high exists for many models but not all.

People who search for the "thinking level" sometimes mean something else: whether the model's reasoning shows on screen. That is a display setting, not an effort setting. Set "session": { "thinking": "show" } or "hide" in ~/.config/opencode/cli.json, according to the settings docs. There is also a session.toggle.thinking keybind, which has no key by default.

How to set a default model in opencode.json

Add a model key to your config:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "anthropic/claude-sonnet-5-5",
}

Where you put the file decides where it applies, according to the config docs:

File Applies to
~/.config/opencode/opencode.json or .jsonc Every project for your user
opencode.json in the project folder That project
.opencode/opencode.json in the project folder That project, and it overrides the file above
/etc/opencode/opencode.json (Linux) Everyone on the machine, and it overrides all of the above

A project file beats your global file, and a file in a subfolder beats one higher up. OpenCode reloads config changes on its own; a request already running keeps the settings it started with.

Two things to know:

  • The default only takes effect if that model is enabled and its provider is connected in this project. Otherwise OpenCode falls back to the newest supported model it can use.
  • The root model setting does not keep a variant. Writing "model": "openai/gpt-6.1-sol#high" won't make high your default effort. To fix the effort level in config, use an agent (next section) or change the model's own settings (the section after).

To use a model for one run only without changing the default, use the flag:

opencode run --model anthropic/claude-sonnet-5-5 "Refactor parseToken"

How to set a model per agent

Agents are named assistant profiles. OpenCode ships with build (the default coding agent), plan, general and explore, and you can add your own. Each can have its own model and variant, according to the agents docs.

In an agent file such as .opencode/agents/reviewer.md, set it in the frontmatter:

---
description: Reviews changes for correctness and regressions
mode: subagent
model: anthropic/claude-sonnet-5-5#high
---

Review the current changes. List findings in severity order.

Or in opencode.json, with the model and variant as separate fields:

{
  "agents": {
    "reviewer": {
      "model": {
        "providerID": "anthropic",
        "model": "claude-sonnet-5-5",
        "variant": "high",
      },
    },
  },
}

To give a built-in agent a different model, use its ID, for example "agents": { "plan": { "model": "openai/gpt-6.1-sol#high" } }. Overriding a built-in by its ID is how the docs describe changing one.

A subagent without a model uses the model of the session that launched it. Switching to a primary agent with Shift+Tab or Ctrl+X then A does not change the session's selected model, according to the docs.

The model that writes session titles is also an agent. The old small_model setting now maps to agents.title.model, according to the migration guide.

How to set a model for a custom command

Custom slash commands can pin a model too. In .opencode/commands/review.md:

---
description: Review code for correctness
agent: plan
model: anthropic/claude-sonnet-5-5#high
---

Review $ARGUMENTS. Report bugs first.

The commands docs give the order: a command's own model wins over everything. Without one, the model of the command's agent applies. Without that, the session's current model stays.

How to define your own reasoning levels

If the built-in variants don't fit, define your own under the model's entry in providers. This example makes medium the normal effort for one OpenAI model and adds two variants, fast and deep:

{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "openai": {
      "models": {
        "gpt-6.1-sol": {
          "settings": { "reasoningEffort": "medium" },
          "variants": [
            { "id": "fast", "settings": { "reasoningEffort": "low" } },
            { "id": "deep", "settings": { "reasoningEffort": "high", "reasoningSummary": "auto" } },
          ],
        },
      },
    },
  },
}

Ctrl+T then cycles through them, and openai/gpt-6.1-sol#deep selects one by name. A variant with the same ID as a built-in one replaces it. OpenCode applies the provider's settings first, then the model's, then the variant's, so the variant wins.

To replace the whole set of effort levels a model offers, describe them under capabilities.reasoning:

{
  "providers": {
    "openai": {
      "models": {
        "gpt-6.1-sol": {
          "capabilities": {
            "reasoning": { "supported": true, "effort": ["low", "medium", "high"] },
          },
        },
      },
    },
  },
}

The docs list four fields there. supported says whether the model reasons. toggle adds a none variant that turns reasoning off. effort lists the levels. budget sets a minimum and maximum number of thinking tokens and is ignored when effort is set.

Options such as reasoningEffort belong to the provider's package, and the docs warn that another provider may ignore or reject them.

How to change the keybinds

In V2 the terminal app's shortcuts live in one global file, ~/.config/opencode/cli.json. To give the variant list a key and move the model list:

{
  "keybinds": {
    "variant.list": "<leader>v",
    "model.list": "<leader>m",
    "model.cycle_favorite": "f3"
  }
}

The defaults for models and effort, from the keybinds docs:

Action ID Default key
Open the model list model.list Ctrl+X, then M
Next recent model model.cycle_recent F2
Previous recent model model.cycle_recent_reverse Shift+F2
Next favorite model model.cycle_favorite none
Cycle variants (effort) variant.cycle Ctrl+T
List variants variant.list none
Open the agent list agent.list Ctrl+X, then A
Next agent agent.cycle Shift+Tab

If you are still on OpenCode V1

V1 uses the same default keys: Ctrl+X then M for models, F2 for recent models and Ctrl+T for variants, according to the V1 keybinds page. The config differs in a few places, according to the migration guide:

  • Keybinds go in tui.json, and the names use _ where V2 uses .: model_list, variant_cycle, variant_list.
  • Providers sit under provider, not providers, and variants is an object keyed by name, not an array.
  • Agents sit under agent and take the variant as its own field: "model": "anthropic/claude-sonnet-5-5", "variant": "high".

The V1 models docs list built-in variants for some providers: high (the default) and max for Anthropic; none, minimal, low, medium, high and xhigh for OpenAI, depending on the model; and low and high for Google. V2 builds its list from each model's catalog entry instead, so check the variants with Ctrl+T.

Common problems

  • The model isn't in /models. Its provider isn't connected in this project, or the model is disabled. Run /connect. Credentials and config from another project don't carry over automatically.
  • My default in opencode.json is ignored. The session already has a model selected, which wins. Start a new session with Ctrl+X then N. Also check that a project or .opencode/ config file isn't overriding your global one.
  • "Model resolution" error after adding #high. That model has no variant with that name. Cycle with Ctrl+T to see which ones it has.
  • Effort level isn't saved as the default. The root model setting drops variants. Set the model with #variant on an agent, or change settings.reasoningEffort on the model itself.
  • Free models clutter the list. Start the server with OPENCODE_DISABLE_FREE_MODELS=1 to hide OpenCode's free models.

For what OpenCode costs and which of its models are free, see Is OpenCode free?. For how it stacks up against Anthropic's agent, see Claude Code vs OpenCode.

Frequently asked questions

Does /models change my opencode.json?

No. A model picked with /models applies to the current session only and does not rewrite the config file. Set the model key in opencode.json to change the default for new work.

How do I change reasoning effort in OpenCode?

Press Ctrl+T in the terminal app to cycle the current model's variants, such as low, high or max. For one run, add the variant to the model ID, as in opencode run --model openai/gpt-6.1-sol#high.

Why doesn't my model show up in OpenCode?

The model list only shows enabled models whose provider is connected in the current project. Run /connect to add the provider, or opencode models to see what is available.

How do I hide OpenCode's free models?

Set OPENCODE_DISABLE_FREE_MODELS=1 on the server process, for example OPENCODE_DISABLE_FREE_MODELS=1 opencode serve. The free OpenCode models then disappear from the list and the defaults.

Sources

  1. ModelsOpenCode
  2. KeybindsOpenCode
  3. TUIOpenCode
  4. ConfigOpenCode
  5. AgentsOpenCode
  6. CommandsOpenCode
  7. Providers (CLI)OpenCode
  8. CLI settingsOpenCode
  9. CLI commandsOpenCode
  10. Migrate from V1OpenCode
  11. Keybinds (V1)OpenCode
  12. Models (V1)OpenCode
  13. OpenCode releasesGitHub

Add ClaudeGPT Si as a preferred source on Google