Choose an AI coding model for OpenCode by first confirming it is available in your project, then comparing its context and output limits, tool-calling capability, and current provider billing against the work you actually do. OpenCode’s model examples are a starting point—not a current ranking—and a larger context window alone does not guarantee better coding or tool use.
Start by checking which models your project can use
A model is a practical option only when its provider is available and configured for the current project and the model is enabled. OpenCode supports more than 75 LLM providers, as well as local models, according to its provider documentation. Availability can still depend on your credentials, provider setup, and project configuration.
As an Amazon Associate I earn from qualifying purchases.
Use /models in OpenCode to see and select available models. Follow the provider/model identifier shown there instead of guessing an ID. You can also configure a default model or select one for a run with the command-line --model option; check the Models documentation for the current configuration details.
Recommended Free Tools
Provider setup is one choice; the model itself is another. OpenCode documents optional Zen and Go offerings, local-model support, and connections to other providers. Zen is described as a curated offering with models tested by the OpenCode team, while Go is a subscription for coding models tested by that team. These options may affect setup and access, but do not establish which is best value for your workload.
#1 Best Overall
Compare limits to the task, not to a headline number
OpenCode’s model configuration distinguishes context, input, and output limits. Check all three: context is not interchangeable with output capacity, and neither limit is a measure of model quality. The v2 Models documentation describes these configurable limits.
- Context: How much of the conversation and task material the model can consider, including prompts, repository excerpts, and tool results.
- Input: The provider’s stated input limit. Confirm how it relates to context for the specific model and integration.
- Output: The maximum response the model can produce. This matters when a task calls for substantial code or explanation, even if the input fits comfortably.
Match the limits to the work: a focused bug fix may need far less repository context than a multi-file change. More context is useful only if the task needs it and the model and provider can handle it effectively. Do not select a model solely because its advertised context window is largest.
Rank #2
Verify tool calling before relying on an agentic workflow
OpenCode warns that code generation and tool calling do not automatically go together. Its Models documentation says, “However, there are only a few of them that are good at both generating code and tool calling.” If your workflow depends on the model reading files, editing code, or invoking tools, verify that capability rather than assuming a coding label is enough.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →This is especially important for custom models and local servers. OpenCode’s custom-model configuration can include a tool-support capability flag, but discovery does not necessarily establish that the model supports tools. The v2 Models documentation notes that custom models can inherit fallback assumptions, including tool support and a 200,000-token context limit. Treat those as defaults—not verified facts—and set known capabilities and limits accurately.
Rank #3
For a vLLM-discovered model, do not infer tool support from discovery alone; check the server and OpenCode configuration. If you use Ollama and tool calls are not working, OpenCode’s provider documentation suggests increasing num_ctx, starting around 16k–32k. That is troubleshooting guidance, not a guarantee that every model or local machine will provide reliable tool use at those settings.
Compare real billing terms, not an assumed cheapest model
OpenCode’s v2 provider schema supports input, output, and optional cache pricing per million tokens. Those fields are a way to represent rates, not a consolidated live price list. Actual rates and charges depend on the provider and may change; the retrieved OpenCode documentation does not establish current prices across providers or a cost-per-task comparison.
For a useful cost comparison, check the provider’s current billing terms for each candidate, including input and output rates and cache pricing where applicable. Then consider the likely input/output mix of the same representative task. A model with a low rate in one category may not be the least expensive for a workflow that generates long outputs or repeatedly sends large inputs. Confirm live rates with the provider rather than relying on an old comparison.
Use OpenCode’s model examples as candidates, not a ranking
OpenCode’s Models page names GPT 5.2, GPT 5.1 Codex, Claude Opus 4.5, Claude Sonnet 4.5, Minimax M2.1, and Gemini 3 Pro as examples that work well with OpenCode, in no particular order. The page explicitly says, “This is not an exhaustive list nor is it necessarily up to date.” The examples do not establish that these models are all currently available to you, outperform one another, or suit every repository.
Best Value
Build a shortlist from models you can actually select, then compare them on the same representative work. OpenCode’s suggested examples are not a controlled cross-model benchmark, so they cannot substitute for testing your own tasks.
A practical way to choose a default
- List available candidates. Open
/modelsin the project and note the provider/model identifiers you can select. - Check the setup and limits. Confirm credentials and project availability; record context, input, and output limits from the model and provider configuration.
- Confirm tool capability. Check the model’s documented support and, for a custom or local deployment, the server and OpenCode capability settings.
- Choose representative tasks. Use work you genuinely expect to do, such as a focused bug fix and a multi-file change. Keep the task and supplied repository context comparable between candidates.
- Compare results and cost. Assess whether each model completes the work correctly and uses tools as needed, then compare the likely token mix with current provider billing.
- Set the default that fits. Select the best fit for your usual workload, and keep another available model for tasks where different limits, tool support, or billing make it a better choice.
This method produces a workflow-specific choice rather than a universal winner. OpenCode’s official documentation does not establish one model as best for every project or task.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




