Best LLM for OpenCode
OpenCode will run almost any model. Only a few are good at both writing code and calling tools. These are the ones worth paying for.
Prices on this page last verified against each provider’s own pricing page
OpenCode is an open-source coding agent for the terminal, with a desktop app and IDE support. It ships two main agents you switch between with Tab: build, which edits files and runs commands, and plan, which is read-only and asks before running anything. It connects to 75+ providers through the AI SDK and Models.dev, plus local models, and you choose with /connect and /models or the model key in opencode.json.
There are three ways to pay. Bring your own key and pay each provider's rate. Use OpenCode's own pay-as-you-go gateway, which says it sells at cost plus a card processing fee and benchmarks every model and provider it lists. Or subscribe to OpenCode Go, a low-cost plan for open models such as GLM, Kimi, MiniMax, Qwen and DeepSeek, with usage limits set as monthly dollar amounts. OpenCode's own recommended-models list says it is not necessarily up to date, and as of October 2026 it still names Claude Opus 4.5 and GPT 5.2, so this page ranks the current catalogue instead.
The weighting follows what the build agent does: SWE-bench Verified 0.55, Terminal-Bench 2.1 0.45. Price presses at four points of pass rate per halving of blended price, less than our Kilo Code page because many OpenCode users sit on a flat Go plan for the open models. Models under a 200K context are left out.
Top Models for OpenCode — October 2026
First on price, and the easiest model on this page to try for nothing: OpenCode lists a DeepSeek V4.1 Flash Free tier for a limited time, and the paid model is on Go as well. The 90.6 Terminal-Bench 2.1 score that ranks it first is DeepSeek's own and has no independent check yet. On Go, DeepSeek is blocked until a workspace owner allows the Global region in privacy settings, which is the usual reason it does not appear in /models. Weekday peak hours bill double the off-peak figure shown.
The ceiling: 96.0 on SWE-bench Verified (Anthropic-reported) and 86.1 on Terminal-Bench 2.1 measured by Artificial Analysis. OpenCode ships high and max thinking variants for Anthropic models, and max is where cost runs away, so cycle variants deliberately. Put it on build for the change that already failed on something cheaper.
A cheap 1M-context model with an independently measured 77.5 on Terminal-Bench 2.1. Google says its current rate reverts to the launch price on January 1, 2027, and Vertex AI retires the model on November 19, 2026, so this is a pick for now rather than a config to forget. Thinking tokens bill as output.
The default most people should start from on build: 85.2 SWE-bench Verified, full 1M context with no long-context surcharge, and it is in OpenCode's gateway alongside the newer Sonnet 5.5, which has no published benchmark in our data yet. Its tokenizer counts roughly 30% more tokens than Sonnet 4.6 for the same text.
OpenAI's strongest model in our data with a default-tier score: 86.1 on Terminal-Bench 2.1 at medium reasoning, measured by Artificial Analysis, and a 1M context. OpenAI cut its rate in August and says the cut holds at least through November 21, 2026, with no end date published. Input past 272K reprices the whole request, and OpenCode exposes OpenAI reasoning effort as variants from none to xhigh, so long or high-effort sessions cost well above the card.
The open-weights pick if you are on OpenCode Go, which includes it. MIT licence, 1M context. Its 77.9 on Terminal-Bench 2.1 comes from Artificial Analysis's max reasoning setting, so treat it as an upper bound for a default call. Z.ai also sells GLM-5.3, which Go carries too, but we have no benchmark for it yet.
Cheap per token now that MiniMax calls its half price permanent, 1M context, and an independently measured 65.2 on Terminal-Bench 2.1. It is on Go. A reasonable model for the plan agent or for long read-heavy sessions. Rates double above 512K input.
Moonshot's coding-tuned open-weights model, on Go, with 67.4 on Terminal-Bench 2.1 from Artificial Analysis. Moonshot's bigger claims about it come from its own private benchmark. The 262K context is the smallest on this page, so long build sessions will hit compaction sooner.
How We Ranked These Models
Order is computed, not hand-picked. Each model is scored on the published pass-rate suites it has (SWE-bench Verified 0.55, Terminal-Bench 2.1 0.45), renormalised over the suites present, then charged 4 quality points for every doubling of its blended price (3:1 input-to-output tokens). Models with no published score are never given one: they are listed after every scored model, ordered by price, and labelled as unscored. OpenCode is a terminal coding agent whose build agent edits files and runs commands, so SWE-bench Verified carries 0.55 and Terminal-Bench 2.1 0.45. You pay per token through any of its providers or its own pay-as-you-go gateway, so price presses at 4 points of pass rate per doubling: less than on Kilo Code, because many OpenCode users sit on a flat Go subscription for the open models. The 200K floor keeps out models that cannot hold a working set. See the full ranking method.
Frequently Asked Questions
What is the best model for OpenCode?
Which OpenCode models are free?
Is OpenCode free to use?
Which model should I use for the plan agent?
What is the best model on OpenCode Go?
Can OpenCode run local models?
The same models, weighted for another tool
Each page states its own weighting, so the order changes with the workload.