Skip to content

OpenCode Full Analysis: An Open-Source Terminal Agent Supporting 75+ Model Providers

Apr 2, 20261 min
TL;DROpenCode is a free, open-source TypeScript CLI agent (MIT). It supports 75+ model providers including local Ollama, can connect external providers and supported subscription plans, and lets you switch models mid-session. There is also a desktop app, built-in free models, and an optional Console service.

Look up & save

Loading dictionary…

🌏 中文版

In the 2025-2026 boom of Agent CLIs, most tools are locked to a single model provider -- Claude Code to Anthropic, Codex CLI to OpenAI, Gemini CLI to Google. OpenCode took a different path: fully open-source, zero vendor lock-in, supporting 75+ model providers.

This post provides an in-depth analysis of OpenCode's architecture, pricing, core features, and its unique position within the Agent CLI ecosystem.

Product Positioning

OpenCode is an open-source coding agent written in TypeScript and licensed under MIT, maintained under the anomalyco org.

⚠️ A common case of mistaken identity: an earlier project called opencode-ai/opencode was written in Go with Bubble Tea, and it is not the same codebase as this OpenCode. Much of the "OpenCode is written in Go and licensed Apache-2.0" claim circulating online — including in the previous version of this post — traces back to that confusion. Go by the current repo: TypeScript, MIT.

The terminal interface is far from a bare-bones text-only experience — OpenCode offers a full TUI with panel switching, syntax highlighting, and interactive operations. It runs in the terminal but feels close to a GUI. Beyond the TUI there is now also a desktop app with platform-specific downloads and an IDE extension.

For a new V2 installation, use npm install --global @opencode/cli, then verify the version with opencode --version. The command remains opencode. V1 uses the older opencode-ai package; on Windows, use the official V2 standalone CLI download.

Pricing Model

The application is free and open source, and model access can also be free. Keep these options separate:

OptionCostWhat it means
OpenCode applicationOpen sourceThe client, not unlimited access to every model
Built-in free modelsFree within service limitsSelect an available free entry in /models; check both Input and Output in the official price table
Console paid modelsPay-as-you-goPrepaid access to the official model catalog
OpenCode GoOptional paid subscriptionIncluded usage subject to the plan's limits
External provider or local modelDepends on the service or hardwareA provider's free tier, paid API, or local inference
Supported subscription sign-inUses an existing paid planAccount eligibility and plan limits still apply

For example, the official Console table lists Big Pickle (opencode/big-pickle) with free input and output. You can start with a native free model without connecting OpenRouter. Free availability and usage limits may change. An existing paid subscription is not a free model merely because it avoids a separate API bill.

Supported Providers

OpenCode supports 75+ LLM providers, covering major cloud and local options:

  • OpenAI (GPT-4o, o3, etc.)
  • Anthropic Claude (Sonnet, Opus)
  • Google Gemini (Gemini 3 series)
  • AWS Bedrock (access multiple providers through your AWS account)
  • Azure OpenAI (enterprise-grade deployment)
  • Groq (ultra-low latency inference)
  • OpenRouter (aggregated routing)
  • Ollama (local models, fully offline)

Provider and model metadata comes from Models.dev.

OpenCode Console

The current V2 documentation groups the official model service under Console, rather than the older Zen name. Console offers a tested model catalog, paid usage, and free entries; Go is an optional subscription. You can use other providers instead. For the backend and API changes, see the OpenCode 2 guide.

The key capability: switch models mid-session without losing context. You can start a complex refactoring task with Claude Sonnet, switch to o3 when you need stronger reasoning, then switch back to Gemini for documentation generation -- the entire conversation history and working state is fully preserved.

This is hard to achieve with other Agent CLIs. Claude Code is locked to Anthropic models, Codex CLI is locked to OpenAI -- if you want to switch models, you have to start a new session.

Core Features

Interactive TUI

A full-featured terminal interface supporting panel splitting, live preview, and syntax highlighting. It includes a built-in Vim-like editor, so developers familiar with Vim keybindings can get started immediately.

Two built-in agents plus a subagent

Tab switches between two built-in agents: build (the default, full access for development work) and plan (read-only, denies file edits by default and asks before running bash — ideal for exploring an unfamiliar codebase). There is also a general subagent for complex searches and multi-step tasks, invoked with @general in a message.

Multi-Session Support

You can run multiple agent sessions in parallel on the same project. For example, one session handles frontend refactoring while another simultaneously works on backend API modifications. Sessions are isolated from each other, each maintaining its own context.

Session Sharing

Share sessions via links so team members can see the complete conversation history and operation records. Ideal for code review or knowledge transfer.

Persistent Storage

All session data is stored in a local SQLite database with no cloud dependency. Close the terminal and reopen it -- your previous sessions are still there.

LSP Integration

OpenCode automatically detects and configures language servers (Language Server Protocol), giving the LLM access to type information, definition navigation, error diagnostics, and other structured data when modifying code. This is more precise than simply feeding raw source code to the model.

Tool Integration

Like other Agent CLIs, OpenCode can execute shell commands, read and write files, and modify code. However, its tool system is designed to be more extensible -- it supports custom tool definitions.

Privacy First

Local SQLite history and data received by model services are separate boundaries. Cloud models still receive prompts, tool results, and selected code; session sharing also changes who can access the data. Console policies vary by model: data collected during Big Pickle's free period may be used to improve it. Local persistence does not mean that nothing is sent to or retained in the cloud.

Comparison with Claude Code

OpenCode and Claude Code are the two most closely positioned Agent CLIs, but their design philosophies are fundamentally different:

AspectOpenCodeClaude Code
CostOpen-source tool; free models or separately paid servicesPaid subscription or API billing
Supported Models75+ providersAnthropic models only
Context ManagementGood, supports mid-session switchingMore mature, sub-agent architecture
Vendor Lock-inZero lock-inLocked to Anthropic
LicenseMIT open-sourceProprietary software
InterfacesTUI + desktop app + IDE extensionTerminal + IDE + web
Local ModelsSupported (Ollama)Not supported

The conclusion is clear: if you're after the strongest agentic capability, Claude Code still leads. Its sub-agent architecture, CLAUDE.md system, Skills, and Hooks ecosystem are all more mature. But if you prioritize provider flexibility, cost control, or local model support, OpenCode is currently the best choice.

The Perfect Companion for Model Routing

OpenCode's 75+ provider support, combined with third-party model routers (such as freerouter or ruflo), can achieve maximum flexibility:

  • Cost optimization: Route simple tasks to cheaper models, complex tasks to powerful models
  • Latency optimization: Dynamically select providers based on response speed
  • Failover switching: Automatically switch to backup providers when the primary one goes down
  • Mid-session switching: OpenCode natively supports switching models mid-session, which is the key enabler for routing strategies

This combination -- OpenCode as the frontend agent + a model router as the backend dispatcher -- provides the most flexible architecture in the current Agent CLI ecosystem.

For more discussion on multi-model routing strategies, see Multi-Model Routing Strategies for Subscription-Based Agent CLIs.

Ideal Use Cases

OpenCode is best suited for the following types of developers and teams:

  • Those seeking provider independence: Don't want to be locked into any single LLM provider, want the freedom to switch at any time
  • Privacy-sensitive teams: Choose local models, or review the data terms of cloud providers
  • Local model users: Run local models via Ollama, operate completely offline
  • Developers with a supported subscription: Evaluate account sign-in while respecting the plan's eligibility and limits
  • Teams needing maximum model flexibility: Use different models for different tasks, switch mid-session without losing context
  • Budget-conscious individual developers: Start with built-in free models and evaluate payment later

If your need is "use the strongest model for the most complex tasks," Claude Code may be a better fit. But if your need is "use the most suitable model for each task," OpenCode's multi-provider architecture offers flexibility that other tools can't match.

For step-by-step setup, finding free models, and a first everyday prompt, read How to use LLMs for free with OpenCode 2 and OpenRouter.

Changelog

  • 2026-11-01: Updated V2 installation, native free-model access and optional Console/Go pricing; clarified subscription costs and cloud data policies, including Big Pickle.
  • 2026-08-18: Refreshed against the official repo and docs, correcting three substantive errors: (1) the language is TypeScript, not Go; (2) the license is MIT, not Apache-2.0; (3) the repo has long since moved off opencode-ai/opencode and is maintained by anomalyco (formerly sst/opencode). All three traced back to confusion with an earlier, identically named Go project, now flagged in the post. Also: stars 95K → ~198K; added the desktop app, the built-in build/plan agents and general subagent, Models.dev as the provider list source, and Zen's curation angle; removed a dead freerouter link and an outdated SWE-bench comparison

References