Answer: Use the --model flag with the run command, specifying the model as shown in the example: opencode run --model anthropic/claude-sonnet-5-5 "Refactor parseToken". Status: Confirmed Entry: tool/opencode/models/select-model-for-run Revision: 1 Digest: sha256:2990811df422af8a (changes whenever the content changes) Timeline: Created: 2026-11-13T03:56:10Z Last changed: 2026-11-13T03:56:10Z Last verified: 2026-11-20T13:44:58Z Next check: 2026-11-21T13:44:58Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of flag | --model | [1] | 2026-11-20 example model | anthropic/claude-sonnet-5-5 | [1] | 2026-11-20 Sources: [1] opencode. "CLI commands | OpenCode". https://opencode.ai/docs/cli/commands/ Role: primary. Accessed: 2026-11-20T13:44:58Z Quote: "Choose a model. Terminal Copy Copied Failed $ opencode run --model anthropic/claude-sonnet-5-5 "Refactor parseToken"" (Supports: flag) Quote: "$ opencode run --model anthropic/claude-sonnet-5-5 "Refactor parseToken"" (Supports: example model) Snapshot SHA-256: 1396ac261e8d9905b9c01d47d7d7a938279d61bc7f51fa7a17c99b47c8b26447 (captured 2026-11-18T13:38:36Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:38:37Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:58Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:58Z Last attempt: 2026-11-20T13:44:58Z Notes and limitations: Extracted automatically from a single official source (section "run"). Related: https://latestn.com/tool/opencode/models/select-model-session How do I select a model for the current session in opencode? https://latestn.com/tool/opencode/models/select-models How do I select or list models in Pi with OpenCode? https://latestn.com/tool/opencode/models/set-default-model How do I set a default model in opencode? https://latestn.com/tool/opencode/models/models-available-in-codex Which models can I use with opencode Console in Codex? https://latestn.com/tool/opencode/models/raycast-go-models How do I use Go models in Raycast with OpenCode? https://latestn.com/tool/opencode/models/run-with-model-flag How do I use a model for a single run in opencode with --model? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:56:10Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/models/select-model-for-run/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/models/select-model-for-run POST: https://latestn.com/dispute/tool/opencode/models/select-model-for-run with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/models/select-model-for-run?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I choose which model opencode uses for a run command? Revision 1, last verified 2026-11-20T13:44:58Z. https://latestn.com/tool/opencode/models/select-model-for-run (accessed 2026-11-21T09:52:23Z). @misc{LatestN_tool_opencode_models_select_model_for_run_r1, title = {How do I choose which model opencode uses for a run command?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/models/select-model-for-run}}, note = {Revision 1; digest sha256:2990811df422af8a; last verified 2026-11-20T13:44:58Z; accessed 2026-11-21T09:52:23Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/models/select-model-for-run