Models in OpenCode: ids, pinning and per-agent routing

Contents
Introduction
Three tiers, one default
Model ids and variants
Per-agent routing
Switching models
Cost control
Other providers and local models
Troubleshooting

Introduction

OpenCode itself is free and open source; the model is the only recurring cost. It talks to 75+ providers directly, plus local servers, and the curated gateway is OpenCode Console. This page is about using a model inside OpenCode: which tier to pick, how ids are written, where to pin a default, how to give each agent its own model, and how to keep the bill visible. The models themselves — families, pricing, context — are on AI models.

Three tiers, one default

Three models cover 95 percent of daily work. Default to the free one, escalate to the cheap one, finish hard tasks with the top one. Prices move — verify current rates before budgeting:

ModelConsole idPrice / 1M in+outUse it for
Free OpenCode modelopencode/deepseek-v4.1-flash-freeFreeDaily default for public code: questions, drafts, bulk edits, learning the codebase
GPT 6 Lunaopencode/gpt-6-luna$0.10 / $0.50Cheap paid step-up when free limits hit: refactors, CI reviews, long sessions
Claude Opus 5.5opencode/claude-opus-5-5$4.00 / $20.00Top quality: architecture, hard bugs, security review, final pass

Free OpenCode model — your main workhorse. Console always carries a few free models. Which one is current, its fallbacks and the one-line check before pinning an id are on Free OpenCode model. Free ids rotate: the former default, Muse Spark 1.3 Free, left the catalog in October 2026, and every config that pinned it stopped resolving. Its paid twin is described on Muse Spark 1.3.

Free-tier privacy: a contributor tier trades the price for permission to use prompts and completions to train future models. Never send secrets, customer data, or private code to a free model whose terms you have not read. Most other free models claim zero-retention during the free period, but some may still use data for improvement — check the Console privacy notes first, and switch to a paid model or a local model for sensitive work.

GPT 6 Luna — the cheapest smart paid model. Luna is the small member of the GPT 6 family (Astra, Sol, Luna). At roughly ten cents per 1M input tokens it is cheaper than most Flash, Nano and Mini models, yet good enough as an agent: it follows tools, keeps context, and survives long refactors. Use it when the free model is rate-limited or gone, for overnight runs, and for CI jobs where you count every cent. The bigger sibling opencode/gpt-6-sol at about $2.00 / $10.00 is the middle step before the flagship models.

Claude Opus 5.5 — the top model for hard work. Opus 5.5 is the current top of the Claude line on Console, above Sonnet 5.5 at about $2.00 / $10.00 and Haiku 5.5 at about $0.10 / $0.50. It wins on large refactors, tricky debugging, API design, and careful security review. It is roughly 40 times more expensive than Luna on input, so do not burn it on questions a free model answers well. Typical split: the free model does 80 percent of steps, Luna does routine paid work, Opus 5.5 does the last 10 percent that decides quality. Newer revisions such as Sonnet 5.x or Opus 5.x follow the same rule — pick the newest Opus for max quality, newest Sonnet for quality per dollar.

Other orientation prices from OpenCode Console, per 1M tokens in+out. Rates move — re-check as in Verify prices before budgeting:

ModelPrice / 1M in+out
GPT 5 Nano$0.05 / $0.40
DeepSeek V4.1 Flash$0.30 / $1.20
Kimi K2.5$0.60 / $3.00
GPT 5.4 Mini$0.75 / $4.50
GPT 5.5$5.00 / $30.00

Free ids rotate. The live list, the fallback order and the check are on Free OpenCode model; when a free id disappears, take the next one from there or fall back to local Ollama.

Model ids and variants

A model id is provider/model, with an optional #variant for reasoning effort or speed. Console models use opencode/<model-id>; your own provider keys keep that provider in front and are billed by it:

IdRoute
opencode/gpt-6-lunaOpenCode Console, pay-as-you-go credits
opencode/claude-opus-5-5OpenCode Console, same key as the free model
anthropic/claude-opus-5-5Your own Anthropic key, billed by Anthropic
openai/gpt-5.2#highYour own OpenAI key, high reasoning variant
ollama/qwen3:8bLocal model, no key, no per-token cost

Custom variants and aliases are defined in config, so a short name can carry a model, an effort level and provider settings. The live list of ids, including the free ones, comes from the models endpoint or from the shell:

curl https://opencode.ai/inference/v1/models

opencode models

Search the JSON output for your id before pinning it. In the TUI the same check is /models.

Per-agent routing

One model for everything is the expensive default. Give each role its own model, cheapest first:

RoleAgent fileModel
Triage: explains and routes, never editstriage.mdfree OpenCode model
Build: implements and runs testsbuilder.mdGPT 6 Luna
Review: judges the diff, reports onlyreviewer.mdClaude Opus 5.5

The session default stays cheap; only the reviewer pays for the top tier, in opencode.jsonc at the project root:

vi opencode.jsonc

{ "$schema": "https://opencode.ai/config.json", "model": "opencode/gpt-6-luna", "agents": { "reviewer": { "description": "Final correctness and security pass", "mode": "subagent", "model": "opencode/claude-opus-5-5" } } }

The full three-role layout, with skills gated per agent, is on Three models, one project. The agent files themselves — frontmatter, permissions, four complete examples — are on OpenCode agents.

Switching models

Stay in one session and escalate only when the role changes: context accumulates, and the next model inherits the work instead of re-reading the repo. For a hard feature, switch to Plan mode first, iterate on the plan, then switch back to Build — do not let a strong model edit on the first prompt.

Cost control

Other providers and local models

Console is one route, not the only one. Your own Anthropic, OpenAI or Google keys are billed by that provider; OpenRouter holds 300+ models behind one key through an OpenAI-compatible provider entry. Local models need no key at all: with ollama serve running, OpenCode discovers them at the default address, and the same works for LM Studio and vLLM. See Ollama: local models the easy way and Qwen: download, install, fine-tune and use.

Troubleshooting

Official sources:

Article author: Arthur Isaev

Related articles
AI
OpenCode: download, install and use with free and paid models
Models in OpenCode: ids, pinning and routing
Free OpenCode model: current pick and checks
OpenCode agents: four complete examples
AI models: price, context and how to choose
GPT 6 Luna
Claude Opus 5.5
OpenRouter: one API key for 300+ AI models
Banner image

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: